refactor: Fix formatting using prettier

This commit is contained in:
Bart van der Braak 2023-06-08 09:23:26 +02:00
parent 51f25bdc08
commit 8a5ca63a7b
27 changed files with 406 additions and 206 deletions

View file

@ -1,7 +1,14 @@
import { Logo } from "@/components/logo";
import { Button } from "@/components/ui/button";
import { ScrollArea } from "@/components/ui/scroll-area";
import { BarChart, Database, FileKey, Filter, FormInput, Home } from "lucide-react";
import {
BarChart,
Database,
FileKey,
Filter,
FormInput,
Home,
} from "lucide-react";
import { ChannelLink } from "./channelLink";
import { TeamSwitcher } from "./TeamSwitcher";
import Link from "next/link";
@ -29,38 +36,64 @@ export const DesktopSidebar: React.FC<Props> = ({ navigation, channels }) => {
</Link>
<div className="space-y-4">
<div className="px-6 py-2">
<h2 className="px-2 mb-2 text-lg font-semibold tracking-tight">{/* Events */}</h2>
<h2 className="px-2 mb-2 text-lg font-semibold tracking-tight">
{/* Events */}
</h2>
<div className="space-y-1">
<Link href="/overview">
<Button variant="ghost" size="sm" className="justify-start w-full">
<Button
variant="ghost"
size="sm"
className="justify-start w-full"
>
<Home className="w-4 h-4 mr-2" />
Overview
</Button>
</Link>
<Link href="/keys">
<Button variant="ghost" size="sm" className="justify-start w-full">
<Button
variant="ghost"
size="sm"
className="justify-start w-full"
>
<FileKey className="w-4 h-4 mr-2" />
API Keys
</Button>
</Link>
<Link href="/channels">
<Button variant="ghost" size="sm" className="justify-start w-full">
<Button
variant="ghost"
size="sm"
className="justify-start w-full"
>
<Database className="w-4 h-4 mr-2" />
Channels
</Button>
</Link>
<Button variant="ghost" disabled size="sm" className="justify-start w-full">
<Button
variant="ghost"
disabled
size="sm"
className="justify-start w-full"
>
<Filter className="w-4 h-4 mr-2" />
Filter
</Button>
<Button variant="ghost" disabled size="sm" className="justify-start w-full">
<Button
variant="ghost"
disabled
size="sm"
className="justify-start w-full"
>
<BarChart className="w-4 h-4 mr-2" />
Analytics
</Button>
</div>
</div>
<div className="py-2">
<h2 className="relative px-8 text-lg font-semibold tracking-tight">Channels</h2>
<h2 className="relative px-8 text-lg font-semibold tracking-tight">
Channels
</h2>
<ScrollArea className="h-[230px] px-4">
<div className="p-2 space-y-1">
{channels

View file

@ -49,38 +49,64 @@ export const MobileSidebar: React.FC<Props> = ({ channels }) => {
</SheetHeader>
<div className="space-y-4">
<div className="px-6 py-2">
<h2 className="px-2 mb-2 text-lg font-semibold tracking-tight">{/* Events */}</h2>
<h2 className="px-2 mb-2 text-lg font-semibold tracking-tight">
{/* Events */}
</h2>
<div className="space-y-1">
<Link href="/overview">
<Button variant="ghost" size="sm" className="justify-start w-full">
<Button
variant="ghost"
size="sm"
className="justify-start w-full"
>
<Home className="w-4 h-4 mr-2" />
Overview
</Button>
</Link>
<Link href="/keys">
<Button variant="ghost" size="sm" className="justify-start w-full">
<Button
variant="ghost"
size="sm"
className="justify-start w-full"
>
<FileKey className="w-4 h-4 mr-2" />
API Keys
</Button>
</Link>
<Link href="/channels">
<Button variant="ghost" size="sm" className="justify-start w-full">
<Button
variant="ghost"
size="sm"
className="justify-start w-full"
>
<Database className="w-4 h-4 mr-2" />
Channels
</Button>
</Link>
<Button variant="ghost" disabled size="sm" className="justify-start w-full">
<Button
variant="ghost"
disabled
size="sm"
className="justify-start w-full"
>
<Filter className="w-4 h-4 mr-2" />
Filter
</Button>
<Button variant="ghost" disabled size="sm" className="justify-start w-full">
<Button
variant="ghost"
disabled
size="sm"
className="justify-start w-full"
>
<BarChart className="w-4 h-4 mr-2" />
Analytics
</Button>
</div>
</div>
<div className="py-2">
<h2 className="relative px-8 text-lg font-semibold tracking-tight">Events</h2>
<h2 className="relative px-8 text-lg font-semibold tracking-tight">
Events
</h2>
<ScrollArea className="h-[230px] px-4">
<div className="p-2 space-y-1">
{channels.map((channel) => (

View file

@ -12,7 +12,12 @@ import { useRouter } from "next/navigation";
import { useState } from "react";
import { Loading } from "@/components/loading";
import { useAuth, useOrganization, useOrganizationList, useUser } from "@clerk/clerk-react";
import {
useAuth,
useOrganization,
useOrganizationList,
useUser,
} from "@clerk/clerk-react";
import { Avatar, AvatarImage } from "@/components/ui/avatar";
import { AvatarFallback } from "@radix-ui/react-avatar";
@ -51,10 +56,15 @@ export const TeamSwitcher: React.FC<Props> = (): JSX.Element => {
<div className="flex items-center justify-start w-full gap-4 ">
<Avatar>
{user?.profileImageUrl ? (
<AvatarImage src={user.profileImageUrl} alt={user.username ?? "Profile picture"} />
<AvatarImage
src={user.profileImageUrl}
alt={user.username ?? "Profile picture"}
/>
) : null}
<AvatarFallback className="flex items-center justify-center w-8 h-8 overflow-hidden border rounded-md bg-zinc-100 border-zinc-500 text-zinc-700">
{(currentOrg?.slug ?? user?.username ?? "").slice(0, 2).toUpperCase() ?? "P"}
{(currentOrg?.slug ?? user?.username ?? "")
.slice(0, 2)
.toUpperCase() ?? "P"}
</AvatarFallback>
</Avatar>
<span>{currentOrg?.name ?? "Personal"}</span>

View file

@ -1,20 +1,17 @@
import { cn } from "@/lib/utils";
export default async function Page(_props: {
params: { tenantSlug: string };
}) {
export default async function Page(_props: { params: { tenantSlug: string } }) {
const stats: {
label: string;
value: string;
}[] = [
{
label: "Total Channels",
value: '0',
value: "0",
},
{
label: "Total Events (7 days)",
value: '0',
value: "0",
},
];
return (
@ -47,7 +44,7 @@ export default async function Page(_props: {
"lg:grid-cols-2": stats.length === 2,
"lg:grid-cols-3": stats.length === 3,
"lg:grid-cols-4": stats.length >= 4,
},
}
)}
>
{" "}
@ -55,11 +52,17 @@ export default async function Page(_props: {
<div
key={stat.label}
className={cn(
statIdx % 2 === 1 ? "sm:border-l" : statIdx === 2 ? "lg:border-l" : "",
"flex items-baseline flex-wrap justify-between gap-y-2 gap-x-4 border-t border-zinc-100/5 px-4 py-10 sm:px-6 lg:border-t-0 xl:px-8",
statIdx % 2 === 1
? "sm:border-l"
: statIdx === 2
? "lg:border-l"
: "",
"flex items-baseline flex-wrap justify-between gap-y-2 gap-x-4 border-t border-zinc-100/5 px-4 py-10 sm:px-6 lg:border-t-0 xl:px-8"
)}
>
<dt className="text-sm font-medium leading-6 text-zinc-500">{stat.label}</dt>
<dt className="text-sm font-medium leading-6 text-zinc-500">
{stat.label}
</dt>
{/* <dd
className={cn(
stat.changeType === 'negative' ? 'text-rose-600' : 'text-zinc-700',
@ -96,9 +99,7 @@ export default async function Page(_props: {
<th>More details</th>
</tr>
</thead>
<tbody>
</tbody>
<tbody></tbody>
</table>
</div>
</div>

View file

@ -1,11 +1,12 @@
import { Particles } from "@/components/landing/particles";
import { ClerkProvider, SignIn, SignedIn, SignedOut } from "@clerk/nextjs/app-beta";
import {
ClerkProvider,
SignIn,
SignedIn,
SignedOut,
} from "@clerk/nextjs/app-beta";
export default function AppLayout({
children,
}: {
children: React.ReactNode;
}) {
export default function AppLayout({ children }: { children: React.ReactNode }) {
return (
<ClerkProvider>
<SignedIn>{children}</SignedIn>

View file

@ -42,7 +42,11 @@ export default function DefaultLayout({
className="text-gray-500 hover:text-gray-400"
>
<span className="sr-only">Github</span>
<svg className="w-6 h-6" fill="currentColor" viewBox="0 0 24 24">
<svg
className="w-6 h-6"
fill="currentColor"
viewBox="0 0 24 24"
>
<path
fillRule="evenodd"
d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"

View file

@ -1,4 +1,4 @@
import { Inter } from 'next/font/google';
import { Inter } from "next/font/google";
import LocalFont from "next/font/local";
import { ThemeProvider } from "@/components/theme-provider";
@ -13,7 +13,7 @@ export const metadata: Metadata = {
template: "%s | Omnidash",
},
description: "Open Source Multi-client Ticket Dashboard",
metadataBase: new URL('https://omnidash.io'),
metadataBase: new URL("https://omnidash.io"),
openGraph: {
title: "Omnidash",
description: "Open Source Multi-client Ticket Dashboard",