refactor: with styled-components

This commit is contained in:
Daniel Soares committed 2021-12-18 00:50:54 -03:00
1 parent 5138b4dfc2
commit 47d03b6d73
42 files changed
+845 -934

No files matched your search

+10 -23
View File
@@ -1,7 +1,4 @@
import Head from 'next/head'
import { useData } from '../../hooks/useData'
import { theme } from '../../styles/stitches.config'
import { Avatar } from '../Avatar'
import { Button } from '../Button'
import { SocialLinks } from '../SocialLinks'
@@ -9,34 +6,24 @@ import { Content, Description, Name, Wrapper } from './styles'
export const Home = () => {
const { data } = useData()
const { colors, buttonsSchema, outline, font, name, description } = data.settings
const { colors, buttonsSchema, font, name, description } = data.settings
return (
<Wrapper
css={{
color: theme.colors[colors.texts],
fontFamily: theme.fonts[font]
}}
>
<Head>
<style
dangerouslySetInnerHTML={{
__html: `body { background: ${theme.colors[colors.background]} }`
}}
/>
</Head>
<Wrapper color={colors.texts} font={font}>
<Content>
<Avatar />
<Name>{name}</Name>
<SocialLinks />
<Description>{description}</Description>
{data.buttonLinks?.map(link => (
{data.buttonLinks?.map((link, i) => (
<Button
colorSchema={colors.buttonLinks}
styleSchema={buttonsSchema}
outline={outline}
font={font}
key={link.href}
as="a"
href={link.href}
rel="noopener noreferrer"
target="_blank"
// key={link.id}
key={i}
variant={buttonsSchema}
>
{link.label}
</Button>