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

+39
View File
@@ -0,0 +1,39 @@
import { ReactNode } from 'react'
import { createGlobalStyle } from 'styled-components'
import { useData } from '../hooks/useData'
import { Data } from '../types/Data'
type GlobalStyleProps = {
data: Data
}
type LayoutProps = {
children: ReactNode
}
const GlobalStyles = createGlobalStyle<GlobalStyleProps>`
* {
margin: 0;
padding: 0;
box-sizing: border-box;
transition: all 0.25s ease;
}
body {
font-family: "Roboto", sans-serif;
color: #0f172a;
background: ${({ data }) => data.settings.colors.background};
}
`
export function Layout({ children }: LayoutProps) {
const { data } = useData()
return (
<>
<GlobalStyles data={data} />
{children}
</>
)
}