Skip to content

Commit

Permalink
feat: added issue reporting and source code links
Browse files Browse the repository at this point in the history
  • Loading branch information
cecilia-sanare committed Jan 26, 2024
1 parent d8b3678 commit 7e78019
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
19 changes: 16 additions & 3 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Database, ListTodo, LucideIcon } from 'lucide-react';
import { Bug, Code, Database, ExternalLink, ListTodo, LucideIcon } from 'lucide-react';
import type { ReactNode } from 'react';
import { Link } from 'react-router-dom';
import { Button } from './ui/button';
Expand All @@ -21,6 +21,16 @@ const additionalItems: Header.Item[] = [
label: 'View Data',
icon: Database,
},
{
href: 'https://github.com/rain-cafe/devkit.lgbt/issues',
label: 'Report an Issue',
icon: Bug,
},
{
href: 'https://github.com/rain-cafe/devkit.lgbt',
label: 'Source Code',
icon: Code,
},
];

export function Header({ children }: HeaderProps) {
Expand All @@ -46,11 +56,14 @@ export function Header({ children }: HeaderProps) {
})}
<div className="flex-1" />
{additionalItems.map((item, index) => {
const isExternal = item.href.startsWith('https');

return (
<Button key={index} className="flex gap-2 justify-start" size="sm" asChild variant="ghost">
<Link to={item.href}>
<Link to={item.href} target={isExternal ? '_blank' : undefined}>
<item.icon />
{item.label}
<div className="flex-1">{item.label}</div>
{isExternal && <ExternalLink />}
</Link>
</Button>
);
Expand Down
6 changes: 4 additions & 2 deletions src/routes/ErrorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ export function ErrorPage() {

return (
<div id="error-page" className="flex flex-col items-center pt-20">
<Card>
<Card className="sm:max-w-2xl">
<CardHeader>
<CardTitle>Oops!</CardTitle>
</CardHeader>
<CardContent className="flex flex-col gap-2">
<p>Sorry, an unexpected error has occurred.</p>
<code className="flex p-2 rounded-md bg-secondary/50 w-full italic">{error.statusText || error.message}</code>
<code className="flex p-2 rounded-md bg-secondary/50 text-pink-400 w-full italic">
{error.statusText || error.message}
</code>
</CardContent>
<CardFooter>
<Button className="w-full" asChild variant="secondary">
Expand Down

0 comments on commit 7e78019

Please sign in to comment.