mirror of
https://github.com/dsoaress/link-free.git
synced 2026-11-18 02:08:34 +00:00
40 lines
725 B
TypeScript
40 lines
725 B
TypeScript
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}
|
|
</>
|
|
)
|
|
}
|