Skip to content

Commit fd35bde

Browse files
committed
finish tidy
1 parent bbdb35f commit fd35bde

File tree

20 files changed

+568
-945
lines changed

20 files changed

+568
-945
lines changed

apps/client/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"react": "^19.2.0",
2828
"react-dom": "^19.2.0",
2929
"react-hook-form": "^7.53.0",
30-
"react-router-dom": "^6.4.1",
3130
"server": "workspace:*",
3231
"tailwind-merge": "^1.6.1",
3332
"tailwindcss": "^3.1.8",

apps/client/src/pages/room/VotingRoomPage/hooks.tsx renamed to apps/client/src/hooks/votingPageHooks.tsx

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** biome-ignore-all lint/complexity/noBannedTypes: Needed to define union types */
12
import { useMutation, useQuery } from "@tanstack/react-query";
23
import { useSubscription } from "@trpc/tanstack-react-query";
34
import { useEffect, useRef, useState } from "react";
@@ -19,12 +20,12 @@ export interface QuestionVotingData {
1920

2021
export type VotingPageState = GetStatesUnion<typeof VotingPageState.enum>;
2122
export const VotingPageState = makeStates("vps", {
22-
loading: state(),
23-
waiting: state(),
24-
ended: state(),
23+
loading: state<{}>(),
24+
waiting: state<{}>(),
25+
ended: state<{}>(),
2526
viewingResults: state<ShowingResultsState>(),
2627
voting: state<QuestionVotingData>(),
27-
kicked: state(),
28+
kicked: state<{}>(),
2829
});
2930

3031
interface LastVote {
@@ -39,15 +40,20 @@ export function useVoterState(props: {
3940
const [lastVote, setLastVote] = useState<LastVote | null>(null);
4041
const voteLock = useRef<Promise<void>>(Promise.resolve());
4142

42-
const castVoteMutation = useMutation(trpc.vote.castVote.mutationOptions())
43+
const castVoteMutation = useMutation(trpc.vote.castVote.mutationOptions());
4344

4445
const runSyncAsync = async (fn: () => Promise<void>) => {
45-
const promise = voteLock.current.catch(() => { }).then(fn);
46+
const promise = voteLock.current.catch(() => {}).then(fn);
4647
voteLock.current = promise;
4748
await promise;
4849
};
4950

50-
const subscription = useSubscription(trpc.vote.listen.subscriptionOptions({ roomId: props.roomId, votingKey: props.votingKey }))
51+
const subscription = useSubscription(
52+
trpc.vote.listen.subscriptionOptions({
53+
roomId: props.roomId,
54+
votingKey: props.votingKey,
55+
}),
56+
);
5157

5258
const { isInitialVoteLoading } = useFetchInitialVote(
5359
props,
@@ -100,10 +106,10 @@ export function useVoterState(props: {
100106

101107
type InitialVoteFetchState = GetStatesUnion<typeof InitialVoteFetchState.enum>;
102108
const InitialVoteFetchState = makeStates("ivfs", {
103-
waitingForVoterState: state(),
104-
ignoring: state(),
109+
waitingForVoterState: state<{}>(),
110+
ignoring: state<{}>(),
105111
fetching: state<{ questionId: string }>(),
106-
fetched: state(),
112+
fetched: state<{}>(),
107113
});
108114

109115
/**
@@ -122,17 +128,22 @@ function useFetchInitialVote(
122128
InitialVoteFetchState.waitingForVoterState({}),
123129
);
124130

125-
const initialVoteQuery = useQuery(trpc.vote.getMyVote.queryOptions({
126-
roomId: props.roomId,
127-
votingKey: props.votingKey,
128-
129-
// If we're not fetching, then the query is disabled anyway and this arg doesnt matter
130-
questionId: InitialVoteFetchState.is.fetching(fetchState)
131-
? fetchState.questionId
132-
: "",
133-
}, {
134-
enabled: InitialVoteFetchState.is.fetching(fetchState),
135-
}))
131+
const initialVoteQuery = useQuery(
132+
trpc.vote.getMyVote.queryOptions(
133+
{
134+
roomId: props.roomId,
135+
votingKey: props.votingKey,
136+
137+
// If we're not fetching, then the query is disabled anyway and this arg doesnt matter
138+
questionId: InitialVoteFetchState.is.fetching(fetchState)
139+
? fetchState.questionId
140+
: "",
141+
},
142+
{
143+
enabled: InitialVoteFetchState.is.fetching(fetchState),
144+
},
145+
),
146+
);
136147

137148
useEffect(() => {
138149
if (

apps/client/src/index.css

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,41 @@ body {
1515
-moz-osx-font-smoothing: grayscale;
1616
-webkit-text-size-adjust: 100%;
1717
}
18+
19+
@keyframes enterAnimation {
20+
0% {
21+
opacity: 0;
22+
transform: translateX(100vw);
23+
}
24+
50% {
25+
opacity: 0;
26+
}
27+
100% {
28+
opacity: 1;
29+
transform: translateX(0);
30+
}
31+
}
32+
33+
@keyframes exitAnimation {
34+
0% {
35+
opacity: 1;
36+
transform: translateX(0);
37+
}
38+
100% {
39+
opacity: 0;
40+
transform: translateX(-100vw);
41+
}
42+
}
43+
44+
.entering {
45+
animation: enterAnimation 0.3s ease-out;
46+
}
47+
48+
.exiting {
49+
opacity: 0;
50+
animation: exitAnimation 0.3s cubic-bezier(0.86, 0.12, 0.91, 0.68);
51+
}
52+
53+
.exited {
54+
opacity: 0;
55+
}

apps/client/src/old_routes/animations.module.css

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

apps/client/src/old_routes/index.tsx

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

apps/client/src/old_routes/routeBuilder.tsx

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

apps/client/src/pages/ShortRedirectPage.tsx

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

0 commit comments

Comments
 (0)