Skip to content

Commit

Permalink
feat: set up routes & daisyui
Browse files Browse the repository at this point in the history
  • Loading branch information
phucvinh57 committed Oct 26, 2024
1 parent 97723f6 commit ecf0280
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 63 deletions.
8 changes: 8 additions & 0 deletions app/datasets/[dataset]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use client';

import { useParams } from 'next/navigation';

export default function DatasetPage() {
const { dataset } = useParams<{ dataset: string }>();
return <div>{dataset}</div>;
}
14 changes: 8 additions & 6 deletions app/datasets/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { DatasetAPI } from '@/lib/api/dataset';
import { useQuery } from '@tanstack/react-query';
import Link from 'next/link';

export default function DatasetPage() {
const { data: datasets } = useQuery({
Expand All @@ -11,12 +12,13 @@ export default function DatasetPage() {

return (
<div>
{datasets?.map((dataset) => (
<div key={dataset.name}>
<h2>{dataset.name}</h2>
<p>{dataset.description}</p>
</div>
))}
<ul className='menu menu-md bg-base-200 rounded-box w-56'>
{datasets?.map((dataset) => (
<li key={dataset.name}>
<Link href={`/datasets/${dataset.name}`}>{dataset.name}</Link>
</li>
))}
</ul>
</div>
);
}
37 changes: 0 additions & 37 deletions app/layout.css

This file was deleted.

2 changes: 1 addition & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const inter = Inter({ subsets: ['latin'] });

export default function RootLayout({ children }: React.PropsWithChildren) {
return (
<html lang='en' suppressHydrationWarning className={inter.className}>
<html lang='en' suppressHydrationWarning className={inter.className} data-theme='light'>
<body className='min-h-dvh scroll-smooth font-sans antialiased'>
<Providers>{children}</Providers>
</body>
Expand Down
Binary file modified bun.lockb
Binary file not shown.
1 change: 0 additions & 1 deletion lib/api/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import axios from 'axios';

export const api = axios.create({
baseURL: env.NEXT_PUBLIC_API_URL,
withCredentials: true,
withXSRFToken: true,
headers: {
'Content-Type': 'application/json'
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@types/node": "^22.7.6",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"daisyui": "^4.12.13",
"lefthook": "^1.7.22",
"postcss": "8.4.41",
"tailwindcss": "3.4.10",
Expand Down
25 changes: 7 additions & 18 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
import { fontFamily } from 'tailwindcss/defaultTheme';

import daisyui from 'daisyui';
import type { Config } from 'tailwindcss';
import { fontFamily } from 'tailwindcss/defaultTheme';

const config = {
content: [
'./app/**/*.{js,ts,jsx,tsx,mdx}',
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
'./components/**/*.{js,ts,jsx,tsx,mdx}',
'./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}'
'./components/**/*.{js,ts,jsx,tsx,mdx}'
],
theme: {
container: {
center: true,
padding: '1rem',
screens: {
'2xl': '1280px'
}
},
fontFamily: {
sans: ['var(--font-geist-sans)', ...fontFamily.sans],
mono: ['var(--font-geist-mono)', ...fontFamily.sans]
}
},
darkMode: 'class'
plugins: [daisyui],
daisyui: {
themes: ['light']
}
} satisfies Config;

export default config;

0 comments on commit ecf0280

Please sign in to comment.