diff --git a/content/meta.yml b/content/meta.yml index 6f76a1f..6dbe389 100644 --- a/content/meta.yml +++ b/content/meta.yml @@ -7,7 +7,7 @@ img: ../src/images/twitter-card.png social: - Email: mailto:m@kretschmann.io + Mail: mailto:m@kretschmann.io Blog: https://kremalicious.com Twitter: https://twitter.com/kremalicious GitHub: https://github.com/kremalicious diff --git a/content/projects.yml b/content/projects.yml index 013806e..ac556eb 100644 --- a/content/projects.yml +++ b/content/projects.yml @@ -9,24 +9,24 @@ Initial website in collaboration with [Balance](https://balance.io/). Key visuals in collaboration with [Wojciech Hupert](https://twitter.com/wojciechhupert). links: - title: oceanprotocol.com - icon: website + icon: Compass url: https://oceanprotocol.com - title: Styleguide url: https://oceanprotocol.com/art - title: docs.oceanprotocol.com - icon: website + icon: Compass url: https://docs.oceanprotocol.com - title: commons.oceanprotocol.com - icon: website + icon: Compass url: https://commons.oceanprotocol.com - title: '@oceanprotocol/art' - icon: github + icon: GitHub url: https://github.com/oceanprotocol/art - title: '@oceanprotocol/docs' - icon: github + icon: GitHub url: https://github.com/oceanprotocol/docs - title: '@oceanprotocol/commons' - icon: github + icon: GitHub url: https://github.com/oceanprotocol/commons techstack: - Sketch @@ -267,7 +267,7 @@ links: - title: Info & Download - icon: download + url: https://kremalicious.com/ipixelpad/ - title: Out Of Whale Oil slug: /outofwhaleoil/ @@ -276,7 +276,7 @@ Tribute wallpaper pack inspired by the Futurama movie _Into The Wild Green Yonder_. Released as a goodie on [kremalicious.com](https://kremalicious.com/out-of-whale-oil/). links: - title: Info & Download - icon: download + url: https://kremalicious.com/out-of-whale-oil/ techstack: - Photoshop @@ -318,7 +318,6 @@ links: - title: Info & Download - icon: download url: https://kremalicious.com/coffee-cup-icon/ - title: Project Purple @@ -334,7 +333,6 @@ links: - title: Info & Download - icon: download url: https://kremalicious.com/projectpurple/ - title: Allinnia Creative Group diff --git a/src/components/atoms/Icon.jsx b/src/components/atoms/Icon.jsx index 2245382..2ab0022 100644 --- a/src/components/atoms/Icon.jsx +++ b/src/components/atoms/Icon.jsx @@ -2,63 +2,31 @@ import React from 'react' import PropTypes from 'prop-types' // https://featherstyles.com -import { - Star, - FileText, - Compass, - ArrowDownCircle, - Info, - GitHub, - Mail, - Feather, - Twitter, - Image, - Moon, - Sun, - Key -} from 'react-feather' +import * as Feather from 'react-feather' import { ReactComponent as Dribbble } from '../../images/dribbble.svg' import styles from './Icon.module.scss' const Icon = ({ name, ...props }) => { - switch (name) { - case 'website': - case 'Link': - return - case 'github': - case 'GitHub': - return - case 'dribbble': - case 'Dribbble': - return - case 'info': - case 'Info': - return - case 'download': - case 'Download': - return - case 'styleguide': - case 'Styleguide': - return - case 'Email': - return - case 'Blog': - return - case 'Twitter': - return - case 'Keybase': - return - case 'star': - return - case 'image': - return - case 'day': - return - case 'night': - return - default: - return null + const components = { + Dribbble, + Link: Feather.Compass, + Download: Feather.ArrowDownCircle, + 'Info & Download': Feather.ArrowDownCircle, + Styleguide: Feather.FileText, + Blog: Feather.Edit, + Keybase: Feather.Key } + + const IconMapped = components[name] + const Icon = Feather[name] + + if (!IconMapped && !Icon) return null + + return IconMapped ? ( + + ) : ( + + ) } Icon.propTypes = { diff --git a/src/components/atoms/Icon.test.jsx b/src/components/atoms/Icon.test.jsx index 09c0ab3..879d7fe 100644 --- a/src/components/atoms/Icon.test.jsx +++ b/src/components/atoms/Icon.test.jsx @@ -5,25 +5,16 @@ import Icon from './Icon' describe('Icon', () => { it('renders correctly', () => { - const { container, rerender } = render() + const { container, rerender } = render() expect(container.firstChild.nodeName).toBe('svg') - rerender() + rerender() expect(container.firstChild.nodeName).toBe('svg') - rerender() + rerender() expect(container.firstChild.nodeName).toBe('svg') - rerender() - expect(container.firstChild.nodeName).toBe('svg') - - rerender() - expect(container.firstChild.nodeName).toBe('svg') - - rerender() - expect(container.firstChild.nodeName).toBe('svg') - - rerender() + rerender() expect(container.firstChild.nodeName).toBe('svg') rerender() @@ -33,7 +24,7 @@ describe('Icon', () => { expect(container.firstChild.nodeName).toBe('svg') }) - it('does not render with unknown type', () => { + it('does not render with unknown name', () => { const { container } = render() expect(container.firstChild).not.toBeInTheDocument() }) diff --git a/src/components/molecules/Repository.jsx b/src/components/molecules/Repository.jsx index f6a5a1e..03d6d87 100644 --- a/src/components/molecules/Repository.jsx +++ b/src/components/molecules/Repository.jsx @@ -34,16 +34,16 @@ export default function Repository({ repo }) { : !isExternal && homepage && ( - More info + More info )} - GitHub + GitHub - {stargazers_count} + {stargazers_count}

diff --git a/src/components/molecules/ThemeSwitch.jsx b/src/components/molecules/ThemeSwitch.jsx index bdd0ab5..0213b14 100644 --- a/src/components/molecules/ThemeSwitch.jsx +++ b/src/components/molecules/ThemeSwitch.jsx @@ -11,9 +11,9 @@ const Animation = posed.aside(fadeIn) const ThemeToggle = ({ dark }) => ( - + - + ) diff --git a/src/hooks/use-meta.js b/src/hooks/use-meta.js index 14f80dd..b917d18 100644 --- a/src/hooks/use-meta.js +++ b/src/hooks/use-meta.js @@ -23,7 +23,7 @@ const query = graphql` } } social { - Email + Mail Blog Twitter GitHub diff --git a/src/pages/index.jsx b/src/pages/index.jsx index a250189..16f23ed 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -43,7 +43,7 @@ function Project({ node, images }) { className={styles.imageCount} title={`${imageCount} project images`} > - {imageCount} + {imageCount} )}