joyent-portal/packages/ui-toolkit/src/footer/sticky.js

64 lines
1.3 KiB
JavaScript
Raw Normal View History

import React from 'react';
import styled from 'styled-components';
import is from 'styled-is';
import remcalc from 'remcalc';
import { ViewContainer } from '../layout';
const Container = styled(ViewContainer)`
display: flex;
flex-wrap: nowrap;
align-content: stretch;
align-items: stretch;
2018-05-25 18:27:05 +03:00
background: ${props =>
props.fill
? props.theme[props.fill] ? props.theme[props.fill] : props.fill
: props.theme.background};
`;
const Footer = styled.div`
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: stretch;
align-items: stretch;
2018-05-17 13:05:28 +03:00
background-color: ${props =>
2018-05-25 18:27:05 +03:00
props.fill
? props.theme[props.fill] ? props.theme[props.fill] : props.fill
: 'rgba(241, 241, 241, 1)'};
border-top: ${remcalc(1)} solid ${props => props.theme.grey};
line-height: ${remcalc(25)};
height: ${remcalc(70)};
z-index: 1;
2018-03-06 03:47:30 +02:00
2018-05-25 18:27:05 +03:00
${is('auto')`
height: auto;
`};
${is('borderless')`
border: none;
`};
${is('fixed')`
position: fixed;
left: 0;
right: 0;
`};
2018-03-06 03:47:30 +02:00
${is('bottom', 'fixed')`
bottom: 0;
`};
2018-05-25 18:27:05 +03:00
${is('top', 'fixed')`
top: 0;
`};
`;
2018-05-25 18:27:05 +03:00
export default ({ children, fluid, innerFill, ...rest }) => (
<Footer {...rest}>
2018-05-25 18:27:05 +03:00
<Container fill={innerFill || rest.fill} fluid={fluid}>
{children}
</Container>
</Footer>
);