-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86109cf
commit 72451a8
Showing
5 changed files
with
136 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
packages/commonwealth/client/scripts/views/pages/CommunityHome/CommunityHomePage.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
packages/commonwealth/client/scripts/views/pages/CommunityHome/CommunityHomePage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, setSelectedCommunityId] = useState<string>(); | ||
|
||
return ( | ||
// @ts-expect-error <StrictNullChecks/> | ||
<CWPageLayout ref={containerRef} className="CommunitiesPageLayout"> | ||
<div className="CommunityHome"> | ||
<div className="header-section"> | ||
<div className="description"> | ||
<CWText | ||
type="h1" | ||
{...(tokenizedCommunityEnabled && { fontWeight: 'semiBold' })} | ||
> | ||
Home {tokenizedCommunityEnabled ? '' : 'Communities'} | ||
</CWText> | ||
</div> | ||
<IdeaLaunchpad /> | ||
</div> | ||
<CWModal | ||
size="small" | ||
content={ | ||
<ManageCommunityStakeModal | ||
mode={modeOfManageCommunityStakeModal} | ||
// @ts-expect-error <StrictNullChecks/> | ||
onModalClose={() => setModeOfManageCommunityStakeModal(null)} | ||
denomination={ | ||
findDenominationString(selectedCommunityId || '') || 'ETH' | ||
} | ||
/> | ||
} | ||
// @ts-expect-error <StrictNullChecks/> | ||
onClose={() => setModeOfManageCommunityStakeModal(null)} | ||
open={!!modeOfManageCommunityStakeModal} | ||
/> | ||
</div> | ||
</CWPageLayout> | ||
); | ||
}; | ||
|
||
export default CommunityHome; |
1 change: 1 addition & 0 deletions
1
packages/commonwealth/client/scripts/views/pages/CommunityHome/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './CommunityHomePage'; |