Skip to content

Commit

Permalink
Merge pull request #2397 from Agenta-AI/AGE-1401/-collapsible-side-menu
Browse files Browse the repository at this point in the history
(frontend)[Age 1401]: Collapsible side menu
  • Loading branch information
mmabrouk authored Jan 24, 2025
2 parents 69bbb6e + b7ed4c8 commit 3af3b04
Show file tree
Hide file tree
Showing 4 changed files with 195 additions and 252 deletions.
17 changes: 14 additions & 3 deletions agenta-web/src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import React, {useEffect, useMemo, useState} from "react"
import {Breadcrumb, Button, ConfigProvider, Layout, Modal, Space, Typography, theme} from "antd"
import Sidebar from "../Sidebar/Sidebar"
import {
Breadcrumb,
Button,
ConfigProvider,
Layout,
Modal,
Skeleton,
Space,
Typography,
theme,
} from "antd"
import {GithubFilled, LinkedinFilled, TwitterOutlined} from "@ant-design/icons"
import Link from "next/link"
import {isDemo} from "@/lib/helpers/utils"
Expand All @@ -18,7 +27,9 @@ import {JSSTheme, StyleProps as MainStyleProps} from "@/lib/Types"
import {Lightning} from "@phosphor-icons/react"
import packageJsonData from "../../../package.json"
import {useProjectData} from "@/contexts/project.context"
import {dynamicContext} from "@/lib/helpers/dynamic"
import {dynamicComponent, dynamicContext} from "@/lib/helpers/dynamic"

const Sidebar: any = dynamicComponent("Sidebar/Sidebar", () => <Skeleton className="w-[236px]" />)

const {Content, Footer} = Layout
const {Text} = Typography
Expand Down
24 changes: 4 additions & 20 deletions agenta-web/src/components/Logo/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@ import {useMemo} from "react"
import {useAppTheme} from "../Layout/ThemeContextProvider"

const LOGOS = {
dark: {
complete: "/assets/dark-complete-transparent-CROPPED.png",
onlyIcon: "/assets/dark-logo.svg",
},
light: {
complete: "/assets/light-complete-transparent-CROPPED.png",
onlyIcon: "/assets/light-logo.svg",
},
dark: "/assets/dark-complete-transparent-CROPPED.png",
light: "/assets/light-complete-transparent-CROPPED.png",
}

const Logo: React.FC<Partial<React.ComponentProps<typeof Image>> & {isOnlyIconLogo?: boolean}> = (
Expand All @@ -20,18 +14,8 @@ const Logo: React.FC<Partial<React.ComponentProps<typeof Image>> & {isOnlyIconLo
const {isOnlyIconLogo, ...imageProps} = props

const logoSrc = useMemo(() => LOGOS[appTheme], [appTheme])
return isOnlyIconLogo ? (
<Image
width={40}
height={51}
{...imageProps}
src={logoSrc.onlyIcon}
style={{marginRight: "-20px"}}
alt="Agenta Logo"
/>
) : (
<Image width={154.8} height={51} {...imageProps} src={logoSrc.complete} alt="Agenta Logo" />
)

return <Image {...imageProps} src={logoSrc} alt="Agenta Logo" width={154.8} height={51} />
}

export default Logo
Loading

0 comments on commit 3af3b04

Please sign in to comment.