From 217410852f19ccd4ded27166f6bd13c1f01e9c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Quiroz?= Date: Fri, 7 Oct 2022 22:18:55 -0500 Subject: [PATCH] chore: add button and link variants --- src/components/UI/homepage/HomeSection.tsx | 29 ++------ src/components/UI/homepage/QuickLinks.tsx | 78 +++++++++------------- src/pages/index.tsx | 10 +-- src/theme/components/Link.ts | 16 +++++ src/theme/components/index.ts | 1 + src/theme/index.ts | 20 +++++- 6 files changed, 74 insertions(+), 80 deletions(-) create mode 100644 src/theme/components/Link.ts diff --git a/src/components/UI/homepage/HomeSection.tsx b/src/components/UI/homepage/HomeSection.tsx index 13339eb8ad..01d47d30ab 100644 --- a/src/components/UI/homepage/HomeSection.tsx +++ b/src/components/UI/homepage/HomeSection.tsx @@ -6,7 +6,7 @@ interface Props { imgSrc?: string; imgAltText?: string; sectionTitle: string; - buttonLabel: string; + linkLabel: string; buttonHref: string; children?: React.ReactNode; } @@ -15,7 +15,7 @@ export const HomeSection: FC = ({ imgSrc, imgAltText, sectionTitle, - buttonLabel, + linkLabel, buttonHref, children }) => { @@ -51,29 +51,8 @@ export const HomeSection: FC = ({ - - - {buttonLabel} - + + {linkLabel} diff --git a/src/components/UI/homepage/QuickLinks.tsx b/src/components/UI/homepage/QuickLinks.tsx index 2b431f596d..370226f288 100644 --- a/src/components/UI/homepage/QuickLinks.tsx +++ b/src/components/UI/homepage/QuickLinks.tsx @@ -21,13 +21,11 @@ export const QuickLinks: FC = () => { borderColor='brand.light.primary' > - + Don't know where to start? - - We can help. - + We can help. @@ -52,19 +50,7 @@ export const QuickLinks: FC = () => { h='100%' p={4} > - - Get started - + Get started @@ -77,13 +63,11 @@ export const QuickLinks: FC = () => { borderColor='brand.light.primary' > - + Have doubts? - - Check the FAQ section in the documentation. - + Check the FAQ section in the documentation. @@ -93,21 +77,22 @@ export const QuickLinks: FC = () => { data-group bg='green.50' _hover={{ textDecoration: 'none', bg: 'brand.light.primary', color: 'yellow.50' }} + _focus={{ + textDecoration: 'none', + bg: 'brand.light.primary', + color: 'yellow.50', + boxShadow: 'inset 0 0 0 3px #f0f2e2 !important' + }} + _active={{ + textDecoration: 'none', + bg: 'brand.light.secondary', + color: 'yellow.50' + }} justifyContent='center' h='100%' p={4} > - - Go to the FAQ - + Go to the FAQ @@ -116,13 +101,11 @@ export const QuickLinks: FC = () => { {/* how to contribute */} - + Want to know how to contribute? - - Get more information in the documentation. - + Get more information in the documentation. @@ -132,21 +115,22 @@ export const QuickLinks: FC = () => { data-group bg='green.50' _hover={{ textDecoration: 'none', bg: 'brand.light.primary', color: 'yellow.50' }} + _focus={{ + textDecoration: 'none', + bg: 'brand.light.primary', + color: 'yellow.50', + boxShadow: 'inset 0 0 0 3px #f0f2e2 !important' + }} + _active={{ + textDecoration: 'none', + bg: 'brand.light.secondary', + color: 'yellow.50' + }} justifyContent='center' h='100%' p={4} > - - How to contribute - + How to contribute diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 9f055d5bbf..d539a2f864 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -26,7 +26,7 @@ const HomePage: NextPage = ({}) => { imgSrc='/images/pages/gopher-home-front.svg' imgAltText='Gopher greeting' sectionTitle='What is Geth' - buttonLabel='Get started with Geth' + linkLabel='Get started with Geth' buttonHref={`${DOCS_PAGE}/getting-started`} > @@ -100,7 +100,7 @@ const HomePage: NextPage = ({}) => { imgSrc='/images/pages/glyph-home-light.svg' imgAltText='Ethereum glyph' sectionTitle='What is Ethereum' - buttonLabel='Learn more on Ethereum.org' + linkLabel='Learn more on Ethereum.org' buttonHref={ETHEREUM_ORG_URL} > @@ -115,7 +115,7 @@ const HomePage: NextPage = ({}) => { imgSrc='/images/pages/gopher-home-nodes.svg' imgAltText='Gopher staring at nodes' sectionTitle='Why run a node?' - buttonLabel='Read more about running a node' + linkLabel='Read more about running a node' buttonHref={ETHEREUM_ORG_RUN_A_NODE_URL} > @@ -132,7 +132,7 @@ const HomePage: NextPage = ({}) => { {/* SECTION:Contribute to Geth */} @@ -165,7 +165,7 @@ const HomePage: NextPage = ({}) => { {/* SECTION: About the Team */} diff --git a/src/theme/components/Link.ts b/src/theme/components/Link.ts new file mode 100644 index 0000000000..2e747c4324 --- /dev/null +++ b/src/theme/components/Link.ts @@ -0,0 +1,16 @@ +export const Link = { + variants: { + secondary: { + color: 'brand.light.primary', + bg: 'green.50', + _hover: { textDecoration: 'none', bg: 'brand.light.primary', color: 'yellow.50' }, + _focus: { + textDecoration: 'none', + bg: 'brand.light.primary', + color: 'yellow.50', + boxShadow: 'inset 0 0 0 3px #f0f2e2 !important' + }, + _active: { textDecoration: 'none', bg: 'brand.light.secondary', color: 'yellow.50' } + } + } +}; diff --git a/src/theme/components/index.ts b/src/theme/components/index.ts index 8b166a86e4..4b249348b6 100644 --- a/src/theme/components/index.ts +++ b/src/theme/components/index.ts @@ -1 +1,2 @@ export * from './Button'; +export * from './Link'; diff --git a/src/theme/index.ts b/src/theme/index.ts index ba6300439f..ee49f0ac91 100644 --- a/src/theme/index.ts +++ b/src/theme/index.ts @@ -1,12 +1,13 @@ import { extendTheme } from '@chakra-ui/react'; import { colors, sizes } from './foundations'; -import { Button } from './components'; +import { Button, Link } from './components'; const overrides = { colors, components: { - Button + Button, + Link }, sizes, styles: { @@ -16,7 +17,6 @@ const overrides = { } }) }, - // TODO: fix textStyles textStyles: { h1: { fontFamily: '"JetBrains Mono", monospace', @@ -47,6 +47,20 @@ const overrides = { fontWeight: 700, textTransform: 'uppercase' }, + 'quick-link-text': { + fontFamily: '"Inter", sans-serif', + lineHeight: '26px' + }, + 'quick-link-label': { + fontFamily: '"JetBrains Mono", monospace', + fontWeight: 700, + textTransform: 'uppercase', + textAlign: 'center', + color: 'brand.light.primary', + _groupHover: { color: 'yellow.50' }, + _groupActive: { color: 'yellow.50' }, + _groupFocus: { color: 'yellow.50' } + }, 'hero-text-small': { fontSize: '13px', fontFamily: '"Inter", sans-serif'