Skip to content

Commit

Permalink
feat(app-sys): add tab title option (#17263)
Browse files Browse the repository at this point in the history
* feat: option of tabTitle to sections and subsections

* feat: rathter use FormTextWithLocale

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
jonnigs and kodiakhq[bot] authored Dec 16, 2024
1 parent 400f28f commit d30a093
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions libs/application/types/src/lib/Form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ export interface Section extends FormItem {
type: FormItemTypes.SECTION
children: SectionChildren[]
draftPageNumber?: number
tabTitle?: FormTextWithLocale
}

export interface SubSection extends FormItem {
type: FormItemTypes.SUB_SECTION
children: FormLeaf[]
tabTitle?: FormTextWithLocale
}

export interface Repeater extends FormItem {
Expand Down
4 changes: 3 additions & 1 deletion libs/application/ui-shell/src/hooks/useApplicationTitle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ export const getApplicationTitle = (
const titleParts = [`${formName} | Ísland.is`]

if (activeSection) {
const tabTitle = activeSection.tabTitle
const title = activeSection.title
const sectionTitle = formatTextWithLocale(
activeSection.title,
tabTitle || title,
state.application,
locale as Locale,
formatMessage,
Expand Down

0 comments on commit d30a093

Please sign in to comment.