Skip to content

Commit b7a4206

Browse files
committed
Break down App component
- Implement saving changes in the server (in background) - Hide undo and redo if action is not available - Remove unused functions and files - Remove usage of confirm button on delete
1 parent 2c8b124 commit b7a4206

File tree

15 files changed

+473
-702
lines changed

15 files changed

+473
-702
lines changed

src/App/index.tsx

Lines changed: 406 additions & 107 deletions
Large diffs are not rendered by default.

src/contexts/command.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,29 @@ import { type WorkItem } from '#utils/types';
66
export interface CommandContextProps {
77
commands: React.MutableRefObject<Command<WorkItem, string>[]>,
88
zeitgeist: React.MutableRefObject<number>,
9+
setCommands: (value: Command<WorkItem, string>[]) => void,
10+
setZeitgeist: (value: number) => void,
911
watch: (command: Command<WorkItem, string>) => void,
12+
redoable: boolean,
13+
undoable: boolean,
1014
}
1115

1216
const CommandContext = createContext<CommandContextProps>({
1317
commands: { current: [] },
1418
zeitgeist: { current: 0 },
19+
setCommands: () => {
20+
// eslint-disable-next-line no-console
21+
console.warn('CommandContext.setCommands called without initializing provider');
22+
},
23+
setZeitgeist: () => {
24+
// eslint-disable-next-line no-console
25+
console.warn('CommandContext.setZeitgeist called without initializing provider');
26+
},
1527
watch: () => {
1628
// eslint-disable-next-line no-console
1729
console.warn('CommandContext.watch called without initializing provider');
1830
},
31+
undoable: false,
32+
redoable: false,
1933
});
2034
export default CommandContext;

src/hooks/useBackgroundSync.ts

Lines changed: 0 additions & 311 deletions
This file was deleted.

0 commit comments

Comments
 (0)