Skip to content

Commit d0fc43e

Browse files
authored
Merge pull request #2 from helpwave/patch/implement-all-views
fix themeprovider
2 parents 4c383f4 + 51a6e18 commit d0fc43e

51 files changed

Lines changed: 93 additions & 161 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

locales/de.arb renamed to locales/de-DE.arb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"@@locale": "de",
2+
"@@locale": "de-DE",
33
"helpwaveId": "helpwave id",
44
"@helpwaveId": {
55
"description": "Titel für helpwave id Badge"

locales/en.arb renamed to locales/en-US.arb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"@@locale": "en",
2+
"@@locale": "en-US",
33
"helpwaveId": "helpwave id",
44
"@helpwaveId": {
55
"description": "Title for helpwave id badge"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "id.helpwave.de",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"repository": {
55
"type": "git",
66
"url": "git://github.com/helpwave/id.helpwave.de.git"

src/i18n/translations.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import type { Translation } from '@helpwave/internationalization'
66
import { TranslationGen } from '@helpwave/internationalization'
77

8-
export const helpwaveIdTranslationLocales = ['de', 'en'] as const
8+
export const helpwaveIdTranslationLocales = ['de-DE', 'en-US'] as const
99

1010
export type HelpwaveIdTranslationLocales = typeof helpwaveIdTranslationLocales[number]
1111

@@ -78,7 +78,7 @@ export type HelpwaveIdTranslationEntries = {
7878
}
7979

8080
export const helpwaveIdTranslation: Translation<HelpwaveIdTranslationLocales, Partial<HelpwaveIdTranslationEntries>> = {
81-
'de': {
81+
'de-DE': {
8282
'acceptTerms': `Ich akzeptiere die Allgemeinen Geschäftsbedingungen`,
8383
'backToApplication': `Zurück zur Anwendung`,
8484
'backToLogin': `Zurück zur Anmeldung`,
@@ -150,7 +150,7 @@ export const helpwaveIdTranslation: Translation<HelpwaveIdTranslationLocales, Pa
150150
'x509InfoMessage': `Bitte geben Sie Ihre X.509 Zertifikatsinformationen an`,
151151
'x509InfoTitle': `X.509 Zertifikatsinformationen`
152152
},
153-
'en': {
153+
'en-US': {
154154
'acceptTerms': `I accept the terms and conditions`,
155155
'backToApplication': `Back to Application`,
156156
'backToLogin': `Back to Login`,

src/i18n/useTranslation.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import { combineTranslation } from '@helpwave/internationalization'
2-
import { helpwaveIdTranslation, type HelpwaveIdTranslationLocales } from './translations'
1+
import { helpwaveIdTranslation } from './translations'
2+
import { useHightideTranslation } from '@helpwave/hightide'
33

4-
export function useTranslation(locale?: string) {
5-
const lang = (locale ?? 'en') as HelpwaveIdTranslationLocales
6-
console.log(locale, lang)
7-
return combineTranslation(helpwaveIdTranslation, lang)
8-
}
4+
export const useTranslation = () => useHightideTranslation(helpwaveIdTranslation)

src/index.css

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
11
@import "tailwindcss";
2-
3-
:root {
4-
--hw-color-secondary-50: #f9fafb;
5-
--hw-color-secondary-100: #f3f4f6;
6-
--hw-color-secondary-200: #e5e7eb;
7-
--hw-color-secondary-300: #d1d5db;
8-
--hw-color-secondary-400: #9ca3af;
9-
--hw-color-secondary-500: #6b7280;
10-
--hw-color-secondary-600: #4b5563;
11-
--hw-color-secondary-700: #374151;
12-
--hw-color-secondary-800: #1f2937;
13-
--hw-color-secondary-900: #111827;
14-
}
2+
@import "@helpwave/hightide/style/uncompiled/globals.css";
3+
@source "./node_modules/@helpwave/hightide";
154

165
@layer base {
17-
body {
18-
min-height: 100vh;
19-
background-color: var(--hw-color-background) !important;
6+
html, body, main {
7+
@apply bg-background text-on-background;
208
}
219
}

src/login/components/Branding.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ export function Branding() {
44
return (
55
<div className="flex flex-col items-center gap-4 mb-8 sm:gap-3 sm:mb-6">
66
<HelpwaveLogo height={64} width={64} />
7-
<div className="font-['Space_Grotesk',_'Helvetica_Neue',_Helvetica,_sans-serif] text-2xl font-bold text-black tracking-[-0.5px] sm:text-xl">
7+
<div className="font-space text-2xl font-bold tracking-[-0.5px] sm:text-xl">
88
helpwave id
99
</div>
1010
</div>
1111
)
12-
}
12+
}

src/login/components/Footer.tsx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
1-
import type { KcContext } from '../KcContext'
21
import { useTranslation } from '../../i18n/useTranslation'
32

4-
type FooterProps = {
5-
kcContext: KcContext,
6-
}
7-
8-
export function Footer({ kcContext }: FooterProps) {
9-
const locale = kcContext.locale?.currentLanguageTag ?? 'en'
10-
const t = useTranslation(locale)
3+
export function Footer() {
4+
const t = useTranslation()
115

126
return (
137
<div
14-
className="text-center text-[13px] mt-8 pt-4 border-t border-[var(--hw-color-neutral-200)] sm:text-xs sm:mt-6 sm:pt-3"
15-
style={{ color: 'var(--hw-color-neutral-600)' }}
8+
className="text-center text-sm mt-8 pt-4"
169
>
1710
<div className="mb-2">
1811
<a
1912
href="https://cdn.helpwave.de/imprint.html"
2013
target="_blank"
2114
rel="noopener noreferrer"
22-
className="underline mx-2 sm:mx-1"
15+
className="mx-2 sm:mx-1"
2316
style={{ color: 'var(--hw-color-neutral-600)' }}
2417
>
2518
{t('imprint')}
@@ -29,12 +22,12 @@ export function Footer({ kcContext }: FooterProps) {
2922
href="https://cdn.helpwave.de/privacy.html"
3023
target="_blank"
3124
rel="noopener noreferrer"
32-
className="underline mx-2 sm:mx-1"
25+
className="mx-2 sm:mx-1"
3326
style={{ color: 'var(--hw-color-neutral-600)' }}
3427
>
3528
{t('privacy')}
3629
</a>
3730
</div>
3831
</div>
3932
)
40-
}
33+
}

src/login/components/LanguageSwitcher.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function LanguageSwitcher({ kcContext }: LanguageSwitcherProps) {
2020
<>
2121
<Button
2222
type="button"
23-
color="secondary"
23+
color="neutral"
2424
onClick={() => setIsOpen(true)}
2525
style={{ padding: '0.5rem', minWidth: 'auto' }}
2626
aria-label="Change language"
@@ -35,7 +35,7 @@ export function LanguageSwitcher({ kcContext }: LanguageSwitcherProps) {
3535
<Button
3636
key={lang.languageTag}
3737
type="button"
38-
color={kcContext.locale?.currentLanguageTag === lang.languageTag ? 'primary' : 'secondary'}
38+
color={kcContext.locale?.currentLanguageTag === lang.languageTag ? 'primary' : 'neutral'}
3939
onClick={() => {
4040
handleLanguageChange(lang.languageTag)
4141
setIsOpen(false)
@@ -47,4 +47,4 @@ export function LanguageSwitcher({ kcContext }: LanguageSwitcherProps) {
4747
</LanguageDialog>
4848
</>
4949
)
50-
}
50+
}

src/login/components/PageLayout.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ export function PageLayout({ kcContext, children }: PageLayoutProps) {
1818
<style>{hideKeycloakStyles}</style>
1919
<div
2020
className="flex flex-col min-h-screen p-4 relative"
21-
style={{
22-
backgroundColor:
23-
'var(--hw-color-background, var(--hw-color-neutral-0, #ffffff))'
24-
}}
2521
>
2622
<div className="absolute top-4 right-4 flex gap-2 z-[1000] sm:top-2 sm:right-2 sm:gap-1">
2723
<ThemeSwitcher />
@@ -37,8 +33,8 @@ export function PageLayout({ kcContext, children }: PageLayoutProps) {
3733
</div>
3834
</div>
3935

40-
<Footer kcContext={kcContext} />
36+
<Footer />
4137
</div>
4238
</>
4339
)
44-
}
40+
}

0 commit comments

Comments
 (0)