diff --git a/web/app/(commonLayout)/explore/layout.tsx b/web/app/(commonLayout)/explore/layout.tsx index 7164a00be0..3dbed4d505 100644 --- a/web/app/(commonLayout)/explore/layout.tsx +++ b/web/app/(commonLayout)/explore/layout.tsx @@ -1,5 +1,6 @@ import type { FC } from 'react' import React from 'react' +import Sidebar from '@/app/components/explore/sidebar' export type IAppDetail = { children: React.ReactNode @@ -7,9 +8,12 @@ export type IAppDetail = { const AppDetail: FC = ({ children }) => { return ( - <> +
+ +
{children} - +
+
) } diff --git a/web/app/components/explore/sidebar/app-nav-item/index.tsx b/web/app/components/explore/sidebar/app-nav-item/index.tsx new file mode 100644 index 0000000000..351ed1f703 --- /dev/null +++ b/web/app/components/explore/sidebar/app-nav-item/index.tsx @@ -0,0 +1,41 @@ +'use client' +import { useSelectedLayoutSegment } from 'next/navigation' +import cn from 'classnames' +import Link from 'next/link' + +import s from './style.module.css' + +export default function NavLink({ + name, + id, +}: { + name: string + id: string +}) { + const segment = useSelectedLayoutSegment() + const url = `/explore/installed/${id}` + const isActive = id === segment?.toLowerCase() + + return ( + +
+
{name}
+ + ) +} diff --git a/web/app/components/explore/sidebar/app-nav-item/style.module.css b/web/app/components/explore/sidebar/app-nav-item/style.module.css new file mode 100644 index 0000000000..e22d930383 --- /dev/null +++ b/web/app/components/explore/sidebar/app-nav-item/style.module.css @@ -0,0 +1,9 @@ +.item:hover, +.item.active { + border: 0.5px solid #EAECF0; + box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05); + border-radius: 8px; + background: #FFFFFF; + color: #344054; + font-weight: 500; +} \ No newline at end of file diff --git a/web/app/components/explore/sidebar/index.tsx b/web/app/components/explore/sidebar/index.tsx index f8edf19e25..cd70006bc6 100644 --- a/web/app/components/explore/sidebar/index.tsx +++ b/web/app/components/explore/sidebar/index.tsx @@ -1,14 +1,48 @@ +'use client' import React, { FC } from 'react' -import s from './style.module.css' -export interface ISideBarProps { - -} -const SideBar: FC = ({ -}) => { +import Item from './app-nav-item' + +const list = [ + { + id: '1', + name: 'Story Bot', + }, + { + id: '2', + name: 'Fancy title' + } +] + +const DiscoveryIcon = () => ( + + + +) + +const SideBar: FC = () => { return ( -
- 111 +
+
+
+ +
Discovery
+
+
+
+
Workspace
+
+ {list.map(({id, name}) => { + return ( + + ) + })} +
+
) } + export default React.memo(SideBar)