Refactor code and update dependencies

Rearranged imports for better organization and readability across multiple files. Updated the `react-i18next` dependency to version 15.0.1 in various `package.json` files. Adjusted formatting in multiple TypeScript files to ensure code style consistency.
This commit is contained in:
gbuomprisco
2024-08-11 12:04:49 +02:00
parent e3503d8d47
commit babdecb78f
34 changed files with 2460 additions and 2385 deletions

View File

@@ -47,10 +47,7 @@ export function createAnalyticsManager<T extends string, Config extends object>(
registerActiveServices(options);
return {
addProvider: (
provider: T,
config: Config,
) => {
addProvider: (provider: T, config: Config) => {
const factory = options.providers[provider];
if (!factory) {

View File

@@ -34,7 +34,7 @@
"next": "14.2.5",
"react": "18.3.1",
"react-hook-form": "^7.52.2",
"react-i18next": "^15.0.0",
"react-i18next": "^15.0.1",
"zod": "^3.23.8"
},
"eslintConfig": {

View File

@@ -16,8 +16,8 @@
},
"dependencies": {
"@stripe/react-stripe-js": "^2.7.3",
"@stripe/stripe-js": "^4.1.0",
"stripe": "^16.6.0"
"@stripe/stripe-js": "^4.2.0",
"stripe": "^16.7.0"
},
"devDependencies": {
"@kit/billing": "workspace:^",

View File

@@ -44,7 +44,7 @@
"react": "18.3.1",
"react-dom": "18.3.1",
"react-hook-form": "^7.52.2",
"react-i18next": "^15.0.0",
"react-i18next": "^15.0.1",
"sonner": "^1.5.0",
"zod": "^3.23.8"
},

View File

@@ -103,7 +103,7 @@ export function AccountSelector({
role="combobox"
aria-expanded={open}
className={cn(
'dark:shadow-primary/10 group w-full lg:w-auto min-w-0 lg:max-w-fit px-2',
'dark:shadow-primary/10 group w-full min-w-0 px-2 lg:w-auto lg:max-w-fit',
{
'justify-start': !collapsed,
'justify-center': collapsed,

View File

@@ -93,7 +93,7 @@ export function PersonalAccountDropdown({
)}
>
<ProfileAvatar
className={'border border-transparent group-hover:border-primary/10'}
className={'group-hover:border-primary/10 border border-transparent'}
displayName={displayName ?? user?.email ?? ''}
pictureUrl={personalAccountData?.picture_url}
/>

View File

@@ -34,7 +34,7 @@
"lucide-react": "^0.424.0",
"next": "14.2.5",
"react-hook-form": "^7.52.2",
"react-i18next": "^15.0.0",
"react-i18next": "^15.0.1",
"sonner": "^1.5.0",
"zod": "^3.23.8"
},

View File

@@ -26,7 +26,7 @@
"lucide-react": "^0.424.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-i18next": "^15.0.0"
"react-i18next": "^15.0.1"
},
"prettier": "@kit/prettier-config",
"eslintConfig": {

View File

@@ -44,7 +44,7 @@
"react": "18.3.1",
"react-dom": "18.3.1",
"react-hook-form": "^7.52.2",
"react-i18next": "^15.0.0",
"react-i18next": "^15.0.1",
"sonner": "^1.5.0",
"zod": "^3.23.8"
},

View File

@@ -28,7 +28,7 @@ export function TeamAccountSettingsContainer(props: {
features: {
enableTeamDeletion: boolean;
}
};
}) {
return (
<div className={'flex w-full flex-col space-y-4'}>

View File

@@ -22,7 +22,7 @@
"@kit/tailwind-config": "workspace:*",
"@kit/tsconfig": "workspace:*",
"@tanstack/react-query": "5.51.21",
"react-i18next": "^15.0.0"
"react-i18next": "^15.0.1"
},
"dependencies": {
"i18next": "^23.12.2",

View File

@@ -16,7 +16,7 @@
"./config/server": "./src/sentry.client.server.ts"
},
"dependencies": {
"@sentry/nextjs": "^8.24.0"
"@sentry/nextjs": "^8.25.0"
},
"devDependencies": {
"@kit/eslint-config": "workspace:*",

File diff suppressed because it is too large Load Diff

View File

@@ -54,7 +54,7 @@
"prettier": "^3.3.3",
"react-day-picker": "^8.10.1",
"react-hook-form": "^7.52.2",
"react-i18next": "^15.0.0",
"react-i18next": "^15.0.1",
"sonner": "^1.5.0",
"tailwindcss": "3.4.7",
"tailwindcss-animate": "^1.0.7",

View File

@@ -1,5 +1,7 @@
'use client';
import { Fragment } from 'react';
import { usePathname } from 'next/navigation';
import {
@@ -12,7 +14,6 @@ import {
} from '../shadcn/breadcrumb';
import { If } from './if';
import { Trans } from './trans';
import { Fragment } from 'react';
const unslugify = (slug: string) => slug.replace(/-/g, ' ');

View File

@@ -59,7 +59,12 @@ export function PageMobileNavigation(
}>,
) {
return (
<div className={cn('w-full py-2 lg:hidden flex items-center border-b', props.className)}>
<div
className={cn(
'flex w-full items-center border-b py-2 lg:hidden',
props.className,
)}
>
{props.children}
</div>
);
@@ -77,7 +82,7 @@ function PageWithHeader(props: PageProps) {
>
<div
className={cn(
'flex h-14 items-center justify-between bg-muted/40 px-4 lg:shadow-sm dark:border-border dark:shadow-primary/10 lg:justify-start',
'flex h-14 items-center justify-between bg-muted/40 px-4 dark:border-border dark:shadow-primary/10 lg:justify-start lg:shadow-sm',
{
'sticky top-0 z-10 backdrop-blur-md': props.sticky ?? true,
},
@@ -151,7 +156,7 @@ export function PageHeader({
return (
<div
className={cn(
'flex items-center justify-between lg:px-4 py-4',
'flex items-center justify-between py-4 lg:px-4',
className,
)}
>

View File

@@ -1,5 +1,5 @@
import { Avatar, AvatarFallback, AvatarImage } from '../shadcn/avatar';
import {cn} from "../utils";
import { cn } from '../utils';
type SessionProps = {
displayName: string | null;
@@ -15,7 +15,10 @@ type ProfileAvatarProps = (SessionProps | TextProps) & {
};
export function ProfileAvatar(props: ProfileAvatarProps) {
const avatarClassName = cn(props.className, 'mx-auto w-9 h-9 group-focus:ring-2');
const avatarClassName = cn(
props.className,
'mx-auto w-9 h-9 group-focus:ring-2',
);
if ('text' in props) {
return (

View File

@@ -60,7 +60,9 @@ export function SidebarContent({
className?: string;
}>) {
return (
<div className={cn('flex w-full flex-col space-y-1.5 px-4 py-1', className)}>
<div
className={cn('flex w-full flex-col space-y-1.5 px-4 py-1', className)}
>
{children}
</div>
);
@@ -194,22 +196,14 @@ export function SidebarItem({
}
function getClassNameBuilder(className: string) {
return cva(
[
cn(
'flex box-content h-screen flex-col relative',
className,
),
],
{
variants: {
collapsed: {
true: `w-[6rem]`,
false: `w-2/12 lg:w-[17rem]`,
},
return cva([cn('flex box-content h-screen flex-col relative', className)], {
variants: {
collapsed: {
true: `w-[6rem]`,
false: `w-2/12 lg:w-[17rem]`,
},
},
);
});
}
export function SidebarNavigation({

View File

@@ -27,4 +27,4 @@ export function Spinner(
</svg>
</div>
);
}
}

View File

@@ -51,7 +51,10 @@ const BreadcrumbLink = React.forwardRef<
return (
<Comp
ref={ref}
className={cn('transition-colors text-foreground hover:underline', className)}
className={cn(
'text-foreground transition-colors hover:underline',
className,
)}
{...props}
/>
);

View File

@@ -8,10 +8,7 @@ const Card = React.forwardRef<
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn(
'rounded-xl border bg-card text-card-foreground',
className,
)}
className={cn('rounded-xl border bg-card text-card-foreground', className)}
{...props}
/>
));