-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #828 from Health-Informatics-UoN/feat/826/layout-s…
…plitting Organise layouts of Carrot
- Loading branch information
Showing
37 changed files
with
254 additions
and
87 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import "../globals.css"; | ||
import "../custom.css"; | ||
import "react-tooltip/dist/react-tooltip.css"; | ||
import { Sidebar } from "../../components/core/sidebar"; | ||
import React from "react"; | ||
import { getCurrentUser } from "../../api/users"; | ||
|
||
export default async function ProtectedLayout({ | ||
children, | ||
}: Readonly<{ | ||
children: React.ReactNode; | ||
}>) { | ||
const user = await getCurrentUser(); | ||
|
||
return ( | ||
<> | ||
<Sidebar userName={user.username} /> | ||
<section className="px-10 my-6">{children}</section> | ||
</> | ||
); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...pp/scanreports/[id]/review_rules/page.tsx → ...d)/scanreports/[id]/review_rules/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import "../globals.css"; | ||
import "../custom.css"; | ||
import React from "react"; | ||
import { getCurrentUser } from "../../api/users"; | ||
import { MenuBar } from "@/components/core/menubar"; | ||
|
||
export default async function PublicLayout({ | ||
children, | ||
}: Readonly<{ | ||
children: React.ReactNode; | ||
}>) { | ||
const user = await getCurrentUser(); | ||
return ( | ||
<> | ||
<MenuBar userName={user.username} /> | ||
<section>{children}</section> | ||
</> | ||
); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import Link from "next/link"; | ||
import Image from "next/image"; | ||
import { ReceiptText, ShieldQuestion } from "lucide-react"; | ||
|
||
const Footer = () => { | ||
return ( | ||
<div className="sm:flex grid grid-cols-2 items-center justify-between w-full px-5 py-3"> | ||
<div className="relative w-[250px] h-[100px] "> | ||
<Image src="/logos/UoN.jpg" alt="Logo UoN" fill /> | ||
</div> | ||
<div className="relative w-[125px] h-[125px] "> | ||
<Image src="/logos/coconnect1.png" alt="Logo CCN" fill /> | ||
</div> | ||
<div className="relative w-[250px] h-[100px] "> | ||
<Image src="/logos/UKRI.png" alt="Logo UKRI" fill /> | ||
</div> | ||
<div className="relative w-[250px] h-[100px] "> | ||
<Image src="/logos/alleviate.jpeg" alt="Logo ALVE" fill /> | ||
</div> | ||
<div className="flex flex-col justify-end"> | ||
<p className="font-bold">Links</p> | ||
<ul> | ||
<li> | ||
<Link href="#" className="flex items-center"> | ||
<ShieldQuestion size={15} className="mr-1" /> Privacy Policy | ||
</Link> | ||
</li> | ||
|
||
<li> | ||
<Link href="#" className="flex items-center"> | ||
<ReceiptText size={15} className="mr-1" /> Terms and Conditions | ||
</Link> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Footer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { | ||
BookMarked, | ||
FileScan, | ||
Folders, | ||
Github, | ||
Home, | ||
LogIn, | ||
LucideIcon, | ||
Upload, | ||
} from "lucide-react"; | ||
|
||
export interface SidebarItems { | ||
links: Array<{ | ||
label: string; | ||
href: string; | ||
icon?: LucideIcon; | ||
}>; | ||
routes: Array<{ | ||
label: string; | ||
href: string; | ||
icon?: LucideIcon; | ||
}>; | ||
} | ||
|
||
export const sidebarItems: SidebarItems = { | ||
links: [ | ||
{ label: "Datasets", href: "/datasets/", icon: Folders }, | ||
{ label: "Scan Reports", href: "/scanreports/", icon: FileScan }, | ||
{ | ||
label: "Upload Scan Report", | ||
href: "/scanreports/create/", | ||
icon: Upload, | ||
}, | ||
{ | ||
href: "https://carrot4omop.ac.uk", | ||
icon: BookMarked, | ||
label: "Documentation", | ||
}, | ||
], | ||
routes: [ | ||
{ | ||
label: "Documentation", | ||
href: "https://carrot4omop.ac.uk", | ||
icon: BookMarked, | ||
}, | ||
{ | ||
label: "GitHub", | ||
href: "https://github.com/Health-Informatics-UoN/Carrot-Mapper", | ||
icon: Github, | ||
}, | ||
{ | ||
label: "Login", | ||
href: "/accounts/login/", | ||
icon: LogIn, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import Link from "next/link"; | ||
import Image from "next/image"; | ||
|
||
import { SidebarButton } from "./sidebar-button"; | ||
import { sidebarItems } from "./menuItems"; | ||
import { Sidebar } from "./sidebar"; | ||
import { ModeToggle } from "./mode-toggle"; | ||
|
||
export const MenuBar = ({ userName }: { userName: string }) => { | ||
return ( | ||
<> | ||
<Sidebar onPublic userName={userName} /> | ||
|
||
<div className="hidden lg:flex lg:items-center sticky top-0 z-50 backdrop-blur justify-between bg-primary pt-4 px-8 pb-3"> | ||
<Link href={"/"}> | ||
<div className="text-2xl flex items-center font-semibold"> | ||
<Image | ||
width={22} | ||
height={22} | ||
src="/carrot-logo.png" | ||
alt="carrot-logo" | ||
className="mx-3" | ||
/> | ||
Carrot | ||
</div> | ||
</Link> | ||
|
||
<div className="flex items-center gap-3"> | ||
<div className="flex"> | ||
{(userName === "Unknown User" | ||
? sidebarItems.routes | ||
: sidebarItems.links | ||
).map((link, idx) => ( | ||
<Link key={idx} href={link.href}> | ||
<SidebarButton icon={link.icon} className="w-full"> | ||
{link.label} | ||
</SidebarButton> | ||
</Link> | ||
))} | ||
</div> | ||
<div> | ||
<ModeToggle /> | ||
</div> | ||
{/* TODO: Need a logout button here */} | ||
</div> | ||
</div> | ||
</> | ||
); | ||
}; |
Oops, something went wrong.