Skip to content

Commit c90f5e4

Browse files
authored
Merge pull request #547 from trycompai/claudio/comp-fix-nuqs-2
[dev] [claudfuen] claudio/comp-fix-nuqs-2
2 parents a7f6b0c + 80657b3 commit c90f5e4

File tree

13 files changed

+73
-50
lines changed

13 files changed

+73
-50
lines changed

apps/framework-editor/app/components/DataTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export function DataTable<TData, TValue>({
9090

9191
if (!data || (data.length === 0 && !searchTerm)) {
9292
return (
93-
<div className="bg-white p-4 rounded-sm flex flex-col items-center justify-center py-8 text-center space-y-4" id="no-data-available">
93+
<div className="bg-card p-4 rounded-sm flex flex-col items-center justify-center py-16 text-center space-y-4" id="no-data-available">
9494
<div className="rounded-full bg-muted p-3 w-12 h-12 flex items-center justify-center mx-auto">
9595
<TableIcon className="h-6 w-6 text-muted-foreground" />
9696
</div>
@@ -115,7 +115,7 @@ export function DataTable<TData, TValue>({
115115
placeholder={searchPlaceholder}
116116
value={searchTerm}
117117
onChange={e => setGlobalFilter(e.target.value || null)}
118-
className="w-full max-w-sm"
118+
className="w-full"
119119
leftIcon={<Search className="h-4 w-4 text-muted-foreground" />}
120120
/>
121121
{onCreateClick && (

apps/framework-editor/app/components/PageLayout.tsx

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,47 @@ import {
66
BreadcrumbPage,
77
BreadcrumbSeparator,
88
} from "@comp/ui/breadcrumb";
9-
import React from "react";
9+
import { Skeleton } from "@comp/ui/skeleton";
10+
import React, { Suspense } from "react";
1011

1112
interface PageLayoutProps {
1213
children: React.ReactNode;
1314
breadcrumbs?: {
1415
href?: string;
1516
label: string;
1617
}[];
18+
isLoading?: boolean;
1719
}
1820

19-
export default function PageLayout({ children, breadcrumbs }: PageLayoutProps) {
21+
export default function PageLayout({ children, breadcrumbs, isLoading = false }: PageLayoutProps) {
22+
23+
if (isLoading) {
24+
return (
25+
<div className="flex flex-col gap-4">
26+
<div className="pt-2">
27+
<Breadcrumb>
28+
<BreadcrumbList>
29+
<BreadcrumbItem>
30+
<Skeleton className="w-24 h-6" />
31+
</BreadcrumbItem>
32+
<BreadcrumbSeparator />
33+
<BreadcrumbItem>
34+
<Skeleton className="w-32 h-6" />
35+
</BreadcrumbItem>
36+
</BreadcrumbList>
37+
</Breadcrumb>
38+
</div>
39+
<div>
40+
<Skeleton className="w-full h-[300px]" />
41+
</div>
42+
</div>
43+
);
44+
}
45+
2046
return (
2147
<div className="flex flex-col gap-4">
2248
{(breadcrumbs) && (
23-
<div className="border-b py-2">
49+
<div className="pt-2">
2450
{breadcrumbs ? (
2551
<Breadcrumb>
2652
<BreadcrumbList>
@@ -41,7 +67,7 @@ export default function PageLayout({ children, breadcrumbs }: PageLayoutProps) {
4167
) : null}
4268
</div>
4369
)}
44-
{children}
70+
{children}
4571
</div>
4672
);
4773
}

apps/framework-editor/app/components/Providers.tsx

Lines changed: 0 additions & 14 deletions
This file was deleted.

apps/framework-editor/app/layout.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import type { Metadata } from 'next'
2-
import { MenuTabs } from './components/MenuTabs'
3-
import Toolbar from './components/Toolbar'
41
import { Toaster } from '@comp/ui/toaster';
5-
import { NuqsAdapter } from 'nuqs/adapters/next/app'
6-
import { type ReactNode } from 'react'
2+
import type { Metadata } from 'next';
3+
import { type ReactNode } from 'react';
4+
import { MenuTabs } from './components/MenuTabs';
5+
import { NuqsAdapter } from 'nuqs/adapters/next/app';
6+
import Toolbar from './components/Toolbar';
77

88
import "@comp/ui/globals.css";
9-
import '../styles/globals.css'
10-
import { Providers } from './components/Providers';
9+
import '../styles/globals.css';
1110

1211
export const metadata: Metadata = {
1312
title: 'Comp AI - Framework Editor',
@@ -22,14 +21,14 @@ export default function RootLayout({
2221
return (
2322
<html lang="en" className="h-full">
2423
<body>
25-
<Providers>
24+
<NuqsAdapter>
2625
<div className="flex flex-col container gap-2 h-full">
2726
<Toolbar/>
2827
<MenuTabs />
2928
{children}
3029
<Toaster />
31-
</div>
32-
</Providers>
30+
</div>
31+
</NuqsAdapter>
3332
</body>
3433
</html>
3534
)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Skeleton } from "@comp/ui/skeleton";
2+
import PageLayout from "./components/PageLayout";
3+
4+
export default function Loading() {
5+
return (
6+
<PageLayout isLoading>
7+
{null}
8+
</PageLayout>
9+
);
10+
}

apps/framework-editor/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@radix-ui/react-toggle-group": "1.1.1",
4141
"@radix-ui/react-tooltip": "1.1.6",
4242
"@tanstack/react-virtual": "^3.13.8",
43-
"autoprefixer": "^10.4.20",
43+
"autoprefixer": "^10.4.21",
4444
"class-variance-authority": "^0.7.1",
4545
"clsx": "^2.1.1",
4646
"cmdk": "1.0.4",
@@ -73,7 +73,7 @@
7373
"@types/react": "^19",
7474
"@types/react-dom": "^19",
7575
"postcss": "^8.5.3",
76-
"tailwindcss": "^3.4.17",
76+
"tailwindcss": "3",
7777
"typescript": "^5"
7878
}
7979
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}

apps/framework-editor/postcss.config.mjs

Lines changed: 0 additions & 3 deletions
This file was deleted.

apps/framework-editor/styles/globals.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
@tailwind components;
33
@tailwind utilities;
44

5-
65
@layer base {
76
* {
87
@apply border-border;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import baseConfig from "@comp/ui/tailwind.config";
2+
3+
/** @type {import('tailwindcss').Config} */
4+
export default {
5+
content: [
6+
"./app/**/*.{ts,tsx}",
7+
"../../packages/ui/src/**/*.{ts,tsx}",
8+
"../../packages/invoice/src/**/*.{ts,tsx}",
9+
],
10+
presets: [baseConfig],
11+
}

0 commit comments

Comments
 (0)