-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VKT(Frontend): Foundations for PublicExaminerListing
- Loading branch information
Showing
5 changed files
with
103 additions
and
1 deletion.
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
frontend/packages/vkt/src/components/publicExaminerListing/PublicExaminerListing.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import { Paper, TableCell, TableHead, TableRow } from '@mui/material'; | ||
import { useState } from 'react'; | ||
import { CustomTable, H2, Text } from 'shared/components'; | ||
import { useWindowProperties } from 'shared/hooks'; | ||
|
||
import { LanguageFilter } from 'components/common/LanguageFilter'; | ||
import { ExamLanguage } from 'enums/app'; | ||
import { PublicExaminer } from 'interfaces/publicExaminer'; | ||
|
||
const PublicExaminerListingHeader = () => { | ||
const { isPhone } = useWindowProperties(); | ||
|
||
return ( | ||
<TableHead className="heading-text"> | ||
{!isPhone && ( | ||
<TableRow> | ||
<TableCell>Tutkinnon vastaanottaja</TableCell> | ||
<TableCell>Kieli</TableCell> | ||
<TableCell>Paikkakunta</TableCell> | ||
<TableCell>Tutkintopäivät</TableCell> | ||
<TableCell>Toiminnot</TableCell> | ||
</TableRow> | ||
)} | ||
</TableHead> | ||
); | ||
}; | ||
|
||
const mockExaminerData: Array<PublicExaminer> = []; | ||
|
||
const getRowDetails = ({ | ||
name, | ||
language, | ||
municipality, | ||
examDates, | ||
}: PublicExaminer) => { | ||
// TODO Rendering for mobile users | ||
return ( | ||
<TableRow> | ||
<TableCell> | ||
<Text>{name}</Text> | ||
</TableCell> | ||
<TableCell> | ||
<Text>{language}</Text> | ||
</TableCell> | ||
<TableCell> | ||
<Text>{municipality}</Text> | ||
</TableCell> | ||
<TableCell> | ||
<Text>{examDates.length > 0 ? 'dipdap' : 'Ei määritelty'}</Text> | ||
</TableCell> | ||
<TableCell>dsadad</TableCell> | ||
</TableRow> | ||
); | ||
}; | ||
|
||
export const PublicExaminerListing = () => { | ||
const [languageFilter, setLanguageFilter] = useState(ExamLanguage.ALL); | ||
|
||
return ( | ||
<Paper elevation={3} className="public-examiner-listing"> | ||
<div className="columns"> | ||
<div className="grow"> | ||
<H2>Ota yhteyttä tutkinnon vastaanottajiin</H2> | ||
</div> | ||
</div> | ||
<LanguageFilter | ||
value={languageFilter} | ||
onChange={(e) => setLanguageFilter(e.target.value as ExamLanguage)} | ||
/> | ||
<CustomTable | ||
className="table-layout-auto" | ||
data={mockExaminerData} | ||
getRowDetails={getRowDetails} | ||
header={<PublicExaminerListingHeader />} | ||
/> | ||
</Paper> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Dayjs } from "dayjs"; | ||
import { WithId } from "shared/interfaces"; | ||
|
||
import { ExamLanguage } from "enums/app"; | ||
|
||
export interface PublicExaminer extends WithId { | ||
name: string; | ||
language: ExamLanguage; | ||
municipality: Array<string>; | ||
examDates: Array<Dayjs>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...nd/packages/vkt/src/styles/components/publicExaminerListing/_public-examiner-listing.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.public-examiner-listing { | ||
padding: 3rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters