Skip to content

Commit 2076549

Browse files
committed
chore: refactor
1 parent c919dcf commit 2076549

File tree

142 files changed

+1478
-1494
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+1478
-1494
lines changed

src/App.module.css

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
.main {
2-
min-height: 0;
3-
height: 100%;
4-
align-items: flex-start;
5-
padding: var(--mantine-spacing-md);
2+
align-items: flex-start;
63
}

src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import LoginUI from "./app/login/LoginUI";
1818
import Header from "./app/shell/Header/Header";
1919
import Sidebar from "./app/shell/Sidebar/Sidebar";
2020
import i18n from "./i18n";
21-
import { useSetting } from "./logic/Settings";
21+
import { useSetting } from "./logic/settings/hooks/useSetting";
2222
import { cssVariablesResolver, presetTheme } from "./style/StyleProvider";
2323

2424
function useRestoreLanguage() {
@@ -77,7 +77,7 @@ export default function App() {
7777

7878
<AppShell.Main>
7979
<Stack>
80-
<Center className={classes.main}>
80+
<Center className={classes.main} p="md" h="100%" mih={0}>
8181
<Outlet />
8282
</Center>
8383
</Stack>

src/app/DebugCardModal/DebugCardModal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import { NoteType } from "@/logic/note/note";
12
import { Modal, Text } from "@mantine/core";
2-
import { Card, NoteType } from "../../logic/card";
3+
import { Card } from "../../logic/card/card";
34
import DebugCardTable from "./DebugCardTable";
45

56
interface DebugCardModalProps {

src/app/DebugCardModal/DebugCardTable.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { NoteType } from "@/logic/note/note";
12
import { Anchor, Space, Stack, Text } from "@mantine/core";
23
import { Rating, State } from "fsrs.js";
34
import { Fragment } from "react";
4-
import { Card, NoteType } from "../../logic/card";
5+
import { Card } from "../../logic/card/card";
56
import classes from "./DebugCard.module.css";
67

78
export default function DebugCardTable({

src/app/NoteManagerView/NoteManagerView.tsx

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

src/app/CardTable/NoteTable.tsx renamed to src/app/NoteTable/NoteTable.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
import { NoteType } from "@/logic/note/note";
2+
import { NoteSortFunction, NoteSorts } from "@/logic/note/sort";
13
import { Table } from "@mantine/core";
24
import { useEventListener } from "@mantine/hooks";
35
import { IconCards } from "@tabler/icons-react";
46
import { t } from "i18next";
57
import { useEffect } from "react";
68
import EmptyNotice from "../../components/EmptyNotice";
7-
import { NoteSortFunction, NoteSorts } from "../../logic/NoteSorting";
8-
import { NoteType } from "../../logic/card";
9-
import { Note } from "../../logic/note";
9+
import { Note } from "../../logic/note/note";
1010
import classes from "./NoteTable.module.css";
1111
import NoteTableHeadItem from "./NoteTableHeadItem";
1212
import { NoteTableItem } from "./NoteTableItem";

src/app/CardTable/NoteTableHeadItem.tsx renamed to src/app/NoteTable/NoteTableHeadItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import { NoteSortFunction } from "@/logic/note/sort";
12
import { Box, Table } from "@mantine/core";
23
import { IconArrowUp } from "@tabler/icons-react";
34
import cx from "clsx";
4-
import { NoteSortFunction } from "../../logic/NoteSorting";
55
import classes from "./NoteTable.module.css";
66

77
interface NoteTableHeadItemProps {

src/app/CardTable/NoteTableItem.tsx renamed to src/app/NoteTable/NoteTableItem.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import { getAdapter } from "@/logic/NoteTypeAdapter";
2+
import { useDeckOf } from "@/logic/deck/hooks/useDeckOf";
3+
import { NoteType } from "@/logic/note/note";
14
import { Table } from "@mantine/core";
25
import cx from "clsx";
36
import { useEffect } from "react";
4-
import { getUtils } from "../../logic/TypeManager";
5-
import { NoteType, NoteTypeLabels } from "../../logic/card";
6-
import { useDeckOf } from "../../logic/deck";
7-
import { Note } from "../../logic/note";
7+
import { NoteTypeLabels } from "../../logic/card/card";
8+
import { Note } from "../../logic/note/note";
89
import classes from "./NoteTable.module.css";
910

1011
export function NoteTableItem({
@@ -48,7 +49,7 @@ export function NoteTableItem({
4849
onClick={() => setSelectedIndex(index)}
4950
>
5051
<Table.Td className={classes.td}>
51-
{getUtils(note).getSortFieldFromNoteContent(note.content)}
52+
{getAdapter(note).getSortFieldFromNoteContent(note.content)}
5253
</Table.Td>
5354
<Table.Td className={classes.td}>
5455
{NoteTypeLabels[note.content.type]}

src/app/deck/DebugDeckModal.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import { useStatesOf } from "@/logic/card/hooks/useStatesOf";
2+
import { NoteType } from "@/logic/note/note";
13
import { Anchor, Modal, Stack, Text } from "@mantine/core";
24
import { State } from "fsrs.js";
3-
import { Card, NoteType, useStatesOf } from "../../logic/card";
4-
import { Deck } from "../../logic/deck";
5+
import { Card } from "../../logic/card/card";
6+
import { Deck } from "../../logic/deck/deck";
57

68
interface DebugDeckModalProps {
79
opened: boolean;

0 commit comments

Comments
 (0)