Skip to content

Commit

Permalink
Merge branch 'main' into feat--add-qr-code
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinEichinger authored Nov 4, 2024
2 parents 9b35912 + c20af8f commit 731ea18
Show file tree
Hide file tree
Showing 37 changed files with 702 additions and 327 deletions.
161 changes: 152 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-popover": "^1.1.1",
"@radix-ui/react-radio-group": "^1.2.0",
"@radix-ui/react-select": "^2.1.1",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-tabs": "^1.1.0",
Expand Down Expand Up @@ -87,6 +87,7 @@
"qrcode.react": "^4.0.1",
"react": "^18.3.1",
"react-app-polyfill": "^3.0.0",
"react-day-picker": "^9.2.1",
"react-dev-utils": "^12.0.1",
"react-dom": "^18.3.1",
"react-i18next": "^11.18.6",
Expand Down
2 changes: 2 additions & 0 deletions src/I18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import IconUK from './assets/icons/icon_flag_uk.svg';
import IconTR from './assets/icons/icon_flag_tr.svg';
import IconRU from './assets/icons/icon_flag_ru.svg';
import IconAR from './assets/icons/icon_flag_ar.svg';
import { Settings } from 'luxon';

// As users will rarely use the non-german version, lazily load these language files
// on demand
Expand Down Expand Up @@ -63,6 +64,7 @@ export async function switchLanguage(language: string) {

if (language in lazyLanguages) {
i18next.addResourceBundle(language, 'translation', await lazyLanguages[language as keyof typeof lazyLanguages](), true, true);
Settings.defaultLocale = language;
}

i18next.changeLanguage(language);
Expand Down
8 changes: 2 additions & 6 deletions src/Utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,10 @@ export const getGradeLabel = (grade: number) => {
return i18next.t('lernfair.schoolclass', { class: grade });
};

export const formatDate: (date: Date, format?: Intl.DateTimeFormatOptions, locale?: string) => string = (
date,
format = DateTime.DATETIME_MED,
locale = 'de'
) => {
export const formatDate: (date: Date, format?: Intl.DateTimeFormatOptions, locale?: string) => string = (date, format = DateTime.DATETIME_MED, locale) => {
if (!date) return '';

return DateTime.fromISO(date.toString()).toLocaleString(format, { locale });
return DateTime.fromISO(date.toString()).toLocaleString(format, { locale: locale ?? i18next.language });
};

export const handleDateString: (datetime: string, format: string, locale?: string, outputFormat?: Intl.DateTimeFormatOptions) => string = (
Expand Down
9 changes: 6 additions & 3 deletions src/components/Breadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ const BreadcrumbContainer = React.forwardRef<
const BreadcrumbList = React.forwardRef<HTMLOListElement, React.ComponentPropsWithoutRef<'ol'>>(({ className, ...props }, ref) => (
<ol
ref={ref}
className={cn('flex flex-nowrap overflow-hidden items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5', className)}
className={cn(
'flex flex-nowrap overflow-y-hidden overflow-x-scroll items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5',
className
)}
{...props}
/>
));
Expand All @@ -38,7 +41,7 @@ const BreadcrumbLink = React.forwardRef<
<Comp
ref={ref}
className={cn(
'text-detail underline transition-colors hover:text-primary w-max max-w-[100px] lg:max-w-full overflow-hidden whitespace-nowrap text-ellipsis',
'text-detail underline transition-colors hover:text-primary max-w-[100px] lg:max-w-full overflow-hidden whitespace-nowrap text-ellipsis',
className
)}
{...props}
Expand All @@ -53,7 +56,7 @@ const BreadcrumbPage = React.forwardRef<HTMLSpanElement, React.ComponentPropsWit
role="link"
aria-disabled="true"
aria-current="page"
className={cn('font-normal text-primary text-detail w-max max-w-full lg:max-w-full overflow-hidden whitespace-nowrap text-ellipsis', className)}
className={cn('font-normal text-primary text-detail w-max max-w-full lg:max-w-full', className)}
{...props}
/>
));
Expand Down
4 changes: 3 additions & 1 deletion src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ const buttonVariants = cva(
ghost: 'hover:bg-accent hover:text-accent-foreground',
link: 'text-primary underline-offset-4 hover:underline',
none: 'text-primary',
input: 'border border-input justify-between bg-transparent text-form font-normal ring-offset-background placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:w-full [&>span]:justify-between',
},
size: {
default: 'h-10 px-4 text-form font-medium',
default: 'h-10 px-4 text-form',
sm: 'h-9 rounded-md px-3 text-sm',
lg: 'h-11 rounded-md px-8 text-base',
input: 'h-10 px-3 py-1',
icon: 'h-10 w-10',
auto: 'h-auto w-auto',
},
Expand Down
Loading

0 comments on commit 731ea18

Please sign in to comment.