Skip to content

Commit

Permalink
Add report bug link & alert UI improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
pheralb committed Mar 30, 2024
1 parent ba1d891 commit d3d8a76
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
8 changes: 7 additions & 1 deletion src/components/commandK/items.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
BugIcon,
HeartHandshakeIcon,
HomeIcon,
LayoutDashboardIcon,
Expand Down Expand Up @@ -26,7 +27,7 @@ export const Pages = [
name: "Settings",
href: "/dashboard/settings",
icon: SettingsIcon,
},
}
];

export const ChangeTheme = [
Expand Down Expand Up @@ -63,6 +64,11 @@ export const DocumentationPages = [
href: "https://github.com/pheralb/slug?tab=readme-ov-file#%EF%B8%8F-contributing",
icon: HeartHandshakeIcon,
},
{
name: "Report a Bug",
href: "https://github.com/pheralb/slug/issues/new/choose",
icon: BugIcon,
}
];

export const SocialPages = [
Expand Down
23 changes: 15 additions & 8 deletions src/ui/alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface AlertProps {
children: ReactNode;
className?: string;
containerClassName?: string;
icon?: ReactNode;
iconSize?: number;
}

Expand All @@ -16,26 +17,32 @@ const Alert = (props: AlertProps) => {
<div
className={cn(
"w-full rounded-md p-3 text-sm",
props.variant === "error" && "dark:text-red-200 dark:bg-red-900/20",
props.variant === "success" && "dark:text-green-200 dark:bg-green-900/20",
props.variant === "warning" && "dark:text-yellow-200 dark:bg-yellow-900/20",
props.variant === "info" && "text-blue-900 dark:text-blue-200 bg-blue-700/20 dark:bg-blue-900/20",
props.variant === "error" && "dark:bg-red-900/20 dark:text-red-200",
props.variant === "success" &&
"dark:bg-green-900/20 dark:text-green-200",
props.variant === "warning" &&
"dark:bg-yellow-900/20 dark:text-yellow-200",
props.variant === "info" &&
"bg-blue-700/20 text-blue-900 dark:bg-blue-900/20 dark:text-blue-200",
props.className,
)}
>
<div
className={cn("flex items-center space-x-2", props.containerClassName)}
>
{props.variant === "error" && (
{props.variant === "error" && !props.icon && (
<XCircleIcon size={20 || props.iconSize} />
)}
{props.variant === "success" && (
{props.variant === "success" && !props.icon && (
<CheckCircle size={20 || props.iconSize} />
)}
{props.variant === "warning" && (
{props.variant === "warning" && !props.icon && (
<AlertCircle size={20 || props.iconSize} />
)}
{props.variant === "info" && <InfoIcon size={20 || props.iconSize} />}
{props.icon}
{props.variant === "info" && !props.icon && (
<InfoIcon size={20 || props.iconSize} />
)}
<span>{props.children}</span>
</div>
</div>
Expand Down

0 comments on commit d3d8a76

Please sign in to comment.