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
21 const { reset } = useHistory();
22 const isMobile = useBreakpoints([true, false, false]);
23 const shouldInset = inset && !isMobile;
25 const insetPadding = cn({
30 const goBack = useCallback(() => pop(), [pop]);
32 const goLogout = reset;
34 const showBackButton = !!pop;
36 const Header = useCallback(
38 return showBackButton ? (
43 'flex-row-r justify-between pb5 align-center'
48 className="f5 gray4 underline mr2 pointer">
51 <Flex.Item as={NavHeader.Target} />
54 <Flex.Item className={insetPadding} as={NavHeader.Target} />
57 [goLogout, insetPadding, showBackButton]
69 'mw2 ph9-md ph10-lg': full,
77 style={{ width: '48px' }}
78 className={cn(insetPadding)}>
79 {showBackButton && !hideBack && (
89 <Flex.Item flex={1} as={Flex} col justify="between">
90 <Flex.Item className="pb5 ">
91 <Header logout={goBack} />
94 <Flex.Item as={Footer.Target} />
97 <Flex.Item style={{ width: '48px' }} />
102// View.Full is sugar for <View full /> to help with readability
103View.Full = function FullView(props) {
104 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