1import React from 'react';
2import { Button } from './Base';
4import { getRouteBreadcrumb } from '../../lib/router';
5import { ROUTE_NAMES } from '../../lib/routeNames';
6import { useHistory } from '../../store/history';
7import { isLast } from '../../lib/lib';
8import { usePointCursor } from '../../store/pointCursor';
10// hook to create a breadcrumb builder function based on the current
12function useRouteBreadcrumbBuilder() {
13 const { pointCursor } = usePointCursor();
15 return getRouteBreadcrumb({ pointCursor });
18function Crumbs(props) {
19 const history = useHistory();
20 const breadcrumbBuilder = useRouteBreadcrumbBuilder();
24 {history.routes.map((route, idx) => {
26 <div key={`history-${idx}`} className={'flex items-center'}>
30 onClick={() => history.pop(history.size - idx - 1)}>
31 {breadcrumbBuilder(route)}
34 {isLast(history.size, idx) ? <div /> : '/'}
42function Header(props) {
43 const history = useHistory();
45 const showCrumbs = !history.includes(ROUTE_NAMES.INVITE_TICKET);
49 <div className={'flex items-center h-10'}>
56 <h2 className="mt-9 clickable" onClick={() => history.pop()}>
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