forked from Cloud-Pipelines/pipeline-editor
-
Notifications
You must be signed in to change notification settings - Fork 5
moves app footer #2010
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
moves app footer #2010
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -6,9 +6,17 @@ import { Badge } from "@/components/ui/badge"; | |
| import { Icon, type IconName } from "@/components/ui/icon"; | ||
| import { BlockStack, InlineStack } from "@/components/ui/layout"; | ||
| import { Link as UILink } from "@/components/ui/link"; | ||
| import { Heading, Text } from "@/components/ui/typography"; | ||
| import { Text } from "@/components/ui/typography"; | ||
| import { cn } from "@/lib/utils"; | ||
| import { DOCUMENTATION_URL } from "@/utils/constants"; | ||
| import { | ||
| ABOUT_URL, | ||
| DOCUMENTATION_URL, | ||
| GIT_COMMIT, | ||
| GIT_REPO_URL, | ||
| GIVE_FEEDBACK_URL, | ||
| PRIVACY_POLICY_URL, | ||
| TOP_NAV_HEIGHT, | ||
| } from "@/utils/constants"; | ||
|
|
||
| interface SidebarItem { | ||
| to: string; | ||
|
|
@@ -17,11 +25,11 @@ interface SidebarItem { | |
| } | ||
|
|
||
| const SIDEBAR_ITEMS: SidebarItem[] = [ | ||
| { to: "/dashboard/runs", label: "Runs", icon: "Play" }, | ||
| { to: "/dashboard/pipelines", label: "Pipelines", icon: "GitBranch" }, | ||
| { to: "/dashboard/components", label: "Components", icon: "Package" }, | ||
| { to: "/dashboard/favorites", label: "Favorites", icon: "Star" }, | ||
| { to: "/dashboard/recently-viewed", label: "Recently Viewed", icon: "Clock" }, | ||
| { to: "/runs", label: "Runs", icon: "Play" }, | ||
| { to: "/pipelines", label: "Pipelines", icon: "GitBranch" }, | ||
| { to: "/components", label: "Components", icon: "Package" }, | ||
| { to: "/favorites", label: "Favorites", icon: "Star" }, | ||
| { to: "/recently-viewed", label: "Recently Viewed", icon: "Clock" }, | ||
| ]; | ||
|
|
||
| const navItemClass = (isActive: boolean) => | ||
|
|
@@ -34,81 +42,113 @@ export function DashboardLayout() { | |
| const requiresAuthorization = isAuthorizationRequired(); | ||
|
|
||
| return ( | ||
| <div className="w-full px-8 py-6"> | ||
| <BlockStack gap="6"> | ||
| <InlineStack gap="2" blockAlign="center"> | ||
| <Heading level={1}>Dashboard</Heading> | ||
| <Badge className="bg-amber-100 text-amber-800 hover:bg-amber-100"> | ||
| Beta | ||
| </Badge> | ||
| </InlineStack> | ||
| <div | ||
| className="flex w-full overflow-hidden" | ||
| style={{ height: `calc(100vh - ${TOP_NAV_HEIGHT}px)` }} | ||
| > | ||
| {/* Sidebar — fixed height, independent scroll */} | ||
| <div className="w-56 shrink-0 border-r border-border flex flex-col overflow-y-auto"> | ||
| {/* Dashboard heading */} | ||
| <div className="px-6 pt-6 pb-4 shrink-0"> | ||
| <InlineStack gap="2" blockAlign="center"> | ||
| <Text size="lg" weight="semibold"> | ||
| Dashboard | ||
| </Text> | ||
| <Badge className="bg-amber-100 text-amber-800 hover:bg-amber-100"> | ||
| Beta | ||
| </Badge> | ||
| </InlineStack> | ||
| </div> | ||
|
|
||
| <InlineStack gap="8" blockAlign="start" className="w-full min-h-100"> | ||
| <BlockStack | ||
| inlineAlign="space-between" | ||
| className="w-48 shrink-0 border-r border-border pr-4 self-stretch" | ||
| > | ||
| {/* Top nav */} | ||
| <BlockStack gap="1"> | ||
| {SIDEBAR_ITEMS.map((item) => ( | ||
| <Link | ||
| key={item.to} | ||
| to={item.to} | ||
| className="w-full" | ||
| activeProps={{ className: "is-active" }} | ||
| <BlockStack gap="1" className="px-3"> | ||
| {SIDEBAR_ITEMS.map((item) => ( | ||
| <Link | ||
| key={item.to} | ||
| to={item.to} | ||
| className="w-full" | ||
| activeProps={{ className: "is-active" }} | ||
| > | ||
| {({ isActive }) => ( | ||
| <InlineStack | ||
| gap="2" | ||
| blockAlign="center" | ||
| className={navItemClass(isActive)} | ||
| > | ||
| {({ isActive }) => ( | ||
| <InlineStack | ||
| gap="2" | ||
| blockAlign="center" | ||
| className={navItemClass(isActive)} | ||
| > | ||
| <Icon name={item.icon} size="sm" /> | ||
| <Text size="sm">{item.label}</Text> | ||
| </InlineStack> | ||
| )} | ||
| </Link> | ||
| ))} | ||
| </BlockStack> | ||
|
|
||
| {/* Bottom utilities */} | ||
| <BlockStack gap="1" className="border-t border-border pt-3"> | ||
| <UILink | ||
| href={DOCUMENTATION_URL} | ||
| external | ||
| variant="block" | ||
| className={navItemClass(false)} | ||
| > | ||
| <InlineStack gap="2" blockAlign="center"> | ||
| <Icon name="CircleQuestionMark" size="sm" /> | ||
| <Text size="sm">Docs</Text> | ||
| <Icon name={item.icon} size="sm" /> | ||
| <Text size="sm">{item.label}</Text> | ||
| </InlineStack> | ||
| </UILink> | ||
| <Link to="/settings/backend" className="w-full"> | ||
| {({ isActive }) => ( | ||
| <InlineStack | ||
| gap="2" | ||
| blockAlign="center" | ||
| className={navItemClass(isActive)} | ||
| > | ||
| <Icon name="Settings" size="sm" /> | ||
| <Text size="sm">Settings</Text> | ||
| </InlineStack> | ||
| )} | ||
| </Link> | ||
| {requiresAuthorization && ( | ||
| <div className="px-3 py-2"> | ||
| <TopBarAuthentication /> | ||
| </div> | ||
| )} | ||
| </BlockStack> | ||
| </BlockStack> | ||
| </Link> | ||
| ))} | ||
| </BlockStack> | ||
|
|
||
| {/* Spacer */} | ||
| <div className="flex-1 min-h-4" /> | ||
|
|
||
| {/* Bottom utilities */} | ||
| <div className="flex flex-col gap-1 px-3 border-t border-border pt-3 pb-3"> | ||
| <UILink | ||
| href={DOCUMENTATION_URL} | ||
| external | ||
| variant="block" | ||
| className={navItemClass(false)} | ||
| > | ||
| <InlineStack gap="2" blockAlign="center"> | ||
| <Icon name="CircleQuestionMark" size="sm" /> | ||
| <Text size="sm">Docs</Text> | ||
| </InlineStack> | ||
| </UILink> | ||
| <Link to="/settings/backend" className="w-full"> | ||
| {({ isActive }) => ( | ||
| <InlineStack | ||
| gap="2" | ||
| blockAlign="center" | ||
| className={navItemClass(isActive)} | ||
| > | ||
| <Icon name="Settings" size="sm" /> | ||
| <Text size="sm">Settings</Text> | ||
| </InlineStack> | ||
| )} | ||
| </Link> | ||
| {requiresAuthorization && ( | ||
| <div className="px-3 py-2"> | ||
| <TopBarAuthentication /> | ||
| </div> | ||
| )} | ||
|
|
||
| {/* Footer links */} | ||
| <div className="flex flex-col gap-0.5 pt-2 mt-1 border-t border-border"> | ||
| {[ | ||
| { label: "About", href: ABOUT_URL }, | ||
| { label: "Give feedback", href: GIVE_FEEDBACK_URL }, | ||
| { label: "Privacy policy", href: PRIVACY_POLICY_URL }, | ||
|
Comment on lines
+122
to
+124
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be a constant outside of the render function |
||
| ].map(({ label, href }) => ( | ||
| <a | ||
| key={label} | ||
| href={href} | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| className="px-3 py-1 text-xs text-muted-foreground hover:text-foreground rounded-md hover:bg-accent" | ||
| > | ||
| {label} | ||
| </a> | ||
|
Comment on lines
126
to
134
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. imo these should be buttons rather than styled hyperlinks |
||
| ))} | ||
| <a | ||
| href={`${GIT_REPO_URL}/commit/${GIT_COMMIT}`} | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| className="px-3 py-1 text-xs text-muted-foreground hover:text-foreground rounded-md hover:bg-accent font-mono" | ||
| > | ||
| ver: {GIT_COMMIT.substring(0, 6)} | ||
| </a> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <BlockStack className="flex-1 min-w-0"> | ||
| <Outlet /> | ||
| </BlockStack> | ||
| </InlineStack> | ||
| </BlockStack> | ||
| {/* Main content — independent scroll */} | ||
| <div className="flex-1 min-w-0 overflow-y-auto px-8 pb-6 pt-4"> | ||
| <Outlet /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BlockStack