Skip to content

Commit

Permalink
Refactor panel components for better UI alignment and design.
Browse files Browse the repository at this point in the history
Moved `ReferencesPanel` and `ContributorsPanel` out of fixed position in `MpoxPage` and included fixed styling directly into components. Also changes the UI to look more akin to page tabs than button.
  • Loading branch information
joshbaskaran committed Aug 16, 2024
1 parent 1026528 commit e11cd24
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
8 changes: 2 additions & 6 deletions src/app/topics/mpox/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,8 @@ const references: Reference[] = [
export default function MpoxPage() {
return (
<div className="relative min-h-screen">
<div className="fixed right-12 top-32 z-10">
<div className="flex flex-col space-y-2">
<ReferencesPanel references={references} className="py-2" />
<ContributorsPanel contributors={["terje"]} />
</div>
</div>
<ReferencesPanel references={references} />
<ContributorsPanel contributors={["terje"]} />
<section className="flex flex-col space-y-6 p-2">
<h1 className="text-3xl font-bold">Overview</h1>
<p className="text-justify">
Expand Down
5 changes: 2 additions & 3 deletions src/components/contributors-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet";
import { Button } from "@/components/ui/button";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";

interface Contributor {
Expand Down Expand Up @@ -68,8 +67,8 @@ export default function ContributorsPanel({
}) {
return (
<Sheet>
<SheetTrigger asChild>
<Button variant="outline">Contributors</Button>
<SheetTrigger className="fixed right-[-42px] top-80 z-10 flex h-[60px] w-[120px] -rotate-90 justify-center rounded-t-2xl bg-primary px-4 py-1 text-lg font-semibold text-primary-foreground shadow-md transition-all duration-200 hover:right-[-30px]">
Contributors
</SheetTrigger>
<SheetContent>
<SheetHeader>
Expand Down
12 changes: 3 additions & 9 deletions src/components/references-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import {
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet";
import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";

export interface Reference {
referenceNumber: number;
Expand All @@ -18,17 +16,13 @@ export interface Reference {

interface ReferencesPanelProps {
references: Reference[];
className?: string;
}

export default function ReferencesPanel({
references,
className,
}: ReferencesPanelProps) {
export default function ReferencesPanel({ references }: ReferencesPanelProps) {
return (
<Sheet>
<SheetTrigger asChild className={cn(className)}>
<Button variant="outline">References</Button>
<SheetTrigger className="fixed right-[-42px] top-44 z-10 flex h-[60px] w-[120px] -rotate-90 justify-center rounded-t-2xl bg-primary px-3 py-1 text-lg font-semibold text-primary-foreground shadow-md transition-all duration-200 hover:right-[-30px]">
References
</SheetTrigger>
<SheetContent>
<SheetHeader>
Expand Down

0 comments on commit e11cd24

Please sign in to comment.