diff options
author | lonkaars <l.leblansch@gmail.com> | 2021-01-06 13:53:56 +0100 |
---|---|---|
committer | lonkaars <l.leblansch@gmail.com> | 2021-01-06 13:53:56 +0100 |
commit | 90d55c83cb4a6e3cf76622b0b8a2a9aa13fd2ba0 (patch) | |
tree | 6185801f66d7f27be394f2ba88b36670cf437941 /src/components/page.tsx | |
parent | 214c263470d26256ce53ad0dc17df6acd42a5442 (diff) |
spel pagina
Diffstat (limited to 'src/components/page.tsx')
-rw-r--r-- | src/components/page.tsx | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/src/components/page.tsx b/src/components/page.tsx index 44b00ba..b368eee 100644 --- a/src/components/page.tsx +++ b/src/components/page.tsx @@ -1,31 +1,30 @@ -import { Component, CSSProperties } from 'react'; +import { Component, ReactNode } from 'react'; -var CenteredPageStyle: CSSProperties = { - maxWidth: 802, - margin: "0 auto" +interface CenteredPageProps { + width?: number; + children?: ReactNode; } -export class CenteredPage extends Component { - render () { - return <div className="CenteredPageOuter" style={CenteredPageStyle}> - <div className="CenteredPageInner" style={{ - margin: "0 6px", - lineHeight: 0 - }}> {this.props.children} </div> - </div>; - } -} - -var PageTitleStyle: CSSProperties = { - color: "var(--text-alt)", - marginLeft: 6, - marginTop: 32, - marginBottom: 64, - fontSize: 25 +export function CenteredPage (props: CenteredPageProps) { + return <div className="CenteredPageOuter" style={{ + maxWidth: props.width, + margin: "0 auto" + }}> + <div className="CenteredPageInner" style={{ + margin: "0 6px", + lineHeight: 0 + }}> {props.children} </div> + </div>; } export class PageTitle extends Component { render () { - return <h1 style={PageTitleStyle}>{this.props.children}</h1>; + return <h1 style={{ + color: "var(--text-alt)", + marginLeft: 6, + marginTop: 32, + marginBottom: 64, + fontSize: 25 + }}>{this.props.children}</h1>; } } |