mirror of
https://github.com/dsoaress/link-free.git
synced 2026-11-27 21:24:44 +00:00
refactor: imp some components
This commit is contained in:
13 files changed
+217
-143
No files matched your search
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -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'
|
||||
})
|
||||
Reference in new issue
Block a user