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: Dynamic logo, move assets, refactor relationship screen #17494

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jonnigs
Copy link
Member

@jonnigs jonnigs commented Jan 14, 2025

What

Refactor first screen in the Financial aid application so it uses the application system shared components
Move municipality logos to an assets folder
Make the main form use a dynamic logo

Why

Minimize the use of custom components in the application system, making applications more uniform, predictable and maintainable.

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

  • New Features

    • Introduced a new Logo component for dynamic logo rendering based on municipality.
    • Added logo functionality to multiple forms in the financial aid application.
  • Component Changes

    • Removed withLogo higher-order component from multiple form components.
    • Simplified component exports by removing logo wrapping.
    • Removed InRelationshipForm component.
  • Form Enhancements

    • Updated form configurations to include logo rendering.
    • Improved form section logic with more dynamic subsection rendering.
  • Code Structure

    • Updated import paths and module references.
    • Renamed Application to ApplicationForm in some modules.

@jonnigs jonnigs requested a review from a team as a code owner January 14, 2025 15:41
Copy link
Contributor

coderabbitai bot commented Jan 14, 2025

Walkthrough

This pull request introduces a comprehensive refactoring of logo handling in the financial aid application template. The changes include creating a new Logo component, removing the withLogo higher-order component, and updating multiple form files to integrate the new logo functionality. The modifications simplify the logo rendering process by introducing a centralized Logo component that dynamically loads municipality-specific logos based on the application context.

Changes

File Path Change Summary
libs/application/templates/financial-aid/src/components/Logo/Logo.tsx New React component for dynamic logo rendering
libs/application/templates/financial-aid/src/fields/*/ Removed withLogo HOC from multiple form component exports
libs/application/templates/financial-aid/src/forms/ Added logo property to various form definitions using new Logo component
libs/application/templates/financial-aid/src/fields/Logo/ Removed Logo.tsx and Logo.css.ts files

Sequence Diagram

sequenceDiagram
    participant App as Application
    participant LogoComp as Logo Component
    participant MunicipalityData as Municipality Data
    
    App->>LogoComp: Pass application object
    LogoComp->>MunicipalityData: Extract municipality ID
    MunicipalityData-->>LogoComp: Return municipality details
    LogoComp->>LogoComp: Dynamically import logo SVG
    LogoComp->>App: Render municipality logo
Loading

Possibly related PRs

Suggested labels

automerge, deploy-feature

Suggested reviewers

  • HjorturJ

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2030318 and 6ca1022.

📒 Files selected for processing (1)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/inARelationshipSubsection.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/inARelationshipSubsection.ts

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Jan 14, 2025

Codecov Report

Attention: Patch coverage is 0% with 48 lines in your changes missing coverage. Please review.

Project coverage is 35.61%. Comparing base (ea3c92b) to head (6ca1022).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
...mplates/financial-aid/src/components/Logo/Logo.tsx 0.00% 12 Missing ⚠️
...s/ApplicationForm/personalInterestSection/index.ts 0.00% 8 Missing ⚠️
...s/financial-aid/src/forms/ApplicationForm/index.ts 0.00% 4 Missing ⚠️
...rsonalInterestSection/inARelationshipSubsection.ts 0.00% 4 Missing ⚠️
...ates/financial-aid/src/forms/ApplicantSubmitted.ts 0.00% 3 Missing ⚠️
...inancial-aid/src/forms/MuncipalityNotRegistered.ts 0.00% 3 Missing ⚠️
...templates/financial-aid/src/forms/Prerequisites.ts 0.00% 3 Missing ⚠️
...tes/financial-aid/src/forms/PrerequisitesSpouse.ts 0.00% 3 Missing ⚠️
...cation/templates/financial-aid/src/forms/Spouse.ts 0.00% 3 Missing ⚠️
...mplates/financial-aid/src/forms/SpouseSubmitted.ts 0.00% 3 Missing ⚠️
... and 1 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #17494      +/-   ##
==========================================
- Coverage   35.61%   35.61%   -0.01%     
==========================================
  Files        7015     7016       +1     
  Lines      150309   150346      +37     
  Branches    42974    42979       +5     
==========================================
+ Hits        53535    53541       +6     
- Misses      96774    96805      +31     
Flag Coverage Δ
api 3.33% <ø> (ø)
application-system-api 38.72% <0.00%> (+0.02%) ⬆️
application-template-api-modules 27.57% <ø> (+0.01%) ⬆️
application-templates-financial-aid 14.37% <0.00%> (-0.10%) ⬇️
application-ui-shell 22.19% <ø> (ø)
judicial-system-backend 55.81% <ø> (-0.07%) ⬇️
judicial-system-scheduler 71.36% <ø> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...s/financial-aid/src/fields/AboutForm/AboutForm.tsx 0.00% <ø> (ø)
...aid/src/fields/AboutSpouseForm/AboutSpouseForm.tsx 0.00% <ø> (ø)
...ncial-aid/src/fields/BankInfoForm/BankInfoForm.tsx 0.00% <ø> (ø)
...src/fields/ChildrenFilesForm/ChildrenFilesForm.tsx 0.00% <ø> (ø)
...ncial-aid/src/fields/ChildrenForm/ChildrenForm.tsx 0.00% <ø> (ø)
...nancial-aid/src/fields/ContactInfo/ContactInfo.tsx 0.00% <ø> (ø)
...l-aid/src/fields/EmploymentForm/EmploymentForm.tsx 0.00% <ø> (ø)
...ds/HomeCircumstancesForm/HomeCircumstancesForm.tsx 0.00% <ø> (ø)
...aid/src/fields/IncomeFilesForm/IncomeFilesForm.tsx 0.00% <ø> (ø)
...financial-aid/src/fields/IncomeForm/IncomeForm.tsx 0.00% <ø> (ø)
... and 18 more

... and 14 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 10bf465...6ca1022. Read the comment docs.

@datadog-island-is
Copy link

datadog-island-is bot commented Jan 14, 2025

Datadog Report

All test runs de3ffda 🔗

7 Total Test Services: 0 Failed, 7 Passed
🔻 Test Sessions change in coverage: 1 decreased (-0.08%), 9 no change

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
api 0 0 0 4 0 2.79s 1 no change Link
application-system-api 0 0 0 46 0 2m 13.11s 1 no change Link
application-template-api-modules 0 0 0 118 0 2m 7.48s 1 no change Link
application-templates-financial-aid 0 0 0 11 0 12.71s 1 decreased (-0.08%) Link
application-ui-shell 0 0 0 74 0 31.88s 1 no change Link
judicial-system-backend 0 0 0 21308 0 18m 46.15s 1 no change Link
judicial-system-scheduler 0 0 0 4 0 3.78s 1 no change Link

🔻 Code Coverage Decreases vs Default Branch (1)

  • application-templates-financial-aid - jest 18.62% (-0.08%) - Details

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (17)
libs/application/templates/financial-aid/src/forms/ApplicationForm/index.ts (2)

20-21: Consider using JSX syntax for creating elements.

Instead of importing createElement from React and using it to create the Logo component, you can use JSX syntax for improved readability.

Apply this change:

-import { createElement } from 'react'
+import React from 'react'

Update the logo function:

-logo: (application: Application) => {
-  const logo = createElement(Logo, { application })
-  return () => logo
-},
+logo: (application: Application) => () => <Logo application={application} />,

27-30: Simplify the 'logo' function definition.

You can streamline the logo function by returning the component directly without the intermediate variable assignment.

Apply this diff to simplify the code:

-logo: (application: Application) => {
-  const logo = React.createElement(Logo, { application })
-  return () => logo
-},
+logo: (application: Application) => () => <Logo application={application} />,
libs/application/templates/financial-aid/src/forms/MuncipalityNotRegistered.ts (2)

6-7: Consider using JSX syntax for creating elements.

Using JSX syntax can enhance readability by making the code more declarative.

Apply this change:

-import { Logo } from '../components/Logo/Logo'
-import { createElement } from 'react'
+import React from 'react'
+import { Logo } from '../components/Logo/Logo'

Update the logo function:

-logo: (application: Application) => {
-  const logo = createElement(Logo, { application })
-  return () => logo
-},
+logo: (application: Application) => () => <Logo application={application} />,

11-14: Simplify the 'logo' function for clarity.

Streamlining the logo function improves code readability by removing unnecessary variables.

Apply this diff:

-logo: (application: Application) => {
-  const logo = React.createElement(Logo, { application })
-  return () => logo
-},
+logo: (application: Application) => () => <Logo application={application} />,
libs/application/templates/financial-aid/src/components/Logo/Logo.tsx (1)

28-28: Add loading and error states to improve UX.

The img element should handle loading and error states gracefully.

-  return <img src={logo} alt="Municipality logo" />
+  return (
+    <img
+      src={logo}
+      alt="Municipality logo"
+      onError={(e) => {
+        e.currentTarget.style.display = 'none'
+        console.warn('Failed to load municipality logo')
+      }}
+      style={{ maxWidth: '100%', height: 'auto' }}
+    />
+  )
libs/application/templates/financial-aid/src/fields/ServiceCenter/ServiceCenter.tsx (1)

Line range hint 39-43: Add security attributes to window.open call

Add rel="noopener noreferrer" to prevent potential security vulnerabilities when opening external links.

 onClick={() => {
-  window.open(applicantsCenter?.link, '_ blank')
+  window.open(applicantsCenter?.link, '_blank', 'noopener,noreferrer')
 }}
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/inARelationshipSubsection.ts (1)

13-15: Improve type safety in condition function

The current type casting could be made more explicit and type-safe.

-condition: (_, externalData) =>
-  (externalData as unknown as ExternalData).nationalRegistrySpouse.data !=
-  null,
+condition: (_: unknown, externalData: unknown) => {
+  const typedData = externalData as ExternalData
+  return typedData.nationalRegistrySpouse?.data != null
+},
libs/application/templates/financial-aid/src/fields/TaxReturnFilesForm/TaxReturnFilesForm.tsx (2)

Line range hint 39-42: Fix duplicate error message

The title and message are using the same translation key.

 <AlertMessage
   type="error"
   title={formatMessage(taxReturnForm.alertMessage.title)}
-  message={formatMessage(taxReturnForm.alertMessage.title)}
+  message={formatMessage(taxReturnForm.alertMessage.message)}
 />

Line range hint 24-27: Extract complex condition into a helper function

The complex condition for determining tax data ownership could be extracted into a named helper function for better readability.

+const getTaxDataOwner = (assignees: string[], externalData: ExternalData) => {
+  const isAssignee = assignees.includes(externalData.nationalRegistry.data.nationalId)
+  return isAssignee && externalData?.taxDataSpouse?.data
+    ? externalData.taxDataSpouse.data
+    : externalData.taxData.data
+}

 const { municipalitiesDirectTaxPayments, municipalitiesPersonalTaxReturn } =
-  assignees.includes(externalData.nationalRegistry.data.nationalId) &&
-  externalData?.taxDataSpouse?.data
-    ? externalData.taxDataSpouse.data
-    : externalData.taxData.data
+  getTaxDataOwner(assignees, externalData)
libs/application/templates/financial-aid/src/forms/SpouseSubmitted.ts (1)

17-20: Consider using JSX instead of createElement.

The logo creation could be simplified using JSX syntax for better readability.

-  logo: (application: Application) => {
-    const logo = createElement(Logo, { application })
-    return () => logo
-  },
+  logo: (application: Application) => () => <Logo application={application} />,
libs/application/templates/financial-aid/src/forms/ApplicantSubmitted.ts (1)

17-20: Consider extracting logo factory to a shared utility.

The logo implementation is duplicated across multiple forms. Consider creating a shared utility function.

// shared/createFormLogo.ts
export const createFormLogo = (application: Application) => () => (
  <Logo application={application} />
)

// Usage in forms
import { createFormLogo } from '../shared/createFormLogo'

export const ApplicantSubmitted: Form = buildForm({
  // ...
  logo: createFormLogo,
})
libs/application/templates/financial-aid/src/fields/ContactInfo/ContactInfo.tsx (1)

Line range hint 15-15: Consider using a more specific type for answers.

Instead of using type assertion, consider creating a proper type for the answers object structure.

- const { answers } = application
+ const { answers } = application as { answers: answersSchema }
libs/application/templates/financial-aid/src/fields/BankInfoForm/BankInfoForm.tsx (1)

Line range hint 8-8: Enhance type safety for the answers object.

Consider adding proper type definitions for the answers object to improve type safety and maintainability.

- const { answers } = application
+ const { answers } = application as { answers: { bankInfo?: { bankNumber?: string; ledger?: string; accountNumber?: string } } }
libs/application/templates/financial-aid/src/fields/EmploymentForm/EmploymentForm.tsx (1)

Line range hint 13-16: Consider using a type guard instead of type assertion.

Instead of using type assertion for input types, consider creating a proper type guard function.

- const typeInput = {
-   id: 'employment.type',
-   error: errors?.employment?.type,
- } as InputTypes
+ const typeInput: InputTypes = {
+   id: 'employment.type',
+   error: errors?.employment?.type,
+ }
libs/application/templates/financial-aid/src/forms/PrerequisitesSpouse.ts (1)

27-30: Consider memoizing the logo component.

The current implementation creates a new logo element on every render. Consider memoizing it for better performance.

 logo: (application: Application) => {
-  const logo = createElement(Logo, { application })
-  return () => logo
+  const logo = React.useMemo(
+    () => createElement(Logo, { application }),
+    [application]
+  )
+  return () => logo
 },
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/index.ts (1)

33-41: Refactor duplicated condition logic for children subsections.

The condition for checking children custody information is duplicated in two subsections. Consider extracting this logic into a shared function to improve maintainability.

+const hasChildrenWithInfo = (externalData: unknown) => {
+  const childWithInfo = getValueViaPath(
+    externalData,
+    'childrenCustodyInformation.data',
+    [],
+  ) as ApplicantChildCustodyInformation[]
+  return Boolean(childWithInfo?.length)
+}

 buildSubSection({
-  condition: (_, externalData) => {
-    const childWithInfo = getValueViaPath(
-      externalData,
-      'childrenCustodyInformation.data',
-      [],
-    ) as ApplicantChildCustodyInformation[]
-    return Boolean(childWithInfo?.length)
-  },
+  condition: (_, externalData) => hasChildrenWithInfo(externalData),
   // ... rest of the code
 })

Also applies to: 53-61

libs/application/templates/financial-aid/src/forms/Prerequisites.ts (1)

34-37: Enhance type safety in logo implementation.

While the logo implementation is functional, consider using JSX syntax for better type checking and readability. The current implementation using createElement is less type-safe.

-  logo: (application: Application) => {
-    const logo = createElement(Logo, { application })
-    return () => logo
-  },
+  logo: (application: Application) => {
+    return () => <Logo application={application} />
+  },
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 28d8564 and 2030318.

⛔ Files ignored due to path filters (69)
  • libs/application/templates/financial-aid/src/assets/svg/akrahreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/akranes.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/akureyri.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/arborg.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/arneshreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/asahreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/blaskogabyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/blonduosbaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/bolungarvik.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/borgarbyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/dalabyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/dalvikurbyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/eyja-og-miklaholtshreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/eyjafjardarsveit.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/fjallabyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/fjardabyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/fljotsdalshreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/floahreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/gardabaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/grimsnes-og-grafningshreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/grindavikurbaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/grundafjardarbaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/grytubakkahreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/hafnarfjordur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/helgafellssveit.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/horgarsveit.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/hornafjordur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/hrunamannahreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/hunathing-vestra.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/hunavatnshreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/hvalfjardarsveit.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/hveragerdisbaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/isafjardarbaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/kaldrananeshreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/kjosarhreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/kopavogur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/langanesbyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/mosfellsbaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/mulathing.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/myrdalshreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/nordurthing.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/olfus.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/rangarthing-ytra.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/rangarthing_eystra.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/reykholahreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/reykjanesbaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/sambandid.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/seltjarnarnes.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/skaftarhreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/skagabyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/skagafjordur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/skagastrond.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/skeida-og-gnupverjahreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/skorradalur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/skutustadahreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/snaefellsbaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/strandabyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/stykkisholmsbaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/sudavikurhreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/sudurnesjabaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/svalbardshreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/svalbardsstrandarhreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/talknafjardarhreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/thingeyjarsveit.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/tjorneshreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/vestmannaeyjabaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/vesturbyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/vogar.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/vopnafjardarhreppur.svg is excluded by !**/*.svg
📒 Files selected for processing (32)
  • libs/application/templates/financial-aid/src/components/Logo/Logo.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/AboutForm/AboutForm.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/AboutSpouseForm/AboutSpouseForm.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/BankInfoForm/BankInfoForm.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/ChildrenFilesForm/ChildrenFilesForm.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/ChildrenForm/ChildrenForm.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/ContactInfo/ContactInfo.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/EmploymentForm/EmploymentForm.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/HomeCircumstancesForm/HomeCircumstancesForm.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/InRelationshipForm/InRelationshipForm.tsx (0 hunks)
  • libs/application/templates/financial-aid/src/fields/IncomeFilesForm/IncomeFilesForm.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/IncomeForm/IncomeForm.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/Logo/Logo.css.ts (0 hunks)
  • libs/application/templates/financial-aid/src/fields/Logo/Logo.tsx (0 hunks)
  • libs/application/templates/financial-aid/src/fields/PersonalTaxCreditForm/PersonalTaxCreditForm.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/ServiceCenter/ServiceCenter.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/StudentForm/StudentForm.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/Summary/SpouseSummaryForm.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/Summary/SummaryForm.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/TaxReturnFilesForm/TaxReturnFilesForm.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/UnknownRelationshipForm/UnknownRelationshipForm.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/index.ts (0 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicantSubmitted.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/index.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/inARelationshipSubsection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/index.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/MuncipalityNotRegistered.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/Prerequisites.ts (2 hunks)
  • libs/application/templates/financial-aid/src/forms/PrerequisitesSpouse.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/Spouse.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/SpouseSubmitted.ts (1 hunks)
  • libs/application/templates/financial-aid/src/lib/FinancialAidTemplate.ts (1 hunks)
💤 Files with no reviewable changes (4)
  • libs/application/templates/financial-aid/src/fields/index.ts
  • libs/application/templates/financial-aid/src/fields/Logo/Logo.css.ts
  • libs/application/templates/financial-aid/src/fields/InRelationshipForm/InRelationshipForm.tsx
  • libs/application/templates/financial-aid/src/fields/Logo/Logo.tsx
✅ Files skipped from review due to trivial changes (1)
  • libs/application/templates/financial-aid/src/fields/UnknownRelationshipForm/UnknownRelationshipForm.tsx
🧰 Additional context used
📓 Path-based instructions (27)
libs/application/templates/financial-aid/src/fields/ChildrenFilesForm/ChildrenFilesForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/BankInfoForm/BankInfoForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/PersonalTaxCreditForm/PersonalTaxCreditForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicantSubmitted.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/IncomeForm/IncomeForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/SpouseSubmitted.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/IncomeFilesForm/IncomeFilesForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/ServiceCenter/ServiceCenter.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/EmploymentForm/EmploymentForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/Summary/SummaryForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/ContactInfo/ContactInfo.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/StudentForm/StudentForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/AboutForm/AboutForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/Summary/SpouseSummaryForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/ChildrenForm/ChildrenForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/TaxReturnFilesForm/TaxReturnFilesForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/PrerequisitesSpouse.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/AboutSpouseForm/AboutSpouseForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/Prerequisites.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/index.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/inARelationshipSubsection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/Spouse.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/HomeCircumstancesForm/HomeCircumstancesForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/components/Logo/Logo.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/MuncipalityNotRegistered.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/index.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/lib/FinancialAidTemplate.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
🪛 Biome (1.9.4)
libs/application/templates/financial-aid/src/components/Logo/Logo.tsx

[error] 18-18: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (29)
libs/application/templates/financial-aid/src/forms/ApplicationForm/index.ts (2)

13-13: Importing 'Application' type enhances type safety.

Adding the Application type to the imports ensures proper typing for the logo function parameter, improving type safety and code clarity.


19-19: Ensure 'personalInterestSection' is correctly integrated.

Including personalInterestSection in the children array streamlines the form structure. Please verify that all subsections previously defined are now properly encapsulated within personalInterestSection and that no functionality is lost.

libs/application/templates/financial-aid/src/forms/MuncipalityNotRegistered.ts (1)

2-2: Importing 'Application' type enhances type safety.

Including the Application type ensures that the logo function parameter is properly typed, which aids in maintaining type safety across the application.

libs/application/templates/financial-aid/src/fields/ChildrenFilesForm/ChildrenFilesForm.tsx (2)

28-28: Removal of 'withLogo' HOC is appropriate due to new logo handling.

Since the logo is now handled at the form level via the logo property in buildForm, removing the withLogo higher-order component is appropriate and simplifies the component export.


28-28: Ensure logo display is consistent after HOC removal.

Verify that the ChildrenFilesForm still displays the logo as intended. With the removal of withLogo, ensure that all instances where this component is used are properly encompassed by forms that provide the logo.

libs/application/templates/financial-aid/src/components/Logo/Logo.tsx (1)

7-9: LGTM! Props are well-typed using TypeScript.

The component properly defines its props interface using TypeScript, enhancing type safety and maintainability.

libs/application/templates/financial-aid/src/fields/IncomeFilesForm/IncomeFilesForm.tsx (1)

32-32: LGTM! Successfully removed withLogo HOC.

The removal of the withLogo HOC aligns with the PR objectives of utilizing shared components and improving maintainability.

libs/application/templates/financial-aid/src/fields/AboutForm/AboutForm.tsx (1)

36-36: LGTM! Successfully removed withLogo HOC.

The removal of the withLogo HOC aligns with the PR objectives of utilizing shared components and improving maintainability.

libs/application/templates/financial-aid/src/fields/AboutSpouseForm/AboutSpouseForm.tsx (1)

37-37: LGTM! Successfully removed withLogo HOC.

The removal of the withLogo HOC aligns with the PR objectives of utilizing shared components and improving maintainability.

libs/application/templates/financial-aid/src/fields/ServiceCenter/ServiceCenter.tsx (1)

54-54: Verify logo visibility after withLogo removal

The removal of withLogo HOC might affect logo visibility in this component.

libs/application/templates/financial-aid/src/fields/PersonalTaxCreditForm/PersonalTaxCreditForm.tsx (1)

55-55: LGTM! Clean TypeScript implementation using shared components

The component effectively uses shared form fields and follows TypeScript best practices.

libs/application/templates/financial-aid/src/fields/IncomeForm/IncomeForm.tsx (1)

60-60: LGTM! Simplified component export.

The removal of the withLogo HOC aligns with the PR objectives to reduce custom components and improve maintainability.

libs/application/templates/financial-aid/src/forms/SpouseSubmitted.ts (1)

7-7: LGTM! Proper type imports.

The addition of the Application type ensures type safety for the logo property.

Also applies to: 11-12

libs/application/templates/financial-aid/src/fields/StudentForm/StudentForm.tsx (1)

72-72: LGTM! Simplified component export.

The removal of the withLogo HOC aligns with the PR objectives while maintaining component functionality.

libs/application/templates/financial-aid/src/fields/ContactInfo/ContactInfo.tsx (1)

67-67: LGTM! Removal of withLogo HOC aligns with PR objectives.

The direct export of the component improves code clarity and reduces unnecessary wrapping.

libs/application/templates/financial-aid/src/fields/BankInfoForm/BankInfoForm.tsx (1)

81-81: LGTM! Removal of withLogo HOC aligns with PR objectives.

The direct export improves code clarity and reduces unnecessary wrapping.

libs/application/templates/financial-aid/src/fields/ChildrenForm/ChildrenForm.tsx (1)

96-96: LGTM! Clean implementation with proper type safety.

The component demonstrates good practices:

  • Proper TypeScript usage with FAFieldBaseProps
  • Effective use of shared components
  • Good error handling and form control
libs/application/templates/financial-aid/src/fields/EmploymentForm/EmploymentForm.tsx (1)

96-96: LGTM! Removal of withLogo HOC aligns with PR objectives.

The direct export improves code clarity and reduces unnecessary wrapping.

libs/application/templates/financial-aid/src/forms/PrerequisitesSpouse.ts (2)

10-15: LGTM! Clean type imports.

The addition of the Application type import enhances type safety for the logo property implementation.


20-21: LGTM! Required imports for logo implementation.

The imports of createElement and Logo component are correctly added to support the new logo functionality.

libs/application/templates/financial-aid/src/fields/Summary/SpouseSummaryForm.tsx (1)

114-114: LGTM! Clean removal of withLogo HOC.

The removal of the withLogo HOC aligns with the PR's objective to refactor and standardize logo handling at the form level.

libs/application/templates/financial-aid/src/forms/Spouse.ts (3)

8-13: LGTM! Clean type imports.

The addition of the Application type import enhances type safety for the logo property implementation.


18-19: LGTM! Required imports for logo implementation.

The imports of createElement and Logo component are correctly added to support the new logo functionality.


25-28: Consider memoizing the logo component.

The current implementation creates a new logo element on every render. Consider memoizing it for better performance.

libs/application/templates/financial-aid/src/fields/HomeCircumstancesForm/HomeCircumstancesForm.tsx (1)

115-115: LGTM! Clean removal of withLogo HOC.

The removal of the withLogo HOC aligns with the PR's objective to refactor and standardize logo handling at the form level.

libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/index.ts (1)

1-106: Well-structured section with proper conditional rendering!

The section is well-organized using builder functions and includes appropriate conditional rendering based on external data. The code follows TypeScript best practices and maintains good separation of concerns.

libs/application/templates/financial-aid/src/forms/Prerequisites.ts (1)

10-15: LGTM! Proper type imports from application types.

The imports are well-organized and include all necessary types from the application system.

libs/application/templates/financial-aid/src/fields/Summary/SummaryForm.tsx (1)

206-206: Clean export without HOC wrapper - good improvement!

Removing the withLogo HOC simplifies the component structure and follows the PR's objective of standardizing logo handling.

libs/application/templates/financial-aid/src/lib/FinancialAidTemplate.ts (1)

112-114: LGTM! Updated import path matches new file structure.

The form loader correctly references the new ApplicationForm module, maintaining consistency with the refactored file structure.

Comment on lines +11 to +14
const [logo, setLogo] = useState<string>()
const municipality = application.externalData.municipality
?.data as Municipality

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add type assertion safety checks.

The type assertion for municipality data could be unsafe. Consider adding runtime validation.

-  const municipality = application.externalData.municipality
-    ?.data as Municipality
+  const municipality = application.externalData.municipality?.data
+  if (municipality && !isMunicipality(municipality)) {
+    console.warn('Invalid municipality data structure')
+    return null
+  }

Consider adding this type guard:

function isMunicipality(data: unknown): data is Municipality {
  return (
    typeof data === 'object' &&
    data !== null &&
    'municipalityId' in data
  )
}

Comment on lines +15 to +27
useEffect(() => {
const getLogo = async () => {
const municipalityId =
municipality && municipality?.municipalityId
? municipality.municipalityId
: ''
const svgLogo = await import(
`../../assets/svg/${logoKeyFromMunicipalityCode[municipalityId]}`
)
setLogo(svgLogo.default)
}
getLogo()
}, [municipality])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add error handling for dynamic imports.

The dynamic import could fail if the logo file doesn't exist. Consider adding error handling.

   useEffect(() => {
     const getLogo = async () => {
+      try {
         const municipalityId =
           municipality && municipality?.municipalityId
             ? municipality.municipalityId
             : ''
         const svgLogo = await import(
           `../../assets/svg/${logoKeyFromMunicipalityCode[municipalityId]}`
         )
         setLogo(svgLogo.default)
+      } catch (error) {
+        console.error('Failed to load municipality logo:', error)
+        setLogo(undefined)
+      }
     }
     getLogo()
   }, [municipality])
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
useEffect(() => {
const getLogo = async () => {
const municipalityId =
municipality && municipality?.municipalityId
? municipality.municipalityId
: ''
const svgLogo = await import(
`../../assets/svg/${logoKeyFromMunicipalityCode[municipalityId]}`
)
setLogo(svgLogo.default)
}
getLogo()
}, [municipality])
useEffect(() => {
const getLogo = async () => {
try {
const municipalityId =
municipality && municipality?.municipalityId
? municipality.municipalityId
: ''
const svgLogo = await import(
`../../assets/svg/${logoKeyFromMunicipalityCode[municipalityId]}`
)
setLogo(svgLogo.default)
} catch (error) {
console.error('Failed to load municipality logo:', error)
setLogo(undefined)
}
}
getLogo()
}, [municipality])
🧰 Tools
🪛 Biome (1.9.4)

[error] 18-18: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant