1import React from 'react';
2import { Button, Chevron } from './Base';
4import { getRouteBreadcrumb } from '../lib/router';
5import { ROUTE_NAMES } from '../lib/routeNames';
6import { useHistory } from '../store/history';
7import { isLast } from '../lib/lib';
8import { useNetwork } from '../store/network';
9import { useWallet } from '../store/wallet';
10import { usePointCursor } from '../store/pointCursor';
12// hook to create a breadcrumb builder function based on the current
14function useRouteBreadcrumbBuilder() {
15 const { networkType } = useNetwork();
16 const { wallet } = useWallet();
17 const { pointCursor } = usePointCursor();
19 return getRouteBreadcrumb({ pointCursor, networkType, wallet });
22function Crumbs(props) {
23 const history = useHistory();
24 const breadcrumbBuilder = useRouteBreadcrumbBuilder();
28 {history.routes.map((route, idx) => {
30 <div key={`history-${idx}`} className={'flex items-center'}>
34 onClick={() => history.pop(history.size - idx - 1)}>
35 {breadcrumbBuilder(route)}
38 {isLast(history.size, idx) ? (
41 <Chevron className={'h-4 mh-2'} />
50function Header(props) {
51 const history = useHistory();
53 const showCrumbs = !history.includes(ROUTE_NAMES.INVITE_TICKET);
57 <div className={'flex items-center h-10'}>
64 <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