-
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.
- Loading branch information
Showing
1 changed file
with
40 additions
and
39 deletions.
There are no files selected for viewing
79 changes: 40 additions & 39 deletions
79
frontend/src/Pages/RecruitmentPage/Components/NoPositions/NoPositions.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 |
---|---|---|
@@ -1,56 +1,57 @@ | ||
import { t } from 'i18next'; | ||
import { TextItem } from '~/constants'; | ||
import { useTextItem } from '~/hooks'; | ||
import { KEY } from '~/i18n/constants'; | ||
import { ROUTES } from '~/routes'; | ||
import styles from './NoPositions.module.scss'; | ||
import { OrgNameType, type OrgNameTypeValue } from '~/types'; | ||
import { TextItem } from "~/constants"; | ||
import { useTextItem } from "~/hooks"; | ||
import styles from "./NoPositions.module.scss"; | ||
import { OrgNameType, type OrgNameTypeValue } from "~/types"; | ||
|
||
type NoRecruitmentProps = { | ||
organization?: Exclude<OrgNameTypeValue, typeof OrgNameType.FALLBACK>; | ||
organization?: Exclude<OrgNameTypeValue, typeof OrgNameType.FALLBACK>; | ||
}; | ||
|
||
const SamfNoRecruitmentValuesDict = { | ||
header: TextItem.no_recruitment_samf_header, | ||
about: TextItem.no_recruitment_samf_about, | ||
next: TextItem.no_recruitment_samf_next, | ||
header: TextItem.no_recruitment_samf_header, | ||
about: TextItem.no_recruitment_samf_about, | ||
next: TextItem.no_recruitment_samf_next, | ||
}; | ||
|
||
const UkaNoRecruitmentValuesDict = { | ||
header: TextItem.no_recruitment_uka_header, | ||
about: TextItem.no_recruitment_uka_about, | ||
next: TextItem.no_recruitment_uka_next, | ||
header: TextItem.no_recruitment_uka_header, | ||
about: TextItem.no_recruitment_uka_about, | ||
next: TextItem.no_recruitment_uka_next, | ||
}; | ||
|
||
const IsfitNoRecruitmentValuesDict = { | ||
header: TextItem.no_recruitment_isfit_header, | ||
about: TextItem.no_recruitment_isfit_about, | ||
next: TextItem.no_recruitment_isfit_next, | ||
header: TextItem.no_recruitment_isfit_header, | ||
about: TextItem.no_recruitment_isfit_about, | ||
next: TextItem.no_recruitment_isfit_next, | ||
}; | ||
|
||
const OrganizationToDictionary = { | ||
[OrgNameType.SAMFUNDET_NAME]: SamfNoRecruitmentValuesDict, | ||
[OrgNameType.UKA_NAME]: UkaNoRecruitmentValuesDict, | ||
[OrgNameType.ISFIT_NAME]: IsfitNoRecruitmentValuesDict, | ||
[OrgNameType.SAMFUNDET_NAME]: SamfNoRecruitmentValuesDict, | ||
[OrgNameType.UKA_NAME]: UkaNoRecruitmentValuesDict, | ||
[OrgNameType.ISFIT_NAME]: IsfitNoRecruitmentValuesDict, | ||
}; | ||
|
||
export function NoPositions({ organization = OrgNameType.SAMFUNDET_NAME }: NoRecruitmentProps) { | ||
const thisOrganization = OrganizationToDictionary[organization]; | ||
return ( | ||
<div className={styles.no_recruitment_wrapper}> | ||
<div> | ||
<h1 className={styles.header}>{useTextItem(thisOrganization.header)}</h1> | ||
</div> | ||
<div className={styles.info}> | ||
<p> | ||
<br /> | ||
{useTextItem(thisOrganization.about)} | ||
<br /> | ||
{useTextItem(thisOrganization.next)} | ||
<br /> | ||
<br /> | ||
</p> | ||
</div> | ||
</div> | ||
); | ||
export function NoPositions({ | ||
organization = OrgNameType.SAMFUNDET_NAME, | ||
}: NoRecruitmentProps) { | ||
const thisOrganization = OrganizationToDictionary[organization]; | ||
return ( | ||
<div className={styles.no_recruitment_wrapper}> | ||
<div> | ||
<h1 className={styles.header}> | ||
{useTextItem(thisOrganization.header)} | ||
</h1> | ||
</div> | ||
<div className={styles.info}> | ||
<p> | ||
<br /> | ||
{useTextItem(thisOrganization.about)} | ||
<br /> | ||
{useTextItem(thisOrganization.next)} | ||
<br /> | ||
<br /> | ||
</p> | ||
</div> | ||
</div> | ||
); | ||
} |