Skip to content

Commit b2a5834

Browse files
committed
fixed format
1 parent e16bb71 commit b2a5834

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

frontend/src/components/Forms/TeamEventCreditsForm/TeamEventCreditsForm.tsx

+20-13
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ const TeamEventCreditForm: React.FC = () => {
3636
const matchingEvent = teamEventInfoList.find((event) => event.uuid === attendance.eventUuid);
3737
return matchingEvent
3838
? {
39-
date: new Date(matchingEvent.date),
40-
credits: parseFloat(matchingEvent.numCredits)
41-
} : null;
39+
date: new Date(matchingEvent.date),
40+
credits: parseFloat(matchingEvent.numCredits)
41+
}
42+
: null;
4243
})
4344
.filter((entry): entry is { date: Date; credits: number } => entry !== null);
4445

@@ -67,7 +68,9 @@ const TeamEventCreditForm: React.FC = () => {
6768
return periodCredits < 1 ? 1 - periodCredits : 0;
6869
}
6970
if (previousPeriodCredits < 1) {
70-
return periodCredits + previousPeriodCredits < 2 ? 2 - previousPeriodCredits - periodCredits : 0;
71+
return periodCredits + previousPeriodCredits < 2
72+
? 2 - previousPeriodCredits - periodCredits
73+
: 0;
7174
}
7275

7376
return periodCredits < 1 ? 1 - periodCredits : 0;
@@ -144,8 +147,9 @@ const TeamEventCreditForm: React.FC = () => {
144147
} else if (submittedCredits + creditsToSubmit > Number(teamEvent.maxCredits)) {
145148
Emitters.generalError.emit({
146149
headerMsg: 'Maximum Credits Violated',
147-
contentMsg: `You have ${submittedCredits} pending or approved credit(s) for the event! Submitting a total of ${submittedCredits + creditsToSubmit
148-
} credit(s) exceeds the event credit limit of ${teamEvent.maxCredits} credit(s).`
150+
contentMsg: `You have ${submittedCredits} pending or approved credit(s) for the event! Submitting a total of ${
151+
submittedCredits + creditsToSubmit
152+
} credit(s) exceeds the event credit limit of ${teamEvent.maxCredits} credit(s).`
149153
});
150154
} else {
151155
await Promise.all(
@@ -199,8 +203,8 @@ const TeamEventCreditForm: React.FC = () => {
199203
<div className={styles.bold}>
200204
{requiredCredits > 1 && (
201205
<span className={styles.red_color}>
202-
You submitted {2 - requiredCredits} TEC last period so you must submit at least {requiredCredits} TEC for this 5-week
203-
period.
206+
You submitted {2 - requiredCredits} TEC last period so you must submit at least{' '}
207+
{requiredCredits} TEC for this 5-week period.
204208
</span>
205209
)}
206210
</div>
@@ -223,8 +227,9 @@ const TeamEventCreditForm: React.FC = () => {
223227
value={teamEvent?.uuid ?? ''}
224228
text={
225229
teamEvent
226-
? `${teamEvent.name} - ${teamEvent.numCredits} credit(s) ${teamEvent.hasHours ? 'per hour' : ''
227-
}`
230+
? `${teamEvent.name} - ${teamEvent.numCredits} credit(s) ${
231+
teamEvent.hasHours ? 'per hour' : ''
232+
}`
228233
: ''
229234
}
230235
options={teamEventInfoList
@@ -246,9 +251,11 @@ const TeamEventCreditForm: React.FC = () => {
246251
></Label>
247252

248253
<Label
249-
content={`${event.numCredits} ${Number(event.numCredits) === 1 ? 'credit' : 'credits'
250-
} ${event.maxCredits > event.numCredits ? `(${event.maxCredits} max)` : ''
251-
} ${event.hasHours ? 'per hour' : ''}`}
254+
content={`${event.numCredits} ${
255+
Number(event.numCredits) === 1 ? 'credit' : 'credits'
256+
} ${
257+
event.maxCredits > event.numCredits ? `(${event.maxCredits} max)` : ''
258+
} ${event.hasHours ? 'per hour' : ''}`}
252259
></Label>
253260
</div>
254261
</div>

0 commit comments

Comments
 (0)