2020-08-07 18:03:18 +00:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import styled from 'styled-components';
|
2020-08-07 18:25:41 +00:00
|
|
|
import { remSize, prop } from '../../theme';
|
2020-08-07 18:03:18 +00:00
|
|
|
import Button from '../../common/Button';
|
|
|
|
import IconButton from './IconButton';
|
|
|
|
|
|
|
|
const FloatingContainer = styled.div`
|
2020-08-11 16:00:36 +00:00
|
|
|
position: fixed;
|
2020-08-07 18:03:18 +00:00
|
|
|
right: ${remSize(16)};
|
|
|
|
top: ${remSize(80)};
|
|
|
|
|
|
|
|
text-align: right;
|
|
|
|
z-index: 3;
|
2020-08-07 18:25:41 +00:00
|
|
|
|
|
|
|
svg { width: ${remSize(32)}; };
|
|
|
|
svg > path { fill: ${prop('Button.default.background')} !important };
|
2020-08-07 18:03:18 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
const FloatingNav = ({ items }) => (
|
|
|
|
<FloatingContainer>
|
|
|
|
{ items.map(({ icon, onPress }) =>
|
|
|
|
(
|
|
|
|
<IconButton
|
|
|
|
onClick={onPress}
|
|
|
|
icon={icon}
|
|
|
|
/>
|
|
|
|
))}
|
|
|
|
</FloatingContainer>
|
|
|
|
);
|
|
|
|
|
|
|
|
FloatingNav.propTypes = {
|
|
|
|
items: PropTypes.arrayOf(PropTypes.shape({
|
|
|
|
icon: PropTypes.element,
|
|
|
|
onPress: PropTypes.func
|
|
|
|
}))
|
|
|
|
};
|
|
|
|
|
|
|
|
FloatingNav.defaultProps = {
|
|
|
|
items: []
|
|
|
|
};
|
|
|
|
|
|
|
|
export default FloatingNav;
|