fix(page): fix page footer width (#387)

This commit is contained in:
Konrad Kalemba
2020-10-01 10:39:35 +02:00
committed by GitHub
parent 6a3988c934
commit 25cff19e38
2 changed files with 5 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ exports[`PageChild should work with child component 1`] = `
}
</style></main><footer class=\\"\\">Footer<style>
footer {
width: 100%;
width: calc(100% - 16pt * 2);
position: absolute;
bottom: 0;
}

View File

@@ -1,4 +1,5 @@
import React from 'react'
import useTheme from '../styles/use-theme'
import withDefaults from '../utils/with-defaults'
interface Props {
@@ -13,12 +14,14 @@ type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>
export type PageHeaderProps = Props & typeof defaultProps & NativeAttrs
const PageFooter: React.FC<React.PropsWithChildren<PageHeaderProps>> = ({ children, ...props }) => {
const theme = useTheme()
return (
<footer {...props}>
{children}
<style jsx>{`
footer {
width: 100%;
width: calc(100% - ${theme.layout.gap} * 2);
position: absolute;
bottom: 0;
}