Skip to content

Commit

Permalink
prettier [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
kubk committed Nov 17, 2023
1 parent a593a36 commit 25bd1b5
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/screens/deck-form/deck-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { assert } from "../../lib/typescript/assert.ts";
export const DeckForm = observer(() => {
const deckFormStore = useDeckFormStore();
const screen = screenStore.screen;
assert(screen.type === 'deckForm')
assert(screen.type === "deckForm");

useMount(() => {
deckFormStore.loadForm();
Expand Down
6 changes: 3 additions & 3 deletions src/screens/deck-list/main-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const MainScreen = observer(() => {
color: theme.linkColor,
})}
onClick={() => {
screenStore.go({ type: 'deckForm' });
screenStore.go({ type: "deckForm" });
}}
>
create one
Expand All @@ -88,7 +88,7 @@ export const MainScreen = observer(() => {
<Button
icon={"mdi-plus"}
onClick={() => {
screenStore.go({ type: 'deckForm' });
screenStore.go({ type: "deckForm" });
}}
>
Add deck
Expand Down Expand Up @@ -157,7 +157,7 @@ export const MainScreen = observer(() => {
icon={"mdi-cog"}
disabled={deckListStore.myInfo?.state !== "fulfilled"}
onClick={() => {
screenStore.go({ type: 'userSettings' });
screenStore.go({ type: "userSettings" });
}}
>
Settings
Expand Down
2 changes: 1 addition & 1 deletion src/screens/deck-list/my-deck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const MyDeck = observer((props: Props) => {
<motion.div
whileTap={whileTap}
onClick={() => {
screenStore.go({ type: 'deckMine', deckId: deck.id });
screenStore.go({ type: "deckMine", deckId: deck.id });
}}
className={css({
display: "flex",
Expand Down
2 changes: 1 addition & 1 deletion src/screens/deck-review/deck-finished.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const DeckFinished = observer(() => {
reviewStore.submitFinished();
});
useMainButton("Go back", () => {
screenStore.go({ type: 'main' });
screenStore.go({ type: "main" });
});
useTelegramProgress(() => reviewStore.isReviewSending);

Expand Down
9 changes: 6 additions & 3 deletions src/screens/deck-review/deck-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const DeckPreview = observer(() => {
assert(deck, "Deck should not be empty before preview");

useBackButton(() => {
screenStore.go({ type: 'main' });
screenStore.go({ type: "main" });
});

useMainButton(
Expand Down Expand Up @@ -91,7 +91,10 @@ export const DeckPreview = observer(() => {
noPseudoClasses
outline
onClick={() => {
screenStore.go({ type: 'cardQuickAddForm', cardQuickAddDeckId: deck.id });
screenStore.go({
type: "cardQuickAddForm",
cardQuickAddDeckId: deck.id,
});
}}
>
Add card
Expand All @@ -104,7 +107,7 @@ export const DeckPreview = observer(() => {
noPseudoClasses
outline
onClick={() => {
screenStore.go({ type: 'deckForm', deckFormId: deck.id });
screenStore.go({ type: "deckForm", deckFormId: deck.id });
}}
>
Edit
Expand Down
2 changes: 1 addition & 1 deletion src/store/deck-form-store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ vi.mock("./screen-store", () => {
screen: {
type: "deckForm",
deckFormId: 1,
}
},
},
};
});
Expand Down
6 changes: 3 additions & 3 deletions src/store/deck-form-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class DeckFormStore {
}

const screen = screenStore.screen;
assert(screen.type === 'deckForm')
assert(screen.type === "deckForm");

if (screen.deckFormId) {
const deck = deckListStore.myDecks.find(
Expand Down Expand Up @@ -151,7 +151,7 @@ export class DeckFormStore {
this.isSending = true;

const screen = screenStore.screen;
assert(screen.type === 'deckForm')
assert(screen.type === "deckForm");

return upsertDeckRequest({
id: screen.deckFormId,
Expand All @@ -165,7 +165,7 @@ export class DeckFormStore {
})),
})
.then(() => {
screenStore.go({ type: 'main' });
screenStore.go({ type: "main" });
})
.finally(
action(() => {
Expand Down
8 changes: 4 additions & 4 deletions src/store/deck-list-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class DeckListStore {
assert(deck, "canReview requires a deck to be selected");

return (
deck.cardsToReview.length > 0 || screenStore.screen.type === 'deckPublic'
deck.cardsToReview.length > 0 || screenStore.screen.type === "deckPublic"
);
}

Expand All @@ -103,7 +103,7 @@ export class DeckListStore {
}

assert(deckListStore.selectedDeck, "No selected deck for review");
if (screenStore.screen.type === 'deckPublic') {
if (screenStore.screen.type === "deckPublic") {
deckListStore.addDeckToMine(deckListStore.selectedDeck.id);
}

Expand Down Expand Up @@ -136,7 +136,7 @@ export class DeckListStore {

get selectedDeck(): DeckWithCardsWithReviewType | null {
const screen = screenStore.screen;
assert(screen.type === 'deckPublic' || screen.type === 'deckMine')
assert(screen.type === "deckPublic" || screen.type === "deckMine");
if (!screen.deckId || this.myInfo?.state !== "fulfilled") {
return null;
}
Expand All @@ -149,7 +149,7 @@ export class DeckListStore {
}

const cardsToReview =
screen.type === 'deckPublic'
screen.type === "deckPublic"
? deck.deck_card
: getCardsToReview(deck, this.myInfo.value.cardsToReview);

Expand Down
2 changes: 1 addition & 1 deletion src/store/quick-add-card-form-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class QuickAddCardFormStore {
}

const screen = screenStore.screen;
assert(screen.type === 'cardQuickAddForm')
assert(screen.type === "cardQuickAddForm");

this.isSending = true;

Expand Down
6 changes: 3 additions & 3 deletions src/store/review-store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe("card form store", () => {

it("basic", () => {
const reviewStore = new ReviewStore();
reviewStore.startDeckReview(deckCardsMock, '');
reviewStore.startDeckReview(deckCardsMock, "");
expect(reviewStore.isFinished).toBeFalsy();
expect(reviewStore.cardsToReview).toMatchInlineSnapshot(`
[
Expand Down Expand Up @@ -157,7 +157,7 @@ describe("card form store", () => {

it("current next", () => {
const reviewStore = new ReviewStore();
reviewStore.startDeckReview(deckCardsMock, '');
reviewStore.startDeckReview(deckCardsMock, "");
expect(reviewStore.isFinished).toBeFalsy();

expect(reviewStore.currentCard?.id).toEqual(3);
Expand Down Expand Up @@ -196,7 +196,7 @@ describe("card form store", () => {

it("hit wrong many times", () => {
const reviewStore = new ReviewStore();
reviewStore.startDeckReview(deckCardsMock, '');
reviewStore.startDeckReview(deckCardsMock, "");
expect(reviewStore.isFinished).toBeFalsy();

reviewStore.open();
Expand Down
4 changes: 2 additions & 2 deletions src/store/review-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class ReviewStore {
}

submitUnfinished() {
screenStore.go({ type: 'main' });
screenStore.go({ type: "main" });

if (!this.hasResult) {
return;
Expand All @@ -144,7 +144,7 @@ export class ReviewStore {

async submitFinished() {
if (!this.hasResult) {
screenStore.go({ type: 'main' });
screenStore.go({ type: "main" });
return;
}

Expand Down
5 changes: 1 addition & 4 deletions src/store/screen-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ export class ScreenStore {
}

get isDeckPreviewScreen() {
return (
this.screen.type === "deckPublic" ||
this.screen.type === "deckMine"
);
return this.screen.type === "deckPublic" || this.screen.type === "deckMine";
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const Button = (props: Props) => {
reset.button,
css({
display: "flex",
flexDirection: column ? 'column' : undefined,
flexDirection: column ? "column" : undefined,
width: "100%",
gap: column ? 0 : 8,
justifyContent: "center",
Expand Down
2 changes: 1 addition & 1 deletion src/ui/theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const theme = {
successLight: colord("#2ecb47").alpha(0.4).toHex(),
danger: "#fc2025",
dangerLight: colord("#fc2025").alpha(0.4).toHex(),
dividerColor: '#ccc',
dividerColor: "#ccc",

borderRadius: 12,
};

0 comments on commit 25bd1b5

Please sign in to comment.