Skip to content

Commit

Permalink
Prettified Code!
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavriil-Tzortzakis authored and actions-user committed Nov 2, 2024
1 parent c6ea5d5 commit b67560b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
3 changes: 0 additions & 3 deletions shared/locales/en/website-responses.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,4 @@
"title": "Follow-up Survey",
"description": "Filled out every 6 months after recipient left the program"
}



}
1 change: 0 additions & 1 deletion shared/src/utils/stats/SurveyStatsCalculator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import _ from 'lodash';
import { FirestoreAdmin } from '../../firebase/admin/FirestoreAdmin';
import { Recipient, RECIPIENT_FIRESTORE_PATH } from '../../types/recipient';
import { Survey, SURVEY_FIRETORE_PATH, SurveyQuestionnaire, SurveyStatus } from '../../types/survey';
Expand Down
28 changes: 14 additions & 14 deletions website/src/app/[lang]/[region]/(website)/survey/responses/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { DefaultPageProps } from '@/app/[lang]/[region]';
import { firestoreAdmin } from '@/firebase-admin';
import { SurveyQuestionnaire } from '@socialincome/shared/src/types/survey';
import { Translator } from '@socialincome/shared/src/utils/i18n';
import { SurveyStatsCalculator } from '@socialincome/shared/src/utils/stats/SurveyStatsCalculator';
import { Badge, BaseContainer, Card, CardTitle, Typography } from '@socialincome/ui';
import { Translator } from '@socialincome/shared/src/utils/i18n';
import { DefaultPageProps } from '@/app/[lang]/[region]';
import { SurveyQuestionnaire } from '@socialincome/shared/src/types/survey';

export const revalidate = 3600; // update once an hour
export default async function Page({ params: { lang } }: DefaultPageProps) {
Expand All @@ -13,7 +13,7 @@ export default async function Page({ params: { lang } }: DefaultPageProps) {
const data = surveyStatsCalculator.aggregatedData;
const translator = await Translator.getInstance({
language: lang,
namespaces: ['website-responses','website-survey'],
namespaces: ['website-responses', 'website-survey'],
});
let selectedSurvey = SurveyQuestionnaire.Onboarding;

Expand All @@ -27,7 +27,7 @@ export default async function Page({ params: { lang } }: DefaultPageProps) {
{allSurveyData.map(
(surveyData) =>
surveyData && (
<Card key={surveyData.type} className="p-2 bg-neutral-50">
<Card key={surveyData.type} className="bg-neutral-50 p-2">
<CardTitle className="text py-2">{translator.t(surveyData.type + '.title')}</CardTitle>

<Typography className="mt-2">{translator.t(surveyData.type + '.description')}</Typography>
Expand All @@ -40,21 +40,21 @@ export default async function Page({ params: { lang } }: DefaultPageProps) {
<div className="flex flex-col">
<div className="mt-2 grid grid-cols-1 gap-2">
{Object.keys(data[selectedSurvey]).map((key) => (
<Card key={key} className="p-2 bg-transparent">
<Card key={key} className="bg-transparent p-2">
<CardTitle>
<div>
<Typography className="text py-2">{translator.t('survey.questions.'+key.replace("V1","TitleV1"))}</Typography>
<Badge className="bg-amber-400">
<Typography className="mt-1 ">{data[selectedSurvey][key].answers.length} answers</Typography>
</Badge>
</div>
<div>
<Typography className="text py-2">
{translator.t('survey.questions.' + key.replace('V1', 'TitleV1'))}
</Typography>
<Badge className="bg-amber-400">
<Typography className="mt-1">{data[selectedSurvey][key].answers.length} answers</Typography>
</Badge>
</div>
</CardTitle>
<div>
<Typography className="mt-2">{JSON.stringify(data[selectedSurvey][key].answers)}</Typography>
</div>
</Card>


))}
</div>
</div>
Expand Down

0 comments on commit b67560b

Please sign in to comment.