1import React, { useCallback } from 'react';
2import cn from 'classnames';
3import { Flex } from 'indigo-react';
5import Footer from './Footer';
6import useBreakpoints from 'lib/useBreakpoints';
7import { MiniBackButton } from './MiniBackButton';
8import { useHistory } from 'store/history';
9import NavHeader from './NavHeader';
11// View is a top-level component that all Views must render to inherit styling
22 const { reset } = useHistory();
23 const isMobile = useBreakpoints([true, false, false]);
24 const shouldInset = inset && !isMobile;
26 const insetPadding = cn({
31 const goBack = useCallback(() => pop(), [pop]);
33 const goLogout = reset;
35 const showBackButton = !!pop;
37 const Header = useCallback(
39 return showBackButton ? (
44 'flex-row-r justify-between pb5 align-center'
49 className="f5 gray4 underline mr2 pointer">
52 <Flex.Item as={NavHeader.Target} />
55 <Flex.Item className={insetPadding} as={NavHeader.Target} />
58 [goLogout, insetPadding, showBackButton]
70 'mw2 ph9-md ph10-lg': full,
78 style={{ width: '48px' }}
79 className={cn(insetPadding)}>
80 {showBackButton && !hideBack && (
90 <Flex.Item flex={1} as={Flex} col justify="between">
91 <Flex.Item className="pb5 ">
92 {header || <Header logout={goBack} />}
95 <Flex.Item as={Footer.Target} />
98 <Flex.Item style={{ width: '48px' }} />
103// View.Full is sugar for <View full /> to help with readability
104View.Full = function FullView(props) {
105 return <View full {...props} />;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list