Skip to content

Commit 83f47b4

Browse files
authored
Merge pull request #31 from LoicArc/feature/add-service-tag-line
feat: Add service tag line
2 parents db9a070 + 814e9cd commit 83f47b4

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Several environment variables can be used to tailor the theme to your needs:
2828
```env
2929
DSFR_THEME_HOME_URL
3030
DSFR_THEME_SERVICE_TITLE
31+
DSFR_THEME_SERVICE_TAG_LINE
3132
DSFR_THEME_BRAND_TOP
3233
DSFR_NOTICE_TITLE
3334
DSFR_NOTICE_DESCRIPTION
@@ -45,6 +46,8 @@ If you are deploying Keycloak on Kubernetes using Helm, here's how to configure
4546
value: https://code.gouv.fr
4647
- name: DSFR_THEME_SERVICE_TITLE
4748
value: CodeGouv
49+
- name: DSFR_THEME_SERVICE_TAG_LINE
50+
value: My tag line
4851
- name: DSFR_THEME_BRAND_TOP
4952
value: "République<br/>Française"
5053
- name: DSFR_NOTICE_TITLE

src/account/Template.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
7171
}}
7272
/>
7373
}
74+
serviceTagline={
75+
<span
76+
dangerouslySetInnerHTML={{
77+
__html:
78+
kcContext.properties.DSFR_THEME_SERVICE_TAG_LINE || ""
79+
}}
80+
/>
81+
}
7482
quickAccessItems={[
7583
...(referrer?.url
7684
? [

src/kc.gen.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is auto-generated by the `update-kc-gen` command. Do not edit it manually.
2-
// Hash: 415229e332a814cae52152aa8f2b43dab69ceadc6ed220a115d8a8349abbde0b
2+
// Hash: 1ded21a7b8002bb4044342419812de41d9262e5530b9ef4de8909352536a5744
33

44
/* eslint-disable */
55

@@ -16,6 +16,7 @@ export const themeNames: ThemeName[] = ["DSFR"];
1616
export type KcEnvName =
1717
| "DSFR_THEME_HOME_URL"
1818
| "DSFR_THEME_SERVICE_TITLE"
19+
| "DSFR_THEME_SERVICE_TAG_LINE"
1920
| "DSFR_THEME_BRAND_TOP"
2021
| "DSFR_NOTICE_TITLE"
2122
| "DSFR_NOTICE_DESCRIPTION"
@@ -24,6 +25,7 @@ export type KcEnvName =
2425
export const kcEnvNames: KcEnvName[] = [
2526
"DSFR_THEME_HOME_URL",
2627
"DSFR_THEME_SERVICE_TITLE",
28+
"DSFR_THEME_SERVICE_TAG_LINE",
2729
"DSFR_THEME_BRAND_TOP",
2830
"DSFR_NOTICE_TITLE",
2931
"DSFR_NOTICE_DESCRIPTION",
@@ -33,9 +35,10 @@ export const kcEnvNames: KcEnvName[] = [
3335
export const kcEnvDefaults: Record<KcEnvName, string> = {
3436
DSFR_THEME_HOME_URL: "",
3537
DSFR_THEME_SERVICE_TITLE: "",
38+
DSFR_THEME_SERVICE_TAG_LINE: "",
3639
DSFR_THEME_BRAND_TOP: "République<br/>Française",
37-
DSFR_NOTICE_TITLE: "Mon super titre",
38-
DSFR_NOTICE_DESCRIPTION: "Ma super description",
40+
DSFR_NOTICE_TITLE: "",
41+
DSFR_NOTICE_DESCRIPTION: "",
3942
DSFR_NOTICE_SEVERITY: "info"
4043
};
4144

src/login/Template.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ export default function Template(props: Props) {
9090
}}
9191
/>
9292
}
93+
serviceTagline={
94+
<span
95+
dangerouslySetInnerHTML={{
96+
__html:
97+
kcContext.properties.DSFR_THEME_SERVICE_TAG_LINE || ""
98+
}}
99+
/>
100+
}
93101
/>
94102
<main role="main" id="content">
95103
{(kcContext.properties.DSFR_NOTICE_TITLE || kcContext.properties.DSFR_NOTICE_DESCRIPTION) && (

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default defineConfig({
1212
environmentVariables: [
1313
{ name: "DSFR_THEME_HOME_URL", default: "" },
1414
{ name: "DSFR_THEME_SERVICE_TITLE", default: "" },
15+
{ name: "DSFR_THEME_SERVICE_TAG_LINE", default: "" },
1516
{ name: "DSFR_THEME_BRAND_TOP", default: "République<br/>Française" },
1617
{ name: "DSFR_NOTICE_TITLE", default: "" },
1718
{ name: "DSFR_NOTICE_DESCRIPTION", default: "" },

0 commit comments

Comments
 (0)