Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
412 changes: 412 additions & 0 deletions frontend/app/dapp/Members.tsx

Large diffs are not rendered by default.

13 changes: 10 additions & 3 deletions frontend/app/dapp/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import React, { useState, useEffect } from 'react'
import React, { useState, useEffect, Dispatch, SetStateAction } from 'react'
import logo from '../../public/Images/spherrelogo.png'
import Image, { StaticImageData } from 'next/image'
import Dashboard from '../../public/Images/Dash.png'
Expand All @@ -22,7 +22,11 @@ interface NavItem {
notification?: number
}

const Sidebar = () => {
interface onSelectFunc {
onSelect: Dispatch<SetStateAction<string>>
}

const Sidebar = ({ onSelect }: onSelectFunc) => {
// State to track active page - set dashboard as default
const [activePage, setActivePage] = useState('Dashboard')

Expand Down Expand Up @@ -91,7 +95,10 @@ const Sidebar = () => {
{navItems.map((item) => (
<li
key={item.name}
onClick={() => handleNavClick(item.name)}
onClick={() => {
handleNavClick(item.name)
onSelect(item.name)
}}
className={`flex items-center cursor-pointer p-3 rounded-lg transition-all ${expanded ? 'gap-3' : 'justify-center'
} ${activePage === item.name
? 'bg-[#27292D] text-white'
Expand Down
5 changes: 4 additions & 1 deletion frontend/app/dapp/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import { useState, useEffect } from 'react'
import Sidebar from '../dapp/Sidebar'
import Navbar from './Navbar'
import Members from './Members'

export default function Dapp() {
// State to track sidebar expansion
const [sidebarExpanded, setSidebarExpanded] = useState(false)
const [selectedPage, setSelectedPage] = useState('Dashboard')

// Listen for sidebar expansion state changes
useEffect(() => {
Expand All @@ -30,7 +32,7 @@ export default function Dapp() {

return (
<div className="flex h-screen">
<Sidebar />
<Sidebar onSelect={setSelectedPage} />
<div
className={`flex-1 flex flex-col transition-all duration-300 ${
sidebarExpanded ? 'ml-64' : 'ml-16'
Expand All @@ -39,6 +41,7 @@ export default function Dapp() {
<Navbar title={'Dashboard'} />
<main className="flex-1 overflow-auto p-4">
{/* Your page content goes here */}
{selectedPage === 'Members' && <Members />}
</main>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions frontend/public/copy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions frontend/public/cross.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions frontend/public/dots.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions frontend/public/member1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading