1import React, { createContext, forwardRef, useContext, useState } from 'react';
3export const TxnCursorContext = createContext(null);
5function _useTxnCursor() {
6 const [txnCursor, setTxnCursor] = useState({});
14export function TxnCursorProvider({ children }) {
15 const txnCursor = _useTxnCursor();
18 <TxnCursorContext.Provider value={txnCursor}>
20 </TxnCursorContext.Provider>
25export function useTxnCursor() {
26 return useContext(TxnCursorContext);
30export const withTxnCursor = Component =>
31 forwardRef((props, ref) => (
32 <TxnCursorContext.Consumer>
33 {txnCursor => <Component ref={ref} {...txnCursor} {...props} />}
34 </TxnCursorContext.Consumer>
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