diff --git a/packages/commonwealth/client/scripts/navigation/CommonDomainRoutes.tsx b/packages/commonwealth/client/scripts/navigation/CommonDomainRoutes.tsx index 384c5910256..491bc213874 100644 --- a/packages/commonwealth/client/scripts/navigation/CommonDomainRoutes.tsx +++ b/packages/commonwealth/client/scripts/navigation/CommonDomainRoutes.tsx @@ -48,6 +48,9 @@ const NewProposalPage = lazy(() => import('views/pages/new_proposal/index')); const DiscussionsPage = lazy( () => import('views/pages/discussions/DiscussionsPage'), ); +const CommunityHomePage = lazy( + () => import('../views/pages/CommunityHome/CommunityHomePage'), +); const ViewThreadPage = lazy( () => import('../views/pages/view_thread/ViewThreadPage'), ); @@ -317,6 +320,13 @@ const CommonDomainRoutes = ({ // GOVERNANCE END // DISCUSSIONS + , { + e.preventDefault(); + resetSidebarState(); + handleRedirectClicks( + navigate, + e, + `/community-home`, + communityId, + () => { + setDiscussionsToggleTree( + `children.CommunityHome.toggledState`, + toggle, + ); + }, + ); + }, + displayData: null, + }, { title: 'All', containsChildren: false, diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityHome/CommunityHomePage.scss b/packages/commonwealth/client/scripts/views/pages/CommunityHome/CommunityHomePage.scss new file mode 100644 index 00000000000..92d7694ad41 --- /dev/null +++ b/packages/commonwealth/client/scripts/views/pages/CommunityHome/CommunityHomePage.scss @@ -0,0 +1,36 @@ +@import '../../../styles/shared'; + +.BreadcrumbsComponent { + z-index: 0 !important; +} + +.CommunityHome { + display: flex; + flex: 1; + flex-direction: column; + overflow: hidden; + + .header-section { + display: flex; + flex-direction: column; + gap: 16px; + position: sticky; + top: 0; + z-index: 1; + background-color: $white; + + .btn-border { + margin: 0 !important; + padding: 0 !important; + + &:focus-within { + border-width: 1px !important; + padding: 0 !important; + } + } + } + + .my-16 { + margin: 16px 0; + } +} diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityHome/CommunityHomePage.tsx b/packages/commonwealth/client/scripts/views/pages/CommunityHome/CommunityHomePage.tsx new file mode 100644 index 00000000000..e57f8099eb8 --- /dev/null +++ b/packages/commonwealth/client/scripts/views/pages/CommunityHome/CommunityHomePage.tsx @@ -0,0 +1,59 @@ +import { findDenominationString } from 'helpers/findDenomination'; +import { useFlag } from 'hooks/useFlag'; +import React, { useRef, useState } from 'react'; +import { useManageCommunityStakeModalStore } from 'state/ui/modals'; +import CWPageLayout from 'views/components/component_kit/new_designs/CWPageLayout'; +import { CWText } from '../../components/component_kit/cw_text'; +import { CWModal } from '../../components/component_kit/new_designs/CWModal'; +import ManageCommunityStakeModal from '../../modals/ManageCommunityStakeModal/ManageCommunityStakeModal'; +import IdeaLaunchpad from '../Communities/IdeaLaunchpad'; +import './CommunityHomePage.scss'; + +const CommunityHome = () => { + const containerRef = useRef(); + const tokenizedCommunityEnabled = useFlag('tokenizedCommunity'); + + const { + setModeOfManageCommunityStakeModal, + modeOfManageCommunityStakeModal, + } = useManageCommunityStakeModalStore(); + + const [selectedCommunityId] = useState(); + + return ( + // @ts-expect-error + +
+
+
+ + Home {tokenizedCommunityEnabled ? '' : 'Communities'} + +
+ +
+ + onModalClose={() => setModeOfManageCommunityStakeModal(null)} + denomination={ + findDenominationString(selectedCommunityId || '') || 'ETH' + } + /> + } + // @ts-expect-error + onClose={() => setModeOfManageCommunityStakeModal(null)} + open={!!modeOfManageCommunityStakeModal} + /> +
+
+ ); +}; + +export default CommunityHome; diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityHome/index.ts b/packages/commonwealth/client/scripts/views/pages/CommunityHome/index.ts new file mode 100644 index 00000000000..1cb241fab20 --- /dev/null +++ b/packages/commonwealth/client/scripts/views/pages/CommunityHome/index.ts @@ -0,0 +1 @@ +export * from './CommunityHomePage';