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
23 const { reset } = useHistory();
24 const isMobile = useBreakpoints([true, false, false]);
25 const shouldInset = inset && !isMobile;
27 const insetPadding = cn({
32 const goBack = useCallback(() => pop(), [pop]);
34 const goLogout = reset;
36 const showBackButton = !!pop;
38 const Header = useCallback(
40 return showBackButton ? (
45 'flex-row-r justify-between pb5 align-center'
50 className="f5 gray4 underline mr2 pointer">
53 <Flex.Item as={NavHeader.Target} />
56 <Flex.Item className={insetPadding} as={NavHeader.Target} />
59 [goLogout, insetPadding, showBackButton]
71 'mw2 ph9-md ph10-lg': full,
79 style={{ width: '48px' }}
80 className={cn(insetPadding)}>
81 {showBackButton && !hideBack && (
96 'justify-between': !centered,
97 'justify-center': centered,
99 <Flex.Item className="pb5 ">
100 {header || <Header logout={goBack} />}
103 <Flex.Item as={Footer.Target} />
106 <Flex.Item style={{ width: '48px' }} />
111// View.Full is sugar for <View full /> to help with readability
112View.Full = function FullView(props) {
113 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