Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(financial-aid): Dynamic logo, move assets, refactor relationship screen #17494

Merged
merged 7 commits into from
Jan 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Application } from '@island.is/application/types'
import {
Municipality,
logoKeyFromMunicipalityCode,
} from '@island.is/financial-aid/shared/lib'
import React, { useEffect, useState } from 'react'
type Props = {
application: Application
}
export const Logo = ({ application }: Props) => {
const [logo, setLogo] = useState<string>()
const municipality = application.externalData.municipality
?.data as Municipality

jonnigs marked this conversation as resolved.
Show resolved Hide resolved
useEffect(() => {
const getLogo = async () => {
const municipalityId =
municipality && municipality?.municipalityId
? municipality.municipalityId
: ''
const svgLogo = await import(
`../../assets/svg/${logoKeyFromMunicipalityCode[municipalityId]}`
)
setLogo(svgLogo.default)
}
getLogo()
}, [municipality])
jonnigs marked this conversation as resolved.
Show resolved Hide resolved
return <img src={logo} alt="Municipality logo" />
}
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ import { currentMonth } from '@island.is/financial-aid/shared/lib'

import { DescriptionText, PrivacyPolicyAccordion } from '..'
import { FAFieldBaseProps } from '../../lib/types'
import withLogo from '../Logo/Logo'
import { aboutForm } from '../../lib/messages'

const AboutForm = ({ application }: FAFieldBaseProps) => {
@@ -34,4 +33,4 @@ const AboutForm = ({ application }: FAFieldBaseProps) => {
)
}

export default withLogo(AboutForm)
export default AboutForm
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ import { useLocale } from '@island.is/localization'
import { aboutSpouseForm } from '../../lib/messages'
import { DescriptionText, PrivacyPolicyAccordion } from '..'
import { FAFieldBaseProps } from '../../lib/types'
import withLogo from '../Logo/Logo'

const AboutSpouseForm = ({ application }: FAFieldBaseProps) => {
const { lang } = useLocale()
@@ -35,4 +34,4 @@ const AboutSpouseForm = ({ application }: FAFieldBaseProps) => {
)
}

export default withLogo(AboutSpouseForm)
export default AboutSpouseForm
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ import { FAFieldBaseProps } from '../../lib/types'
import { useIntl } from 'react-intl'
import { bankInfoForm } from '../../lib/messages'
import { InputController } from '@island.is/shared/form-fields'
import withLogo from '../Logo/Logo'

const BankInfoForm = ({ field, application }: FAFieldBaseProps) => {
const { id } = field
@@ -79,4 +78,4 @@ const BankInfoForm = ({ field, application }: FAFieldBaseProps) => {
)
}

export default withLogo(BankInfoForm)
export default BankInfoForm
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ import { Text, UploadFile } from '@island.is/island-ui/core'
import { childrenFilesForm } from '../../lib/messages'
import { FAFieldBaseProps, OverrideAnswerSchema, UploadFileType } from '../..'
import { Files } from '..'
import withLogo from '../Logo/Logo'

const ChildrenFilesForm = ({ field, application }: FAFieldBaseProps) => {
const { formatMessage } = useIntl()
@@ -26,4 +25,4 @@ const ChildrenFilesForm = ({ field, application }: FAFieldBaseProps) => {
)
}

export default withLogo(ChildrenFilesForm)
export default ChildrenFilesForm
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ import {
FAFieldBaseProps,
SummaryComment as SummaryCommentType,
} from '../../lib/types'
import withLogo from '../Logo/Logo'
import { childrenForm } from '../../lib/messages'

import { ChildInput } from './ChildInput'
@@ -94,4 +93,4 @@ const ChildrenForm = ({ application, field, errors }: FAFieldBaseProps) => {
)
}

export default withLogo(ChildrenForm)
export default ChildrenForm
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ import { useFormContext } from 'react-hook-form'
import { getValueViaPath } from '@island.is/application/core'
import { answersSchema } from '../../lib/dataSchema'
import { Routes } from '../../lib/constants'
import withLogo from '../Logo/Logo'

const ContactInfo = ({ field, errors, application }: FAFieldBaseProps) => {
const { formatMessage } = useIntl()
@@ -65,4 +64,4 @@ const ContactInfo = ({ field, errors, application }: FAFieldBaseProps) => {
)
}

export default withLogo(ContactInfo)
export default ContactInfo
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ import { Employment } from '@island.is/financial-aid/shared/lib'
import * as styles from '../Shared.css'
import cn from 'classnames'
import { FAFieldBaseProps, InputTypes } from '../../lib/types'
import withLogo from '../Logo/Logo'

const EmploymentForm = ({ application, errors }: FAFieldBaseProps) => {
const typeInput = {
@@ -94,4 +93,4 @@ const EmploymentForm = ({ application, errors }: FAFieldBaseProps) => {
)
}

export default withLogo(EmploymentForm)
export default EmploymentForm
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ import { HomeCircumstances } from '@island.is/financial-aid/shared/lib'
import * as styles from '../Shared.css'
import cn from 'classnames'
import { FAFieldBaseProps, InputTypes } from '../../lib/types'
import withLogo from '../Logo/Logo'

const HomeCircumstancesForm = ({ application, errors }: FAFieldBaseProps) => {
const typeInput = {
@@ -113,4 +112,4 @@ const HomeCircumstancesForm = ({ application, errors }: FAFieldBaseProps) => {
)
}

export default withLogo(HomeCircumstancesForm)
export default HomeCircumstancesForm

This file was deleted.

Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ import { Text, UploadFile } from '@island.is/island-ui/core'
import { incomeFilesForm } from '../../lib/messages'
import { FAFieldBaseProps, OverrideAnswerSchema, UploadFileType } from '../..'
import { Files } from '..'
import withLogo from '../Logo/Logo'

const IncomeFilesForm = ({ field, application }: FAFieldBaseProps) => {
const { formatMessage } = useIntl()
@@ -30,4 +29,4 @@ const IncomeFilesForm = ({ field, application }: FAFieldBaseProps) => {
)
}

export default withLogo(IncomeFilesForm)
export default IncomeFilesForm
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ import { useIntl } from 'react-intl'
import { incomeForm } from '../../lib/messages'
import { RadioController } from '@island.is/shared/form-fields'
import DescriptionText from '../DescriptionText/DescriptionText'
import withLogo from '../Logo/Logo'

const IncomeForm = ({ field, errors, application }: FAFieldBaseProps) => {
const { formatMessage } = useIntl()
@@ -58,4 +57,4 @@ const IncomeForm = ({ field, errors, application }: FAFieldBaseProps) => {
)
}

export default withLogo(IncomeForm)
export default IncomeForm

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ import { FAFieldBaseProps, ApproveOptions } from '../../lib/types'
import { useIntl } from 'react-intl'
import { personalTaxCreditForm } from '../../lib/messages'
import { RadioController } from '@island.is/shared/form-fields'
import withLogo from '../Logo/Logo'

const PersonalTaxCreditForm = ({
field,
@@ -53,4 +52,4 @@ const PersonalTaxCreditForm = ({
)
}

export default withLogo(PersonalTaxCreditForm)
export default PersonalTaxCreditForm
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@ import { serviceCenters } from '@island.is/financial-aid/shared/data'
import { FAFieldBaseProps } from '../../lib/types'
import { serviceCenter } from '../../lib/messages'
import { DescriptionText } from '..'
import withLogo from '../Logo/Logo'

const ServiceCenter = ({ application }: FAFieldBaseProps) => {
const { formatMessage } = useIntl()
@@ -52,4 +51,4 @@ const ServiceCenter = ({ application }: FAFieldBaseProps) => {
)
}

export default withLogo(ServiceCenter)
export default ServiceCenter
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ import * as styles from '../Shared.css'
import cn from 'classnames'
import { InputController, RadioController } from '@island.is/shared/form-fields'
import { useFormContext } from 'react-hook-form'
import withLogo from '../Logo/Logo'

const StudentForm = ({ errors, application }: FAFieldBaseProps) => {
const { formatMessage } = useIntl()
@@ -70,4 +69,4 @@ const StudentForm = ({ errors, application }: FAFieldBaseProps) => {
)
}

export default withLogo(StudentForm)
export default StudentForm
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@ import {
Files,
DirectTaxPaymentCell,
} from './index'
import withLogo from '../Logo/Logo'
import { useFormContext } from 'react-hook-form'
import { useUserInfo } from '@island.is/react-spa/bff'

@@ -112,4 +111,4 @@ const SpouseSummaryForm = ({ application, goToScreen }: FAFieldBaseProps) => {
)
}

export default withLogo(SpouseSummaryForm)
export default SpouseSummaryForm
Original file line number Diff line number Diff line change
@@ -31,7 +31,6 @@ import {

import { DirectTaxPaymentsModal } from '..'
import { findFamilyStatus } from '../../lib/utils'
import withLogo from '../Logo/Logo'
import ChildrenInfo from './ChildrenInfo'

const SummaryForm = ({ application, goToScreen }: FAFieldBaseProps) => {
@@ -204,4 +203,4 @@ const SummaryForm = ({ application, goToScreen }: FAFieldBaseProps) => {
)
}

export default withLogo(SummaryForm)
export default SummaryForm
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ import { FAFieldBaseProps, OverrideAnswerSchema, UploadFileType } from '../..'

import { Files } from '..'
import { getTaxFormContent } from './taxFormContent'
import withLogo from '../Logo/Logo'

const TaxReturnFilesForm = ({ field, application }: FAFieldBaseProps) => {
const { formatMessage } = useIntl()
@@ -59,4 +58,4 @@ const TaxReturnFilesForm = ({ field, application }: FAFieldBaseProps) => {
)
}

export default withLogo(TaxReturnFilesForm)
export default TaxReturnFilesForm
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@ import {
import * as styles from '../Shared.css'
import cn from 'classnames'
import { isValidEmail, isValidNationalId } from '../../lib/utils'
import withLogo from '../Logo/Logo'

type validationType = 'email' | 'nationalId' | 'approveItems'
const errorIdForSpouse = 'relationshipStatus'
@@ -155,4 +154,4 @@ const UnknownRelationshipForm = ({ errors, application }: FAFieldBaseProps) => {
)
}

export default withLogo(UnknownRelationshipForm)
export default UnknownRelationshipForm
Loading