Skip to content

Commit

Permalink
Update typography UI styles + loading /dashboard + fix update name sc…
Browse files Browse the repository at this point in the history
…hema
  • Loading branch information
pheralb committed Mar 24, 2024
1 parent e425805 commit 7a96bc3
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/app/dashboard/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from "react";
import { LoaderIcon } from "lucide-react";

const Loading = () => {
return <div>Loading</div>;
return (
<div className="mt-14 flex flex-col items-center text-neutral-500 dark:text-neutral-400 animate-in fade-in-20 duration-100">
<LoaderIcon size={20} className="animate-spin" />
<p className="mt-2">Loading...</p>
</div>
);
};

export default Loading;
8 changes: 8 additions & 0 deletions src/components/change-theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/ui/dropdown-menu";

Expand All @@ -32,6 +34,12 @@ export function ModeToggle() {
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuLabel className="font-normal">
<p className="text-sm font-medium leading-none">
Theme
</p>
</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuItem
className="flex items-center space-x-3"
onClick={() => setTheme("light")}
Expand Down
4 changes: 3 additions & 1 deletion src/server/schemas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export const getSingleLinkSchema = z.object({
});

export const UpdateProfileSchema = z.object({
name: z.string().min(1, { message: "Name is required." }),
name: z.string().min(1, { message: "Name is required." }).max(40, {
message: "Name must be less than 40 characters.",
}),
username: z.string().optional(),
email: z.string().email({ message: "Invalid email address." }),
});
Expand Down
33 changes: 32 additions & 1 deletion src/ui/typography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,41 @@ export const TypographyP = forwardRef<
return (
<p
ref={ref}
className={cn("leading-7 [&:not(:first-child)]:mt-6", className)}
className={cn(
"text-pretty leading-7 [&:not(:first-child)]:mt-4",
className,
)}
{...props}
/>
);
});

TypographyP.displayName = "TypographyP";

export const TypographyListUl = forwardRef<
HTMLUListElement,
React.ComponentPropsWithoutRef<"ul">
>(({ className, ...props }, ref) => {
return (
<ul
ref={ref}
className={cn("my-6 list-disc [&>li]:mt-2", className)}
{...props}
/>
);
});

TypographyListUl.displayName = "TypographyListUl";

export const TypographyListOl = forwardRef<
HTMLOListElement,
React.ComponentPropsWithoutRef<"ol">
>(({ className, ...props }, ref) => {
return (
<ol
ref={ref}
className={cn("my-6 list-decimal [&>li]:mt-2", className)}
{...props}
/>
);
});

0 comments on commit 7a96bc3

Please sign in to comment.