on 3f629b7 help sign in
39 lines 862 B history raw
1import React from 'react';
2import cn from 'classnames';
3import { Flex } from 'indigo-react';
5import Footer from './Footer';
7// View is a top-level component that all Views must render to inherit styling
8function View({ className, children, inset = false, full = false, ...rest }) {
9 return (
10 <Flex
11 col
12 justify="between"
13 className={cn(
14 'minh-100 ph5',
15 {
16 mw1: !full,
17 'mw2 ph9-md ph10-lg': full,
18 },
19 className
20 )}
21 {...rest}>
22 <Flex.Item
23 className={cn('pb5', {
24 pt10: inset,
25 pt5: !inset,
26 })}>
27 {children}
28 </Flex.Item>
29 <Footer.Target />
30 </Flex>
31 );
34// View.Full is sugar for <View full /> to help with readability
35View.Full = function FullView(props) {
36 return <View full {...props} />;
37};
39export default View;