Skip to content

Commit

Permalink
Added DAO tabs, SubDAOs, and polytone addresses to command modal cont…
Browse files Browse the repository at this point in the history
…ext. Allow larger command modal with consistent input height. (#1416)
  • Loading branch information
NoahSaso authored Oct 12, 2023
1 parent be3cf4f commit d09a798
Show file tree
Hide file tree
Showing 19 changed files with 387 additions and 179 deletions.
19 changes: 2 additions & 17 deletions apps/dapp/pages/dao/[address]/[[...slug]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
DaoInfoBar,
DaoPageWrapper,
DaoPageWrapperProps,
DaoWidgets,
LinkWrapper,
ProfileDaoHomeCard,
SuspenseLoader,
Expand All @@ -22,14 +21,13 @@ import {
} from '@dao-dao/stateful'
import { useActionForKey } from '@dao-dao/stateful/actions'
import { makeGetDaoStaticProps } from '@dao-dao/stateful/server'
import { useWidgets } from '@dao-dao/stateful/widgets'
import {
DaoDappTabbedHome,
useChain,
useDaoInfoContext,
useDaoNavHelpers,
} from '@dao-dao/stateless'
import { ActionKey, DaoPageMode, WidgetLocation } from '@dao-dao/types'
import { ActionKey, DaoPageMode } from '@dao-dao/types'
import {
SITE_URL,
getDaoPath,
Expand Down Expand Up @@ -152,20 +150,7 @@ const InnerDaoHome = () => {
useFollowingDaos(daoInfo.chainId)
const following = isFollowing(daoInfo.coreAddress)

// Add home tab with widgets if any widgets exist.
const loadingDaoWidgets = useWidgets({
// Load widgets before rendering so that home is selected if there are
// widgets.
suspendWhileLoading: true,
// Only load home widgets.
location: WidgetLocation.Home,
})
const hasHomeWidgets =
!loadingDaoWidgets.loading && loadingDaoWidgets.data.length > 0

const tabs = useDaoTabs({
includeHome: hasHomeWidgets ? DaoWidgets : undefined,
})
const tabs = useDaoTabs()
const firstTabId = tabs[0].id

// Pre-fetch tabs.
Expand Down
3 changes: 1 addition & 2 deletions apps/sda/pages/[address]/[[...slug]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import React, { useEffect } from 'react'

import {
ProfileDaoHomeCard,
SdaDaoHome,
SuspenseLoader,
useDaoTabs,
} from '@dao-dao/stateful'
Expand All @@ -25,7 +24,7 @@ const DaoHomePage: NextPage = () => {
const { coreAddress } = useDaoInfoContext()
const { getDaoPath } = useDaoNavHelpers()

const tabs = useDaoTabs({ includeHome: SdaDaoHome })
const tabs = useDaoTabs()
const firstTabId = tabs[0].id

// Pre-fetch tabs.
Expand Down
4 changes: 2 additions & 2 deletions packages/i18n/locales/dog/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"continue": "continnue",
"copy": "copee",
"copyAddressToClipboard": "copee addres 2 clipboar",
"copyDaoAddress": "copee da0 addres",
"copyDaoChainAddress": "copee {{chain}} addres",
"copyToClipboard": "copee 2 clipboar",
"create": "cre8",
"createAProposal": "cre8 a puppozal",
Expand Down Expand Up @@ -273,7 +273,7 @@
"configureWalletModalExplanation": "u hav keplr installd, but it dont seem lyke uv set oop a wallit. 2 continue, oopen da keplr extenshun n set oop a wallit. 2 oopen da keplr extenshun,press da puzzul icon in da top rite ov ur browzer n den press da keplr buttun. wunce uv dun dat, a new pag will oopen wer ull be abbl 2 create a new accoont. configur ur wallit 2 continue",
"considerReturningHome": "considar retorning homm",
"copiedAddressToClipboard": "copy adress 2 clipboar",
"copiedDaoAddress": "coppied da0 addres",
"copiedDaoChainAddress": "coppied {{chain}} addres",
"copiedLinkToClipboard": "coopied link 2 clibpoard",
"copiedToClipboard": "coopied 2 clipboar",
"copyWalletAddressTooltip": "copy wallit adress",
Expand Down
5 changes: 3 additions & 2 deletions packages/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"copy": "Copy",
"copyAddress": "Copy address",
"copyAddressToClipboard": "Copy address to clipboard",
"copyDaoAddress": "Copy DAO address",
"copyDaoChainAddress": "Copy {{chain}} address",
"copyToClipboard": "Copy to clipboard",
"create": "Create",
"createAProposal": "Create a proposal",
Expand Down Expand Up @@ -728,7 +728,7 @@
"configureWalletModalExplanation": "You have a wallet extension installed, but it doesn't seem like you've set up a wallet. Create a wallet to continue.",
"connectedTo": "Connected to {{name}}",
"copiedAddressToClipboard": "Copy address to clipboard",
"copiedDaoAddress": "Copied DAO address",
"copiedDaoChainAddress": "Copied {{chain}} address",
"copiedLinkToClipboard": "Copied link to clipboard.",
"copiedToClipboard": "Copied to clipboard.",
"copyWalletAddressTooltip": "Copy wallet address",
Expand Down Expand Up @@ -1322,6 +1322,7 @@
"other": "Other",
"otherMembers": "Other Members",
"owner": "Owner",
"pages": "Pages",
"passingThreshold": "Passing threshold",
"payout": "Payout",
"payroll": "Payroll",
Expand Down
18 changes: 12 additions & 6 deletions packages/stateful/command/components/CommandModalContextView.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Fuse from 'fuse.js'
import { useMemo } from 'react'
import { Fragment, useMemo } from 'react'

import {
CommandModalContextViewLoader,
Expand All @@ -20,11 +20,17 @@ export interface CommandModalContextViewProps {

export const CommandModalContextView = (
props: CommandModalContextViewProps
) => (
<SuspenseLoader fallback={<CommandModalContextViewLoader />}>
<InnerCommandModalContextView {...props} />
</SuspenseLoader>
)
) => {
const Wrapper = props.contexts[props.contexts.length - 1]?.Wrapper ?? Fragment

return (
<SuspenseLoader fallback={<CommandModalContextViewLoader />}>
<Wrapper>
<InnerCommandModalContextView {...props} />
</Wrapper>
</SuspenseLoader>
)
}

export const InnerCommandModalContextView = ({
filter,
Expand Down
116 changes: 0 additions & 116 deletions packages/stateful/command/contexts/generic/dao.ts

This file was deleted.

Loading

0 comments on commit d09a798

Please sign in to comment.