Skip to content

Commit

Permalink
simplify theme init
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Sutu committed Sep 25, 2023
1 parent fc42a74 commit f423a5b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
7 changes: 5 additions & 2 deletions app/rsc/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ import { Alert } from '~/src/components/Alert';
import { FileInput } from '~/src/components/FileInput';

export default function ServerComponent() {
console.log('RSC powar');

return (
<>
<div className="flex flex-col gap-4 p-4">
<h1 className="textlg">Welcome to RSC, brah</h1>
<Alert>alert</Alert>
<FileInput />
</>
</div>
);
}
6 changes: 2 additions & 4 deletions src/components/Flowbite/Flowbite.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { FC, HTMLAttributes } from 'react';
import { ClientInit } from '~/src/theme-store/init/client';
import { ServerInit } from '~/src/theme-store/init/server';
import { ThemeInit } from '~/src/theme-store/init';
import type { DeepPartial } from '../../';
import type { FlowbiteTheme } from './FlowbiteTheme';

Expand All @@ -23,8 +22,7 @@ export const Flowbite: FC<FlowbiteProps> = ({ children, theme = {} }) => {

return (
<>
<ServerInit theme={customTheme} />
<ClientInit theme={customTheme} />
<ThemeInit theme={customTheme} />
{children}
</>
);
Expand Down
1 change: 0 additions & 1 deletion src/theme-store/init/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { FlowbiteTheme } from '~/src/components';
import { CustomFlowbiteTheme } from '~/src/components';
import { ClientInit } from './client';
import { ServerInit } from './server';

interface Props {
theme?: FlowbiteTheme;
theme?: CustomFlowbiteTheme;
}

export function Init({ theme }: Props) {
export function ThemeInit({ theme }: Props) {
return (
<>
<ServerInit theme={theme} />
Expand Down

0 comments on commit f423a5b

Please sign in to comment.