Skip to content

Commit 295f7e1

Browse files
committed
ranking form: format files with Prettier
1 parent 02d96b5 commit 295f7e1

File tree

7 files changed

+112
-88
lines changed

7 files changed

+112
-88
lines changed

frontend/src/components/ranking/caregiver-matching-form.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,16 @@ import { Box, Heading, Button, VStack, HStack, Text } from '@chakra-ui/react';
44
import { CustomRadio } from '@/components/CustomRadio';
55
import { COLORS } from '@/constants/form';
66

7-
8-
97
interface CaregiverMatchingFormProps {
108
volunteerType: string;
119
onVolunteerTypeChange: (type: string) => void;
1210
onNext: (type: string) => void;
1311
}
1412

15-
export function CaregiverMatchingForm({
13+
export function CaregiverMatchingForm({
1614
volunteerType,
1715
onVolunteerTypeChange,
18-
onNext
16+
onNext,
1917
}: CaregiverMatchingFormProps) {
2018
return (
2119
<Box>
@@ -70,7 +68,8 @@ export function CaregiverMatchingForm({
7068
fontWeight={600}
7169
mb={8}
7270
>
73-
Note that your volunteer is guaranteed to speak your language and have the same availability.
71+
Note that your volunteer is guaranteed to speak your language and have the same
72+
availability.
7473
</Text>
7574

7675
<VStack gap={5}>
@@ -100,7 +99,7 @@ export function CaregiverMatchingForm({
10099
has a similar diagnosis
101100
</Text>
102101
</CustomRadio>
103-
102+
104103
<CustomRadio
105104
name="volunteerType"
106105
value="caringForLovedOne"

frontend/src/components/ranking/caregiver-qualities-form.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { COLORS } from '@/constants/form';
55

66
const CAREGIVER_QUALITIES = [
77
'the same age as my loved one',
8-
'the same gender identity as my loved one',
8+
'the same gender identity as my loved one',
99
'the same diagnosis as my loved one',
1010
'experience with returning to school or work during/after treatment',
1111
'experience with Relapse',
@@ -20,10 +20,10 @@ interface CaregiverQualitiesFormProps {
2020
onNext: () => void;
2121
}
2222

23-
export function CaregiverQualitiesForm({
24-
selectedQualities,
25-
onQualityToggle,
26-
onNext
23+
export function CaregiverQualitiesForm({
24+
selectedQualities,
25+
onQualityToggle,
26+
onNext,
2727
}: CaregiverQualitiesFormProps) {
2828
return (
2929
<Box>
@@ -78,7 +78,8 @@ export function CaregiverQualitiesForm({
7878
fontWeight={600}
7979
mb={8}
8080
>
81-
Note that your volunteer is guaranteed to speak your language and have the same availability.
81+
Note that your volunteer is guaranteed to speak your language and have the same
82+
availability.
8283
</Text>
8384

8485
<VStack gap={5}>
@@ -142,4 +143,4 @@ export function CaregiverQualitiesForm({
142143
</Box>
143144
</Box>
144145
);
145-
}
146+
}

frontend/src/components/ranking/caregiver-ranking-form.tsx

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ interface CaregiverRankingFormProps {
99
onSubmit: () => void;
1010
}
1111

12-
export function CaregiverRankingForm({
13-
rankedPreferences,
14-
onMoveItem,
15-
onSubmit
12+
export function CaregiverRankingForm({
13+
rankedPreferences,
14+
onMoveItem,
15+
onSubmit,
1616
}: CaregiverRankingFormProps) {
1717
const [draggedIndex, setDraggedIndex] = React.useState<number | null>(null);
1818
const [dropTargetIndex, setDropTargetIndex] = React.useState<number | null>(null);
@@ -23,17 +23,17 @@ export function CaregiverRankingForm({
2323
'the same diagnosis as my loved one',
2424
'experience with Relapse',
2525
'experience with Anxiety / Depression',
26-
'experience with returning to school or work during/after treatment'
26+
'experience with returning to school or work during/after treatment',
2727
];
2828

29-
const phraseToBold = boldPhrases.find(phrase => statement.includes(phrase));
30-
29+
const phraseToBold = boldPhrases.find((phrase) => statement.includes(phrase));
30+
3131
if (!phraseToBold) {
3232
return statement;
3333
}
3434

3535
const parts = statement.split(phraseToBold);
36-
36+
3737
return (
3838
<>
3939
{parts[0]}
@@ -128,7 +128,8 @@ export function CaregiverRankingForm({
128128
fontWeight={600}
129129
mb={8}
130130
>
131-
Note that your volunteer is guaranteed to speak your language and have the same availability.
131+
Note that your volunteer is guaranteed to speak your language and have the same
132+
availability.
132133
</Text>
133134

134135
<VStack gap={5}>
@@ -154,7 +155,7 @@ export function CaregiverRankingForm({
154155
{rankedPreferences.map((statement, index) => {
155156
const isDragging = draggedIndex === index;
156157
const isDropTarget = dropTargetIndex === index;
157-
158+
158159
return (
159160
<HStack
160161
key={`ranking-item-${index}-${statement.slice(0, 20)}`}
@@ -171,12 +172,12 @@ export function CaregiverRankingForm({
171172
>
172173
{index + 1}.
173174
</Text>
174-
175+
175176
<HStack
176177
flex="1"
177178
p={4}
178-
bg={isDragging ? "#e5e7eb" : isDropTarget ? "#dbeafe" : "#f9fafb"}
179-
border={`1px solid ${isDropTarget ? COLORS.teal : "#e5e7eb"}`}
179+
bg={isDragging ? '#e5e7eb' : isDropTarget ? '#dbeafe' : '#f9fafb'}
180+
border={`1px solid ${isDropTarget ? COLORS.teal : '#e5e7eb'}`}
180181
borderRadius="6px"
181182
cursor={isDragging ? 'grabbing' : 'grab'}
182183
gap={3}
@@ -188,13 +189,13 @@ export function CaregiverRankingForm({
188189
onDragLeave={handleDragLeave}
189190
onDrop={(e) => handleDrop(e, index)}
190191
onDragEnd={handleDragEnd}
191-
_hover={{
192+
_hover={{
192193
borderColor: COLORS.teal,
193194
boxShadow: `0 0 0 1px ${COLORS.teal}20`,
194-
bg: isDragging ? "#e5e7eb" : "#f3f4f6"
195+
bg: isDragging ? '#e5e7eb' : '#f3f4f6',
195196
}}
196197
>
197-
<Box
198+
<Box
198199
cursor={isDragging ? 'grabbing' : 'grab'}
199200
p={1}
200201
_hover={{ opacity: 0.7 }}
@@ -238,4 +239,4 @@ export function CaregiverRankingForm({
238239
</Box>
239240
</Box>
240241
);
241-
}
242+
}

frontend/src/components/ranking/caregiver-two-column-qualities-form.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ export function CaregiverTwoColumnQualitiesForm({
9797
fontWeight={600}
9898
mb={8}
9999
>
100-
Note that your volunteer is guaranteed to speak your language and have the same availability.
100+
Note that your volunteer is guaranteed to speak your language and have the same
101+
availability.
101102
</Text>
102103

103104
<VStack gap={5} align="start">
@@ -117,7 +118,8 @@ export function CaregiverTwoColumnQualitiesForm({
117118
fontSize="12px"
118119
mb={4}
119120
>
120-
You can select a maximum of 5 across both categories. Please select at least one quality.
121+
You can select a maximum of 5 across both categories. Please select at least one
122+
quality.
121123
</Text>
122124

123125
<SimpleGrid columns={{ base: 1, md: 2 }} gap={8} w="full">
@@ -203,5 +205,3 @@ export function CaregiverTwoColumnQualitiesForm({
203205
</Box>
204206
);
205207
}
206-
207-

frontend/src/components/ranking/volunteer-matching-form.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Checkbox } from '@/components/ui/checkbox';
44
import { COLORS } from '@/constants/form';
55
const MATCHING_QUALITIES = [
66
'the same age as me',
7-
'the same gender identity as me',
7+
'the same gender identity as me',
88
'the same ethnic or cultural group as me',
99
'the same marital status as me',
1010
'the same parental status as me',
@@ -23,10 +23,10 @@ interface VolunteerMatchingFormProps {
2323
onNext: () => void;
2424
}
2525

26-
export function VolunteerMatchingForm({
27-
selectedQualities,
28-
onQualityToggle,
29-
onNext
26+
export function VolunteerMatchingForm({
27+
selectedQualities,
28+
onQualityToggle,
29+
onNext,
3030
}: VolunteerMatchingFormProps) {
3131
return (
3232
<Box>
@@ -78,7 +78,8 @@ export function VolunteerMatchingForm({
7878
fontWeight={600}
7979
mb={8}
8080
>
81-
Note that your volunteer is guaranteed to speak your language and have the same availability.
81+
Note that your volunteer is guaranteed to speak your language and have the same
82+
availability.
8283
</Text>
8384

8485
<VStack gap={5}>
@@ -142,4 +143,4 @@ export function VolunteerMatchingForm({
142143
</Box>
143144
</Box>
144145
);
145-
}
146+
}

frontend/src/components/ranking/volunteer-ranking-form.tsx

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,16 @@ import { Box, Heading, Button, VStack, HStack, Text } from '@chakra-ui/react';
33
import { DragIcon } from '@/components/ui';
44
import { COLORS } from '@/constants/form';
55

6-
7-
86
interface VolunteerRankingFormProps {
97
rankedPreferences: string[];
108
onMoveItem: (fromIndex: number, toIndex: number) => void;
119
onSubmit: () => void;
1210
}
1311

14-
export function VolunteerRankingForm({
15-
rankedPreferences,
16-
onMoveItem,
17-
onSubmit
12+
export function VolunteerRankingForm({
13+
rankedPreferences,
14+
onMoveItem,
15+
onSubmit,
1816
}: VolunteerRankingFormProps) {
1917
const [draggedIndex, setDraggedIndex] = React.useState<number | null>(null);
2018
const [dropTargetIndex, setDropTargetIndex] = React.useState<number | null>(null);
@@ -25,17 +23,17 @@ export function VolunteerRankingForm({
2523
'the same diagnosis as me',
2624
'the same marital status as me',
2725
'the same ethnic or cultural group as me',
28-
'the same parental status as me'
26+
'the same parental status as me',
2927
];
3028

31-
const phraseToBold = boldPhrases.find(phrase => statement.includes(phrase));
32-
29+
const phraseToBold = boldPhrases.find((phrase) => statement.includes(phrase));
30+
3331
if (!phraseToBold) {
3432
return statement;
3533
}
3634

3735
const parts = statement.split(phraseToBold);
38-
36+
3937
return (
4038
<>
4139
{parts[0]}
@@ -126,7 +124,8 @@ export function VolunteerRankingForm({
126124
fontWeight={600}
127125
mb={8}
128126
>
129-
Note that your volunteer is guaranteed to speak your language and have the same availability.
127+
Note that your volunteer is guaranteed to speak your language and have the same
128+
availability.
130129
</Text>
131130

132131
<VStack gap={5}>
@@ -152,7 +151,7 @@ export function VolunteerRankingForm({
152151
{rankedPreferences.map((statement, index) => {
153152
const isDragging = draggedIndex === index;
154153
const isDropTarget = dropTargetIndex === index;
155-
154+
156155
return (
157156
<HStack
158157
key={`ranking-item-${index}-${statement.slice(0, 20)}`}
@@ -169,12 +168,12 @@ export function VolunteerRankingForm({
169168
>
170169
{index + 1}.
171170
</Text>
172-
171+
173172
<HStack
174173
flex="1"
175174
p={4}
176-
bg={isDragging ? "#e5e7eb" : isDropTarget ? "#dbeafe" : "#f9fafb"}
177-
border={`1px solid ${isDropTarget ? COLORS.teal : "#e5e7eb"}`}
175+
bg={isDragging ? '#e5e7eb' : isDropTarget ? '#dbeafe' : '#f9fafb'}
176+
border={`1px solid ${isDropTarget ? COLORS.teal : '#e5e7eb'}`}
178177
borderRadius="6px"
179178
cursor={isDragging ? 'grabbing' : 'grab'}
180179
gap={3}
@@ -186,13 +185,13 @@ export function VolunteerRankingForm({
186185
onDragLeave={handleDragLeave}
187186
onDrop={(e) => handleDrop(e, index)}
188187
onDragEnd={handleDragEnd}
189-
_hover={{
188+
_hover={{
190189
borderColor: COLORS.teal,
191190
boxShadow: `0 0 0 1px ${COLORS.teal}20`,
192-
bg: isDragging ? "#e5e7eb" : "#f3f4f6"
191+
bg: isDragging ? '#e5e7eb' : '#f3f4f6',
193192
}}
194193
>
195-
<Box
194+
<Box
196195
cursor={isDragging ? 'grabbing' : 'grab'}
197196
p={1}
198197
_hover={{ opacity: 0.7 }}
@@ -236,4 +235,4 @@ export function VolunteerRankingForm({
236235
</Box>
237236
</Box>
238237
);
239-
}
238+
}

0 commit comments

Comments
 (0)