2020-06-16 20:38:43 +00:00
|
|
|
import React from 'react';
|
|
|
|
import styled from 'styled-components';
|
2020-07-15 20:24:12 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2020-06-16 20:38:43 +00:00
|
|
|
import { prop, remSize } from '../../theme';
|
|
|
|
|
2020-07-15 20:24:12 +00:00
|
|
|
|
2020-07-01 18:52:23 +00:00
|
|
|
const background = prop('MobilePanel.default.background');
|
2020-06-16 20:38:43 +00:00
|
|
|
const textColor = prop('primaryTextColor');
|
|
|
|
|
2020-07-15 20:24:12 +00:00
|
|
|
const FooterWrapper = styled.div`
|
2020-06-16 20:38:43 +00:00
|
|
|
position: fixed;
|
|
|
|
width: 100%;
|
2020-07-15 20:24:12 +00:00
|
|
|
bottom: 0;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const FooterContent = styled.div`
|
2020-06-16 20:38:43 +00:00
|
|
|
background: ${background};
|
|
|
|
color: ${textColor};
|
|
|
|
padding: ${remSize(12)};
|
|
|
|
padding-left: ${remSize(32)};
|
|
|
|
`;
|
|
|
|
|
2020-07-15 20:24:12 +00:00
|
|
|
const Footer = ({ before, children }) => (
|
|
|
|
<FooterWrapper>
|
|
|
|
{before}
|
|
|
|
<FooterContent>
|
|
|
|
{children}
|
|
|
|
</FooterContent>
|
|
|
|
</FooterWrapper>
|
|
|
|
);
|
|
|
|
|
|
|
|
Footer.propTypes = {
|
|
|
|
before: PropTypes.element,
|
2020-07-15 20:32:38 +00:00
|
|
|
children: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf(PropTypes.element)]),
|
2020-07-15 20:24:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Footer.defaultProps = {
|
|
|
|
before: <></>,
|
|
|
|
children: <></>
|
|
|
|
};
|
|
|
|
|
2020-06-16 20:38:43 +00:00
|
|
|
export default Footer;
|