Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add settings page UI #22

Merged
merged 8 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules
.pnp
.pnp.js


# Local env files
.env
.env.local
Expand Down
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
public-hoist-pattern[]=*
125 changes: 125 additions & 0 deletions apps/app/app/(routes)/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
"use client";
import { IconCoins, IconInfoSquareRounded } from "@tabler/icons-react";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";

export default function Home() {
return (
<div className="flex flex-col h-full w-full items-start overflow-hidden px-5 md:px-2">
<Tabs defaultValue="overview" className="space-y-5">
<TabsList>
<TabsTrigger value="overview">Overview</TabsTrigger>
<TabsTrigger value="analytics">Analytics</TabsTrigger>
<TabsTrigger value="reports">Reports</TabsTrigger>
<TabsTrigger value="notifications">Notifications</TabsTrigger>
</TabsList>
Comment on lines +9 to +15
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Implement missing tab content sections.

The component includes tab triggers for "Analytics", "Reports", and "Notifications" but lacks their corresponding TabsContent implementations. This creates a confusing user experience when users click these tabs.

Consider either:

  1. Implementing the missing tab contents, or
  2. Removing/disabling the unused tabs until their content is ready

Example implementation structure:

<TabsContent value="analytics">
  {/* Analytics content */}
</TabsContent>
<TabsContent value="reports">
  {/* Reports content */}
</TabsContent>
<TabsContent value="notifications">
  {/* Notifications content */}
</TabsContent>

<TabsContent value="overview" className="space-y-4">
<div className="grid gap-4 md:grid-cols-3 lg:grid-cols-5">
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">
Queries Resolved
</CardTitle>
<IconInfoSquareRounded className="size-5 text-muted-foreground" />
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">45,321</div>
<p className="text-xs text-muted-foreground">
+20.1% from last month
</p>
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">Mails</CardTitle>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
className="h-4 w-4 text-muted-foreground"
>
<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" />
<circle cx="9" cy="7" r="4" />
<path d="M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75" />
</svg>
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">+2350</div>
<p className="text-xs text-muted-foreground">
+180.1% from last month
</p>
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">Sales</CardTitle>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
className="h-4 w-4 text-muted-foreground"
>
<rect width="20" height="14" x="2" y="5" rx="2" />
<path d="M2 10h20" />
</svg>
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">+12,234</div>
<p className="text-xs text-muted-foreground">
+19% from last month
</p>
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">
Events Logged
</CardTitle>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
className="h-4 w-4 text-muted-foreground"
>
<path d="M22 12h-4l-3 9L9 3l-3 9H2" />
</svg>
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">+573</div>
<p className="text-xs text-muted-foreground">
+201 since last hour
</p>
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">
Credits Left
</CardTitle>
<IconCoins className="size-5 text-muted-foreground" />
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">2346</div>
<p className="text-xs text-muted-foreground">
+201 since last hour
</p>
</CardContent>
</Card>
</div>
</TabsContent>
</Tabs>
</div>
);
}
17 changes: 17 additions & 0 deletions apps/app/app/(routes)/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use client";
import InfoBreadCrumb from "@/components/custom/infobar/bread-crumb";
import BillingSettings from "@/components/custom/settings/billing.settings";
import ThemeSettings from "@/components/custom/settings/theme.settings";
import React from "react";

export default function SettingsPage() {
return (
<div className="flex flex-col h-full w-full items-start overflow-hidden px-5 md:px-2">
<InfoBreadCrumb />
<div className="flex flex-col gap-10">
<BillingSettings />
<ThemeSettings />
</div>
</div>
);
}
Binary file removed apps/app/app/fonts/GeistMonoVF.woff
Binary file not shown.
Binary file removed apps/app/app/fonts/GeistVF.woff
Binary file not shown.
124 changes: 113 additions & 11 deletions apps/app/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,122 @@
@tailwind components;
@tailwind utilities;

:root {
--background: #ffffff;
--foreground: #171717;
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 240 10% 3.9%;
--card: 0 0% 100%;
--card-foreground: 240 10% 3.9%;
--popover: 0 0% 100%;
--popover-foreground: 240 10% 3.9%;
--primary: 240 5.9% 10%;
--primary-foreground: 0 0% 98%;
--secondary: 240 4.8% 95.9%;
--secondary-foreground: 240 5.9% 10%;
--muted: 240 4.8% 95.9%;
--muted-foreground: 240 3.8% 46.1%;
--accent: 240 4.8% 95.9%;
--accent-foreground: 240 5.9% 10%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 0 0% 98%;
--border: 240 5.9% 90%;
--input: 240 5.9% 90%;
--ring: 240 10% 3.9%;
--radius: 0.5rem;

--progress-background: hsl(var(--primary));
--progress-foreground: hsl(var(--primary-foreground));

--chart-1: 12 76% 61%;
--chart-2: 173 58% 39%;
--chart-3: 197 37% 24%;
--chart-4: 43 74% 66%;
--chart-5: 27 87% 67%;

--sidebar-background: 0 0% 98%;
--sidebar-foreground: 240 5.3% 26.1%;
--sidebar-primary: 240 5.9% 10%;
--sidebar-primary-foreground: 0 0% 98%;
--sidebar-accent: 240 4.8% 95.9%;
--sidebar-accent-foreground: 240 5.9% 10%;
--sidebar-border: 220 13% 91%;
--sidebar-ring: 217.2 91.2% 59.8%;
--color-1: 0 100% 63%;
--color-2: 270 100% 63%;
--color-3: 210 100% 63%;
--color-4: 195 100% 63%;
--color-5: 90 100% 63%;
}

.dark {
--background: 0, 0%, 9.8%;
--foreground: 0 0% 98%;
--card: 0, 0%, 14.5%;
--card-foreground: 0 0% 98%;
--popover: 0, 0%, 14.5%;
--popover-foreground: 0 0% 98%;
--primary: 0 0% 98%;
--primary-foreground: 240 5.9% 10%;
--secondary: 0, 0%, 19.2%;
--secondary-foreground: 0 0% 98%;
--muted: 0, 0%, 19.2%;
--muted-foreground: 240 5% 64.9%;
--accent: 0, 0%, 19.2%;
--accent-foreground: 0 0% 98%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 0 0% 98%;
--border: 0, 0%, 19.2%;
--input: 0, 0%, 19.2%;
--ring: 240 4.9% 83.9%;

--chart-1: 220 70% 50%;
--chart-2: 160 60% 45%;
--chart-3: 30 80% 55%;
--chart-4: 280 65% 60%;
--chart-5: 340 75% 55%;

--sidebar-background: 0, 0%, 12.5%;
--sidebar-foreground: 240 4.8% 95.9%;
--sidebar-primary: 224.3 76.3% 48%;
--sidebar-primary-foreground: 0 0% 100%;
--sidebar-accent: 0, 0%, 19.2%;
--sidebar-accent-foreground: 240 4.8% 95.9%;
--sidebar-border: 0, 0%, 19.2%;
--sidebar-ring: 217.2 91.2% 59.8%;
--color-1: 0 100% 63%;
--color-2: 270 100% 63%;
--color-3: 210 100% 63%;
--color-4: 195 100% 63%;
--color-5: 90 100% 63%;
}
SkidGod4444 marked this conversation as resolved.
Show resolved Hide resolved
}

@media (prefers-color-scheme: dark) {
:root {
--background: #0a0a0a;
--foreground: #ededed;
@layer base {
/* * {
@apply border-border;
} */
html {
@apply scroll-smooth;
}
body {
@apply bg-background text-foreground;
/* font-feature-settings: "rlig" 1, "calt" 1; */
font-synthesis-weight: none;
text-rendering: optimizeLegibility;
}
}

body {
color: var(--foreground);
background: var(--background);
font-family: Arial, Helvetica, sans-serif;
@media (max-width: 640px) {
.container {
@apply px-4;
}
}

@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
}
SkidGod4444 marked this conversation as resolved.
Show resolved Hide resolved
48 changes: 31 additions & 17 deletions apps/app/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,49 @@
import type { Metadata } from "next";
import localFont from "next/font/local";
import { GeistSans } from "geist/font/sans";
import "./globals.css";

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans",
weight: "100 900",
});
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono",
weight: "100 900",
});
import { ThemeProvider } from "@/hooks/theme-provider";
import { SidebarProvider } from "@/components/ui/sidebar";
import { AppSidebar } from "@/components/custom/sidebar/sidebar";
import { cookies } from "next/headers";
import Infobar from "@/components/custom/infobar/infobar";
import ProgressBar from "@/components/custom/progress.bar";

export const metadata: Metadata = {
title: "Create Next App",
title: "Plura",
description: "Generated by create next app",
};

export default function RootLayout({
async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const cookieStore = await cookies();
const defaultOpen = cookieStore.get("plura-sidebar:state")?.value === "true";

SkidGod4444 marked this conversation as resolved.
Show resolved Hide resolved
return (
<html lang="en">
<html lang="en" suppressHydrationWarning>
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
className={`min-h-screen bg-background font-sans ${GeistSans.variable} antialiased`}
>
{children}
<ThemeProvider
attribute="class"
defaultTheme="dark"
enableSystem
disableTransitionOnChange
>
<SidebarProvider defaultOpen={defaultOpen}>
<AppSidebar />
<div className="p-2">
<ProgressBar />
<Infobar />
{children}
</div>
</SidebarProvider>
</ThemeProvider>
</body>
</html>
);
}

export default RootLayout;
Loading
Loading