refactor: imp some components

This commit is contained in:
Daniel Soares committed 2021-12-12 23:51:25 -03:00
1 parent 47bd52ffd7
commit 7b7e6b9cbd
13 files changed
+217 -143

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
import { useData } from '../../contexts/DataContext'
import { theme } from '../../styles/stitches.config'
import { Avatar } from '../Avatar'
import { Button } from '../Button'
import { SocialLinks } from '../SocialLinks'
import { Content, Description, Name, Wrapper } from './styles'
export const Home = () => {
const { data } = useData()
const { colors, buttonsSchema, outline, font, name, description } = data.settings
return (
<Wrapper
css={{
background: theme.colors[colors.background as keyof typeof theme.colors],
color: theme.colors[colors.texts as keyof typeof theme.colors]
}}
>
<Content>
<Avatar />
<Name>{name}</Name>
<SocialLinks />
<Description>{description}</Description>
{data.buttonLinks?.map(link =>
// @ts-ignore
// prettier-ignore
<Button color={colors.buttonLinks} schema={buttonsSchema} outline={outline} font={font} key={link.href}>
{link.label}
</Button>
)}
</Content>
</Wrapper>
)
}
+29
View File
@@ -0,0 +1,29 @@
import { styled } from '../../styles/stitches.config'
export const Wrapper = styled('main', {
width: '100%',
height: '100vh'
})
export const Content = styled('div', {
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
gap: '1rem',
margin: '0 auto',
maxWidth: '640px',
padding: '2rem 1rem'
})
export const Name = styled('h1', {
fontSize: '2rem',
fontWeight: 500,
margin: 0
})
export const Description = styled('p', {
fontSize: '1rem',
textAlign: 'center',
fontWeight: 400,
lineHeight: '1.5'
})