Skip to content

Commit a2bf30d

Browse files
committed
waitlist added logic
1 parent 490876d commit a2bf30d

2 files changed

Lines changed: 25 additions & 11 deletions

File tree

shared-helpers/src/locales/general.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
"account.application.lottery.rawRankHeader": "Your raw rank",
1818
"account.application.lottery.resultsHeader": "Here are your lottery results",
1919
"account.application.lottery.resultsSubheader": "%{applications} applications were submitted for %{units} unit",
20-
"account.application.lottery.resultsSubheaderWaitlist": "%{applications} applications were submitted",
20+
"account.application.lottery.resultsSubheaderWaitlistLottery": "%{applications} applications were submitted",
2121
"account.application.lottery.resultsSubheaderPlural": "%{applications} applications were submitted for %{units} units",
22-
"account.application.lottery.resultsSubheaderPluralWaitlist": "%{applications} applications were submitted",
22+
"account.application.lottery.resultsSubheaderWaitlistLotteryPlural": "%{applications} applications were submitted",
2323
"account.application.lottery.viewResults": "View lottery results",
2424
"account.application.noAccessError": "You are unauthorized to view this application",
2525
"account.application.noApplicationError": "No application with that ID exists",

sites/public/src/pages/account/application/[id]/lottery-results.tsx

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,18 @@ const LotteryResults = () => {
9696
? `$(t("account.application.lottery.resultsHeader")) for the waitlist`
9797
: t("account.application.lottery.resultsHeader")
9898

99+
const isWaitListLottery = listing.reviewOrderType === ReviewOrderTypeEnum.waitlistLottery
100+
const applications = totals?.find((total) => !total.multiselectQuestionId).total
101+
102+
const resultsSubheaderWaitlist = t(
103+
`account.application.lottery.resultsSubheaderWaitlistLottery${
104+
listing?.unitsAvailable !== 1 ? "Plural" : ""
105+
}`,
106+
{
107+
applications,
108+
}
109+
)
110+
99111
return (
100112
<>
101113
<RequireLogin signInPath="/sign-in" signInMessage={t("t.loginIsRequired")}>
@@ -125,15 +137,17 @@ const LotteryResults = () => {
125137
{lotteryResultText}
126138
</Heading>
127139
<p className="mt-4">
128-
{t(
129-
`account.application.lottery.resultsSubheader${
130-
listing?.unitsAvailable !== 1 ? "Plural" : ""
131-
}`,
132-
{
133-
applications: totals?.find((total) => !total.multiselectQuestionId).total,
134-
units: listing?.unitsAvailable,
135-
}
136-
)}
140+
{isWaitListLottery
141+
? resultsSubheaderWaitlist
142+
: t(
143+
`account.application.lottery.resultsSubheader${
144+
listing?.unitsAvailable !== 1 ? "Plural" : ""
145+
}`,
146+
{
147+
applications,
148+
units: listing?.unitsAvailable,
149+
}
150+
)}
137151
</p>
138152
</Card.Section>
139153
<Card.Section

0 commit comments

Comments
 (0)