From 9a84f83a0c171ba215fc4a5bc511f1d4107e1432 Mon Sep 17 00:00:00 2001 From: namedotget Date: Mon, 9 Dec 2024 11:21:28 -0600 Subject: [PATCH 1/5] Adjusted 'unlock full profile' action and citizen location visibility --- ui/pages/citizen/[tokenIdOrName].tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/pages/citizen/[tokenIdOrName].tsx b/ui/pages/citizen/[tokenIdOrName].tsx index 2da68008d..2259c37b4 100644 --- a/ui/pages/citizen/[tokenIdOrName].tsx +++ b/ui/pages/citizen/[tokenIdOrName].tsx @@ -318,7 +318,7 @@ export default function CitizenDetailPage({ <> )} - {location !== '' && ( + {location !== '' && citizen && (
} + onClick={() => router.push('/citizen')} /> )} {subIsValid && !isDeleted && !isGuest ? ( From 586d202e58d69d26e19d99ded6ed6db892f93f21 Mon Sep 17 00:00:00 2001 From: namedotget Date: Thu, 12 Dec 2024 10:37:35 -0600 Subject: [PATCH 2/5] Removed 'Become a Citizen' from the sidebar if already a citizen --- ui/components/layout/Layout.tsx | 7 ++- ui/lib/navigation/useNavigation.tsx | 78 +++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 ui/lib/navigation/useNavigation.tsx diff --git a/ui/components/layout/Layout.tsx b/ui/components/layout/Layout.tsx index 9bc3c174e..852610aea 100644 --- a/ui/components/layout/Layout.tsx +++ b/ui/components/layout/Layout.tsx @@ -10,6 +10,8 @@ import { useState } from 'react' import { useContext } from 'react' import { Toaster } from 'react-hot-toast' import ChainContext from '../../lib/thirdweb/chain-context' +import CitizenContext from '@/lib/citizen/citizen-context' +import useNavigation from '@/lib/navigation/useNavigation' import { LogoSidebarLight, LogoSidebar } from '../assets' import { PrivyConnectWallet } from '../privy/PrivyConnectWallet' import CitizenProfileLink from '../subscription/CitizenProfileLink' @@ -18,7 +20,6 @@ import ColorsAndSocials from './Sidebar/ColorsAndSocials' import LanguageChange from './Sidebar/LanguageChange' import MobileMenuTop from './Sidebar/MobileMenuTop' import MobileSidebar from './Sidebar/MobileSidebar' -import { navigation } from './Sidebar/Navigation' import NavigationLink from './Sidebar/NavigationLink' interface Layout { @@ -36,10 +37,13 @@ export default function Layout({ children, lightMode, setLightMode }: Layout) { const chain = useChain() const { selectedChain } = useContext(ChainContext) + const { citizen } = useContext(CitizenContext) const { contract: citizenContract } = useContract( CITIZEN_ADDRESSES[selectedChain.slug] ) + const navigation = useNavigation(citizen) + const [currentLang, setCurrentLang] = useState(router.locale) const { t } = useTranslation('common') //Background is defined in this root div. @@ -50,7 +54,6 @@ export default function Layout({ children, lightMode, setLightMode }: Layout) { !lightMode ? 'dark background-dark' : 'background-light' } min-h-screen`} > - {/*Mobile menu top bar*/} { + return [ + { + name: 'Join', + href: '/join', + icon: PlusIcon, + children: [ + !citizen && { name: 'Become a Citizen', href: '/citizen' }, + { name: 'Create a Team', href: '/team' }, + ], + }, + { + name: 'Network', + href: '/network', + icon: IconOrg, + }, + { + name: 'Info', + icon: FolderIcon, + href: '/info', + children: [ + { name: 'News', href: '/news' }, + { name: 'About', href: '/about' }, + { + name: 'Constitution', + href: 'https://docs.moondao.com/Governance/Constitution', + }, + { name: 'Events', href: '/events' }, + { name: 'Analytics', href: '/analytics' }, + ], + }, + { + name: 'Governance', + icon: BuildingLibraryIcon, + href: '/governance', + children: [ + { + name: 'All Proposals', + href: '/vote', + }, + { + name: 'Submit Proposal', + href: '/propose', + }, + { + name: 'Get $MOONEY', + href: '/get-mooney', + }, + { name: 'Get Voting Power', href: '/lock' }, + { name: 'Bridge', href: '/bridge' }, + ], + }, + { + name: 'Marketplace', + icon: RocketLaunchIcon, + href: '/marketplace', + }, + { + name: 'Jobs', + href: '/jobs', + icon: ClipboardDocumentListIcon, + }, + ] + }, [citizen]) + + return navigation +} From 9a7db2c0a027d45c507bc7812231373f9371fa7a Mon Sep 17 00:00:00 2001 From: namedotget Date: Thu, 12 Dec 2024 16:58:16 -0600 Subject: [PATCH 3/5] Added isTeamMember check to citizen create team action --- ui/components/subscription/CitizenActions.tsx | 16 ++++++++++------ ui/pages/citizen/[tokenIdOrName].tsx | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ui/components/subscription/CitizenActions.tsx b/ui/components/subscription/CitizenActions.tsx index c32191147..e466b5f35 100644 --- a/ui/components/subscription/CitizenActions.tsx +++ b/ui/components/subscription/CitizenActions.tsx @@ -17,6 +17,7 @@ type CitizenActionsProps = { address?: string nft?: any incompleteProfile?: boolean + isTeamMember?: boolean mooneyBalance?: number vmooneyBalance?: number setCitizenMetadataModalEnabled: Function @@ -26,6 +27,7 @@ export default function CitizenActions({ address, nft, incompleteProfile, + isTeamMember, mooneyBalance, vmooneyBalance, setCitizenMetadataModalEnabled, @@ -148,12 +150,14 @@ export default function CitizenActions({ onClick={() => window.open('https://guild.xyz/moondao')} /> - } - onClick={() => router.push('/team')} - /> + {!isTeamMember && ( + } + onClick={() => router.push('/team')} + /> + )}
diff --git a/ui/pages/citizen/[tokenIdOrName].tsx b/ui/pages/citizen/[tokenIdOrName].tsx index 2259c37b4..94cbf7d79 100644 --- a/ui/pages/citizen/[tokenIdOrName].tsx +++ b/ui/pages/citizen/[tokenIdOrName].tsx @@ -360,6 +360,7 @@ export default function CitizenDetailPage({ address={address} nft={nft} incompleteProfile={incompleteProfile} + isTeamMember={hats.length > 0} mooneyBalance={MOONEYBalance} vmooneyBalance={VMOONEYBalance} setCitizenMetadataModalEnabled={setCitizenMetadataModalEnabled} From 0641f0418784f68c8594c49e1560b70b1269c56f Mon Sep 17 00:00:00 2001 From: namedotget Date: Mon, 16 Dec 2024 13:29:08 -0600 Subject: [PATCH 4/5] Updated nav links --- ui/lib/navigation/useNavigation.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/lib/navigation/useNavigation.tsx b/ui/lib/navigation/useNavigation.tsx index c6fdd7fc2..2c2910abc 100644 --- a/ui/lib/navigation/useNavigation.tsx +++ b/ui/lib/navigation/useNavigation.tsx @@ -51,7 +51,11 @@ export default function useNavigation(citizen: any) { }, { name: 'Submit Proposal', - href: '/propose', + href: '/submission', + }, + { + name: 'Submit Contribution', + href: '/submission?tag=contribution', }, { name: 'Get $MOONEY', From 7b0251aaefa3c757a7e7491ce452a72ff3130e10 Mon Sep 17 00:00:00 2001 From: namedotget Date: Mon, 16 Dec 2024 13:39:22 -0600 Subject: [PATCH 5/5] Fixed build error --- ui/components/jobs/Job.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/ui/components/jobs/Job.tsx b/ui/components/jobs/Job.tsx index 919067fea..7ab851bcb 100644 --- a/ui/components/jobs/Job.tsx +++ b/ui/components/jobs/Job.tsx @@ -74,8 +74,6 @@ export default function Job({ {isActive && (