Skip to content
This repository was archived by the owner on Mar 11, 2024. It is now read-only.

Commit 439d02c

Browse files
committed
refactor(client): More fixes
1 parent 9b244f5 commit 439d02c

File tree

15 files changed

+60
-67
lines changed

15 files changed

+60
-67
lines changed

src/components/arrows.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { animated } from "react-spring"
1+
import { SpringValue, animated } from "react-spring"
22

33
type Props = {
44
className: string
55
style: {
6-
transform: string
6+
transform: SpringValue<string> | string
77
}
88
}
99

src/components/inscribete/SpecialVoters/SpecialVoterCards.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const SpecialVoterMachine = createMachine<
6969

7070
export default function SpecialVoterCards() {
7171
const { t } = useTranslation()
72-
const ref = useRef<HTMLDivElement>()
72+
const ref = useRef<HTMLDivElement>(null!)
7373
const [state, send] = useMachine(SpecialVoterMachine)
7474

7575
useEffect(() => {

src/components/inscribete/SpecialVoters/SpecialVoterReasons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function Reason({ summary, details }: ReasonProps) {
2323
const [ref, bounds] = useMeasure({ polyfill: ResizeObserver })
2424
const props = useSpring({
2525
height: isOpen ? bounds.height || "auto" : 0,
26-
visibility: isOpen ? "visible" : "hidden",
26+
visibility: isOpen ? ("visible" as const) : ("hidden" as const),
2727
opacity: isOpen ? 1 : 0,
2828
transform: isOpen ? "rotate(180deg)" : "rotate(0deg)",
2929
})

src/components/inscribete/SpecialVoters/TabContent.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@ export default function TabContent(voter: Props) {
4444
/>
4545
))}
4646
</ul>
47-
<Typography tag="p" variant="p" className="mt-4">
48-
{t(voter.exceptions)}
49-
</Typography>
47+
{voter.exceptions && (
48+
<Typography tag="p" variant="p" className="mt-4">
49+
{t(voter.exceptions)}
50+
</Typography>
51+
)}
5052
{voter.documents.length > 1 ? (
5153
<Dropdown
5254
selectedOption={voter.title}

src/components/inscribete/SpecialVoters/Tabs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export default function Tabs() {
7373
deadline={t(voter.deadline)}
7474
documents={voter.documents}
7575
reasons={voter.reasons}
76-
exceptions={t(voter.exceptions)}
76+
exceptions={t(voter.exceptions ?? "")}
7777
/>
7878
</Card>
7979
)

src/components/inscribete/VoterCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function VoterCard(voter: Voter) {
1919
const [ref, bounds] = useMeasure({ polyfill: ResizeObserver })
2020
const props = useSpring({
2121
height: isOpen ? bounds.height || "auto" : 0,
22-
visibility: isOpen ? "visible" : "hidden",
22+
visibility: isOpen ? ("visible" as const) : ("hidden" as const),
2323
opacity: isOpen ? 1 : 0,
2424
transform: isOpen ? "rotate(180deg)" : "rotate(0deg)",
2525
})

src/components/inscribete/VoterCenters/CenterInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const TownInfo = ({ town }: CenterInfoProps) => {
6060
<div className="mt-8">
6161
<Link
6262
className="w-full text-center"
63-
to={town.googleMapsLink}
63+
to={town.googleMapsLink ?? ""}
6464
target="_blank"
6565
variant="primary"
6666
>

src/components/section.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function Section(props: SectionProps) {
2121
const [ref, bounds] = useMeasure({ polyfill: ResizeObserver })
2222
const springProps = useSpring({
2323
height: isOpen ? bounds.height || "auto" : 0,
24-
visibility: isOpen ? "visible" : "hidden",
24+
visibility: isOpen ? ("visible" as const) : ("hidden" as const),
2525
opacity: isOpen ? 1 : 0,
2626
transform: isOpen ? "rotate(180deg)" : "rotate(0deg)",
2727
})

src/packages/practica/machines/practice.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@ import { createMachine, assign } from "xstate"
33
import { BallotService } from "../services/ballot-service"
44

55
import { MAX_PRECINT_LENGTH } from "../services/constants"
6-
import {
7-
BallotConfigs,
8-
BallotsResponse,
9-
PracticeContext,
10-
} from "../services/types"
6+
import { BallotsResponse, PracticeContext } from "../services/types"
117
import { BallotType } from "../../../ballot-validator/types"
8+
import { BallotConfigs } from "../services/ballot-configs"
129

1310
type ControlEvent =
1411
| { type: "start"; userInput: string }

src/packages/practica/resource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const BallotResource = {
2626
ballotPath: string
2727
votes: string
2828
}) {
29-
return api.post("/createBallotTask", ballot)
29+
return api.post<{ uuid: string }>("/createBallotTask", ballot)
3030
},
3131

3232
getBallotPdf(params: string) {

0 commit comments

Comments
 (0)