Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Anchel123 committed Jan 8, 2025
1 parent 048ebdc commit 0046672
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
5 changes: 2 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

import "./globals.css";
import { Inter } from "next/font/google";
import { Toaster } from "@/components/ui/toaster";
import { Metadata } from "next";
import { Toaster } from "@/components/ui/toaster";
import NextAuthProvider from "./providers";
import GTM from "./GTM";
import { cn } from "@/lib/utils";

const inter = Inter({ subsets: ["latin"] });

Expand All @@ -25,7 +24,7 @@ export default function RootLayout({
// caused by mismatched client/server content caused by next-themes
return (
<html className="w-screen h-screen" lang="en" suppressHydrationWarning>
<body className={cn("h-full LandingPage", inter.className)}>
<body className={`h-full LandingPage ${inter.className}`}>
<GTM />
<NextAuthProvider>{children}</NextAuthProvider>
<Toaster />
Expand Down
11 changes: 4 additions & 7 deletions app/schema/SchemaDataPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

"use client";

import { Check, ChevronRight, MinusCircle, Pencil, PlusCircle, Trash2, X } from "lucide-react";
import { Check, ChevronRight, Pencil, PlusCircle, Trash2, X } from "lucide-react";
import { useEffect, useState } from "react";
import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
import { Checkbox } from "@/components/ui/checkbox";
Expand Down Expand Up @@ -33,8 +33,6 @@ export default function SchemaDataPanel({ obj, onExpand, onSetAttributes, onRemo
const [isAddValue, setIsAddValue] = useState<boolean>(false)
const { toast } = useToast()

console.log(editable);

useEffect(() => {
setAttributes(Object.entries(obj.data).filter(([key, val]) => !(key === "name" && Number(val) === obj.id)).map(([key, val]) => [key, Array.isArray(val) ? val : (val as string).split(',')]))
setLabel("source" in obj ? obj.label : obj.category)
Expand All @@ -46,7 +44,6 @@ export default function SchemaDataPanel({ obj, onExpand, onSetAttributes, onRemo
}

setAttribute([key, val])
debugger
setEditable(key)
}

Expand All @@ -65,7 +62,7 @@ export default function SchemaDataPanel({ obj, onExpand, onSetAttributes, onRemo
const oldAttribute = attributes.find(([key]) => key === newAttribute[0])

if (ok) {
setAttributes(prev => prev.map((att) => att[0] === newAttribute[0] ? newAttribute : att))
setAttributes(prev => prev.map((attr) => attr[0] === newAttribute[0] ? newAttribute : attr))
handleSetEditable()
toast({
title: "Success",
Expand All @@ -80,12 +77,12 @@ export default function SchemaDataPanel({ obj, onExpand, onSetAttributes, onRemo
const ok = await onRemoveAttribute(key)

if (ok) {
const attribute = attributes.find(([k]) => k === key)
const att = attributes.find(([k]) => k === key)
setAttributes(prev => prev.filter(([k]) => k !== key))
toast({
title: "Success",
description: "Attribute removed",
action: attribute && <ToastButton onClick={() => handleAddAttribute(attribute)} />,
action: att && <ToastButton onClick={() => handleAddAttribute(att)} />,
})
setAttribute(getDefaultAttribute())
}
Expand Down
1 change: 0 additions & 1 deletion app/schema/SchemaView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import Labels from "../graph/labels"
import { Category, Graph, Link, Node, GraphData } from "../api/graph/model"
import Button from "../components/ui/Button"
import CreateElement from "./SchemaCreateElement"
import ToastButton from "../components/ToastButton"

const ForceGraph = dynamic(() => import("../components/ForceGraph"), { ssr: false })

Expand Down

0 comments on commit 0046672

Please sign in to comment.