From 86d3e30ef02585d5089dce3aa2757ca2cb4e4edf Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 17 Jan 2022 16:41:53 +0100 Subject: chore: replace copyright icon import with custom component It allows me to set the colors with CSS and it will be easier to implement dark mode. --- src/components/Copyright/Copyright.module.scss | 6 ++---- src/components/Copyright/Copyright.tsx | 4 ++-- .../Icons/Copyright/Copyright.module.scss | 8 ++++++++ src/components/Icons/Copyright/Copyright.tsx | 24 ++++++++++++++++++++++ src/components/Icons/index.tsx | 2 ++ 5 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 src/components/Icons/Copyright/Copyright.module.scss create mode 100644 src/components/Icons/Copyright/Copyright.tsx (limited to 'src') diff --git a/src/components/Copyright/Copyright.module.scss b/src/components/Copyright/Copyright.module.scss index 244d507..5ebbca4 100644 --- a/src/components/Copyright/Copyright.module.scss +++ b/src/components/Copyright/Copyright.module.scss @@ -1,6 +1,8 @@ @use "@styles/abstracts/functions" as fun; .wrapper { + --icon-size: #{fun.convert-px(70)}; + display: flex; flex-flow: row nowrap; align-items: center; @@ -9,7 +11,3 @@ font-family: var(--font-family-secondary); font-size: var(--font-size-sm); } - -.icon { - height: fun.convert-px(20); -} diff --git a/src/components/Copyright/Copyright.tsx b/src/components/Copyright/Copyright.tsx index 0dc6247..9a57f9c 100644 --- a/src/components/Copyright/Copyright.tsx +++ b/src/components/Copyright/Copyright.tsx @@ -1,4 +1,4 @@ -import CopyrightIcon from '@assets/images/cc-by-sa.svg'; +import { CopyrightIcon } from '@components/Icons'; import { config } from '@config/website'; import styles from './Copyright.module.scss'; @@ -6,7 +6,7 @@ const Copyright = () => { return (

{config.name} - + {config.copyright.startYear} - {config.copyright.endYear} diff --git a/src/components/Icons/Copyright/Copyright.module.scss b/src/components/Icons/Copyright/Copyright.module.scss new file mode 100644 index 0000000..0497c1d --- /dev/null +++ b/src/components/Icons/Copyright/Copyright.module.scss @@ -0,0 +1,8 @@ +@use "@styles/abstracts/functions" as fun; + +.icon { + display: block; + margin: auto; + width: var(--icon-size, #{fun.convert-px(40)}); + fill: var(--color-fg); +} diff --git a/src/components/Icons/Copyright/Copyright.tsx b/src/components/Icons/Copyright/Copyright.tsx new file mode 100644 index 0000000..396c127 --- /dev/null +++ b/src/components/Icons/Copyright/Copyright.tsx @@ -0,0 +1,24 @@ +import { t } from '@lingui/macro'; +import styles from './Copyright.module.scss'; + +const CopyrightIcon = () => { + return ( + + {t`CC BY SA`} + + + + + + + + + + ); +}; + +export default CopyrightIcon; diff --git a/src/components/Icons/index.tsx b/src/components/Icons/index.tsx index eae50a5..68aa2ac 100644 --- a/src/components/Icons/index.tsx +++ b/src/components/Icons/index.tsx @@ -3,6 +3,7 @@ import BlogIcon from './Blog/Blog'; import CloseIcon from './Close/Close'; import CogIcon from './Cog/Cog'; import ContactIcon from './Contact/Contact'; +import CopyrightIcon from './Copyright/Copyright'; import CVIcon from './CV/CV'; import HamburgerIcon from './Hamburger/Hamburger'; import HomeIcon from './Home/Home'; @@ -16,6 +17,7 @@ export { CloseIcon, CogIcon, ContactIcon, + CopyrightIcon, CVIcon, HamburgerIcon, HomeIcon, -- cgit v1.2.3