Layout.tsx 564 字节
Newer Older
1
import React, {FunctionComponent} from 'react';
2 3
import {headerHeight, position, size} from '~/utils/style';

4
import Navbar from '~/components/Navbar';
5
import styled from 'styled-components';
6 7 8 9 10 11 12

const Main = styled.main`
    padding-top: ${headerHeight};
`;

const Header = styled.header`
    z-index: 10000;
13 14 15

    ${size(headerHeight, '100%')}
    ${position('fixed', 0, 0, null, 0)}
16 17 18 19 20 21 22 23 24 25 26 27
`;

const Layout: FunctionComponent = ({children}) => (
    <Main>
        <Header>
            <Navbar />
        </Header>
        {children}
    </Main>
);

export default Layout;