From d5b87c97834c5a5e666d5f2e8a3eef8ec3679db7 Mon Sep 17 00:00:00 2001 From: Sam Kuhlmann Date: Sat, 3 Sep 2022 16:41:19 -0600 Subject: [PATCH] Feature/more buttons (#808) * Publish new lib versions. (#412) * fix/fix-table-types (#354) * removed the any types from hub * renamed Table to DaoTable and DataTable to DaoTable to be more consistent with DaoCard * removed commented out DaoData type * one more comment -- thought i got both before * Fix/355 summon params mixup (#356) * more ignore * fixes bad init params order in summon tx * Feature/tag component (#349) * Created basic tag component * Added dynamic color selections for tags * Bumped versions fixed filer * Added icon support to tag component Co-authored-by: Jord <53406838+jordanlesich@users.noreply.github.com> Co-authored-by: Jonathan Prozzi * Feature/delegate play (#357) * more ignore * fixes bad init params order in summon tx * delegate testing and subgraph field updates * finishes mapping * update dao-data query and transformer * adds delegate tag to list view and hooks up delegate filtering * refactors filter into query helper * Spencer's Summon tooltip suggestions (#370) * Spencer's Summon tooltip suggestions - Summon portion of #365 * Delimiter references #368 For now, just referencing spaces. But if tabs, commas, or other delimiters are also supported, those should be references in the tooltips as well. * Address Jord's comments Co-authored-by: Sam Kuhlmann * Fix/summon poll (#375) * more ignore * fixes bad init params order in summon tx * delegate testing and subgraph field updates * finishes mapping * update dao-data query and transformer * adds delegate tag to list view and hooks up delegate filtering * adds schema field to tx entity * updates poll for tx entity made before dao entity * Feature/alpha baal update (#376) * new abis * updates summoner tx logic and contract addresses * fixes transaction entity creation location; * fixes some test * Feature/unit utils (#380) * create custom d.ts for human-format * type and convert unit fn from V2 * readableNumber util accepts number strings, throws error if string but number string * fix 0 to 1 utils, extend MaxDecimals to shorten decimal places * refine spacer and unit symbol placement * update new card to handle new params * update table * corrections * alter d.ts file * potential solutions to ts bug * implement keating's d.ts fix * fix comment * Fix/network switcher (#381) * better error handling * fix bug * remove log * get react-table TS to stop yelling (#382) Co-authored-by: Sam Kuhlmann * Feature/hub sort (#383) * wip * gets query working on dao entity after lots of subgraph updates * updates front end for sort * fixes type issue * fixes build issue * reviewing v3 monorepo and saw some networks missing (#399) * Feature/public profile (#384) * Add some stuff * Add public profile * Add ens * Get build to pass * Update apps/hub-app/src/pages/PublicProfilePage.tsx Co-authored-by: Rowdy Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy * fixing doc display name from <[object Object]> to displayName (#402) Co-authored-by: Sam Kuhlmann * adds search (#401) * adds search wip * correctly types the onChange for the input * cleans up unsed imports * naming * Feature/public profile (#384) * Add some stuff * Add public profile * Add ens * Get build to pass * Update apps/hub-app/src/pages/PublicProfilePage.tsx Co-authored-by: Rowdy Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy * fixing doc display name from <[object Object]> to displayName (#402) Co-authored-by: Sam Kuhlmann * conflicts * correctly types the onChange for the input * cleans up unsed imports * naming * fix build error Co-authored-by: Alexander Keating Co-authored-by: Rowdy Co-authored-by: Brian Rossetti * Release/12072022 (#411) * adds search wip * correctly types the onChange for the input * cleans up unsed imports * naming * conflicts * correctly types the onChange for the input * cleans up unsed imports * naming * fix build error * feature bump Co-authored-by: Jonathan Prozzi Co-authored-by: Rowdy Co-authored-by: Jord <53406838+jordanlesich@users.noreply.github.com> Co-authored-by: Spencer Graham Co-authored-by: Brian Rossetti Co-authored-by: Alexander Keating * Revert "Publish new lib versions. (#412)" This reverts commit bab7077ded01a2e5e0e4cd8ef59c4fd0fb9e4b96. * develop to master (#482) * UI/layout cleanup (#438) * run generator * import connect, theme libs. Add eindow.global. Ensure main.tsx uses React 17 API. * deletes app test * updates favicon and title * remove nx defaults * rough in layout box, target DH connect nav with class * remove even more css. World's dubest layout component * switches to connect class padding for mobile * extract base layout component to storybook * hook export chain, change name to outerlayout * extract formSegment from summon-app; replace in all instances in summon * extract split-column, replace all instances in summon * document future changes in comments * fix exports * switch core-app to nx default project * fix spacing * Fix/split column bug (#444) - fix bug * Layouts/subnav (#447) * clear out extra app.t.tsx * build sub-nav * style sub-nav * test subnav * extract subNavLink into component * subnavlink story * build subnavlink story * fix broken as prop * add mobile view, icon button trigger * add tsc command to core-app * adds human-format, removes profanity * Fix summon (#446) * Fix summon * clear out extra app.t.tsx * build sub-nav * style sub-nav * test subnav * extract subNavLink into component * subnavlink story * build subnavlink story * fix broken as prop * Fix summon * add mobile view, icon button trigger * add tsc command to core-app * adds human-format, removes profanity * add human-format to dao-data * move dts file Co-authored-by: jordan Co-authored-by: Jord <53406838+jordanlesich@users.noreply.github.com> * Haus layout (#451) * Publish new lib versions. (#412) * fix/fix-table-types (#354) * removed the any types from hub * renamed Table to DaoTable and DataTable to DaoTable to be more consistent with DaoCard * removed commented out DaoData type * one more comment -- thought i got both before * Fix/355 summon params mixup (#356) * more ignore * fixes bad init params order in summon tx * Feature/tag component (#349) * Created basic tag component * Added dynamic color selections for tags * Bumped versions fixed filer * Added icon support to tag component Co-authored-by: Jord <53406838+jordanlesich@users.noreply.github.com> Co-authored-by: Jonathan Prozzi * Feature/delegate play (#357) * more ignore * fixes bad init params order in summon tx * delegate testing and subgraph field updates * finishes mapping * update dao-data query and transformer * adds delegate tag to list view and hooks up delegate filtering * refactors filter into query helper * Spencer's Summon tooltip suggestions (#370) * Spencer's Summon tooltip suggestions - Summon portion of #365 * Delimiter references #368 For now, just referencing spaces. But if tabs, commas, or other delimiters are also supported, those should be references in the tooltips as well. * Address Jord's comments Co-authored-by: Sam Kuhlmann * Fix/summon poll (#375) * more ignore * fixes bad init params order in summon tx * delegate testing and subgraph field updates * finishes mapping * update dao-data query and transformer * adds delegate tag to list view and hooks up delegate filtering * adds schema field to tx entity * updates poll for tx entity made before dao entity * Feature/alpha baal update (#376) * new abis * updates summoner tx logic and contract addresses * fixes transaction entity creation location; * fixes some test * Feature/unit utils (#380) * create custom d.ts for human-format * type and convert unit fn from V2 * readableNumber util accepts number strings, throws error if string but number string * fix 0 to 1 utils, extend MaxDecimals to shorten decimal places * refine spacer and unit symbol placement * update new card to handle new params * update table * corrections * alter d.ts file * potential solutions to ts bug * implement keating's d.ts fix * fix comment * Fix/network switcher (#381) * better error handling * fix bug * remove log * get react-table TS to stop yelling (#382) Co-authored-by: Sam Kuhlmann * Feature/hub sort (#383) * wip * gets query working on dao entity after lots of subgraph updates * updates front end for sort * fixes type issue * fixes build issue * reviewing v3 monorepo and saw some networks missing (#399) * Feature/public profile (#384) * Add some stuff * Add public profile * Add ens * Get build to pass * Update apps/hub-app/src/pages/PublicProfilePage.tsx Co-authored-by: Rowdy Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy * fixing doc display name from <[object Object]> to displayName (#402) Co-authored-by: Sam Kuhlmann * adds search (#401) * adds search wip * correctly types the onChange for the input * cleans up unsed imports * naming * Feature/public profile (#384) * Add some stuff * Add public profile * Add ens * Get build to pass * Update apps/hub-app/src/pages/PublicProfilePage.tsx Co-authored-by: Rowdy Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy * fixing doc display name from <[object Object]> to displayName (#402) Co-authored-by: Sam Kuhlmann * conflicts * correctly types the onChange for the input * cleans up unsed imports * naming * fix build error Co-authored-by: Alexander Keating Co-authored-by: Rowdy Co-authored-by: Brian Rossetti * Release/12072022 (#411) * adds search wip * correctly types the onChange for the input * cleans up unsed imports * naming * conflicts * correctly types the onChange for the input * cleans up unsed imports * naming * fix build error * feature bump Co-authored-by: Jonathan Prozzi Co-authored-by: Rowdy Co-authored-by: Jord <53406838+jordanlesich@users.noreply.github.com> Co-authored-by: Spencer Graham Co-authored-by: Brian Rossetti Co-authored-by: Alexander Keating * Revert "Publish new lib versions. (#412)" This reverts commit bab7077ded01a2e5e0e4cd8ef59c4fd0fb9e4b96. * build formLayout Component * type correction * build formLayout story * rough in bicolumn layout * handle bicolumn mobile switch, finish bicolumn * fix mainlayout naming * build story for bi-column layout * build dh layout one shot? * yes, one shot * fix import * change prop name Co-authored-by: Jonathan Prozzi Co-authored-by: Alexander Keating Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy Co-authored-by: Spencer Graham Co-authored-by: Brian Rossetti * bumping packages that were published pre revert last week - causing fialures with package publishing (#460) * removing period from info content which casues confusing tooltip (#453) Co-authored-by: Sam Kuhlmann * Feature/hub profile menu fix (#480) * fixes profile link and layout * dao list style * adds toast to share link * Readme tables preferred (#483) * adjusting breakdown of apps and libs to tables * adding additoonal app references and libs * adding timestamp and address fields to many events (#468) * adding timestamps and address fields to many events * addressing code review * shortening naming convention on proposals, top level txHash defined as txHash going forward * update version * deploy subgraph and generate query types Co-authored-by: skuhlmann Co-authored-by: Jord <53406838+jordanlesich@users.noreply.github.com> Co-authored-by: Alexander Keating Co-authored-by: jordan Co-authored-by: Jonathan Prozzi Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy Co-authored-by: Spencer Graham * Revert "develop to master (#482)" (#492) This reverts commit 5f7d121f9c49b9559d352bb17fce3c1ec598dfbe. Co-authored-by: Sam Kuhlmann * Develop into master (#577) * Feature/form builder (#553) * Publish new lib versions. (#412) * fix/fix-table-types (#354) * removed the any types from hub * renamed Table to DaoTable and DataTable to DaoTable to be more consistent with DaoCard * removed commented out DaoData type * one more comment -- thought i got both before * Fix/355 summon params mixup (#356) * more ignore * fixes bad init params order in summon tx * Feature/tag component (#349) * Created basic tag component * Added dynamic color selections for tags * Bumped versions fixed filer * Added icon support to tag component Co-authored-by: Jord <53406838+jordanlesich@users.noreply.github.com> Co-authored-by: Jonathan Prozzi * Feature/delegate play (#357) * more ignore * fixes bad init params order in summon tx * delegate testing and subgraph field updates * finishes mapping * update dao-data query and transformer * adds delegate tag to list view and hooks up delegate filtering * refactors filter into query helper * Spencer's Summon tooltip suggestions (#370) * Spencer's Summon tooltip suggestions - Summon portion of #365 * Delimiter references #368 For now, just referencing spaces. But if tabs, commas, or other delimiters are also supported, those should be references in the tooltips as well. * Address Jord's comments Co-authored-by: Sam Kuhlmann * Fix/summon poll (#375) * more ignore * fixes bad init params order in summon tx * delegate testing and subgraph field updates * finishes mapping * update dao-data query and transformer * adds delegate tag to list view and hooks up delegate filtering * adds schema field to tx entity * updates poll for tx entity made before dao entity * Feature/alpha baal update (#376) * new abis * updates summoner tx logic and contract addresses * fixes transaction entity creation location; * fixes some test * Feature/unit utils (#380) * create custom d.ts for human-format * type and convert unit fn from V2 * readableNumber util accepts number strings, throws error if string but number string * fix 0 to 1 utils, extend MaxDecimals to shorten decimal places * refine spacer and unit symbol placement * update new card to handle new params * update table * corrections * alter d.ts file * potential solutions to ts bug * implement keating's d.ts fix * fix comment * Fix/network switcher (#381) * better error handling * fix bug * remove log * get react-table TS to stop yelling (#382) Co-authored-by: Sam Kuhlmann * Feature/hub sort (#383) * wip * gets query working on dao entity after lots of subgraph updates * updates front end for sort * fixes type issue * fixes build issue * reviewing v3 monorepo and saw some networks missing (#399) * Feature/public profile (#384) * Add some stuff * Add public profile * Add ens * Get build to pass * Update apps/hub-app/src/pages/PublicProfilePage.tsx Co-authored-by: Rowdy Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy * fixing doc display name from <[object Object]> to displayName (#402) Co-authored-by: Sam Kuhlmann * adds search (#401) * adds search wip * correctly types the onChange for the input * cleans up unsed imports * naming * Feature/public profile (#384) * Add some stuff * Add public profile * Add ens * Get build to pass * Update apps/hub-app/src/pages/PublicProfilePage.tsx Co-authored-by: Rowdy Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy * fixing doc display name from <[object Object]> to displayName (#402) Co-authored-by: Sam Kuhlmann * conflicts * correctly types the onChange for the input * cleans up unsed imports * naming * fix build error Co-authored-by: Alexander Keating Co-authored-by: Rowdy Co-authored-by: Brian Rossetti * Release/12072022 (#411) * adds search wip * correctly types the onChange for the input * cleans up unsed imports * naming * conflicts * correctly types the onChange for the input * cleans up unsed imports * naming * fix build error * feature bump Co-authored-by: Jonathan Prozzi Co-authored-by: Rowdy Co-authored-by: Jord <53406838+jordanlesich@users.noreply.github.com> Co-authored-by: Spencer Graham Co-authored-by: Brian Rossetti Co-authored-by: Alexander Keating * Revert "Publish new lib versions. (#412)" This reverts commit bab7077ded01a2e5e0e4cd8ef59c4fd0fb9e4b96. * build formLayout Component * type correction * build formLayout story * rough in bicolumn layout * handle bicolumn mobile switch, finish bicolumn * fix mainlayout naming * build story for bi-column layout * scaffold formBuilder library * rough in formBuilder * restructure types * refactor component structure * test render inputs * add core fields to builder enum * add row layout to builder * built logger, fix logger bug * add disable all functionality * handle asynchronous callback as props to form builder * remove some comments * put submit button in form footer * fix code based on review * build validation pipeline * clean form and field types * revise types again, simplify rules API * commit after refactor carnage * roll back to react-hook-form v6, finally get some traction * found source of bug, trying new rhf version * ...and the bug was slain, returned to that cold, miserable shit heap from whence it came. * reintroduce devtool and logger * build metadata form, form segment subForm component * clean, add custom submit btn text * clean * build string validations * derive validation type from function obj * wrestled types into validation system * rebuild form builder as context * build formBuilder hook, use it in the factory * create sample test * update form placement * more post merge corrections * write validation updaters and add to pipeline, test required updaters, test validation, test pipeline * try jest testing * ensure field state updates on formState change * more cleaning * reorg files * build metadata form * tweak button styles, add defaultValues to formBuilder * good place to stop * remove comments * fix Jest errors * fix field wrapper stories, update lock * may have fixed jest errors Co-authored-by: Jonathan Prozzi Co-authored-by: Alexander Keating Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy Co-authored-by: Spencer Graham Co-authored-by: Brian Rossetti * Fix build (#563) * Fix build * Almost * More changes Co-authored-by: Jord <53406838+jordanlesich@users.noreply.github.com> Co-authored-by: Jonathan Prozzi Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy Co-authored-by: Spencer Graham Co-authored-by: Brian Rossetti * Revert "Develop into master (#577)" This reverts commit b8644d3afa3204e0e4275b62a8e360109aac11cd. * pending proposal status * fixes the mapping for self sponsor * adds token type labels to token settings form * removes nft count * pull dao context out of core-app and updates core app * fixes build * adds daocontainer * wires up manage shaman button * adds vault and members buttons * finishes; Co-authored-by: Jonathan Prozzi Co-authored-by: Alexander Keating Co-authored-by: Rowdy Co-authored-by: Jord <53406838+jordanlesich@users.noreply.github.com> Co-authored-by: Spencer Graham Co-authored-by: Brian Rossetti Co-authored-by: jordan --- .../src/components/GovernanceSettings.tsx | 42 +++++++++++++- .../src/components/MembersOverview.tsx | 1 + .../src/components/MetadataSettings.tsx | 2 +- apps/core-app/src/components/Profile.tsx | 1 - apps/core-app/src/components/ShamanList.tsx | 23 +++++++- apps/core-app/src/legos/form.ts | 57 ++++++++++--------- apps/core-app/src/pages/Members.tsx | 21 ++++++- apps/core-app/src/pages/NewProposal.tsx | 13 +++++ apps/core-app/src/pages/Proposals.tsx | 5 -- apps/core-app/src/pages/Vaults.tsx | 38 ++++++++++++- libs/dao-context/src/DaoContext.tsx | 1 - 11 files changed, 158 insertions(+), 46 deletions(-) diff --git a/apps/core-app/src/components/GovernanceSettings.tsx b/apps/core-app/src/components/GovernanceSettings.tsx index 76531d961..019a8923c 100644 --- a/apps/core-app/src/components/GovernanceSettings.tsx +++ b/apps/core-app/src/components/GovernanceSettings.tsx @@ -1,5 +1,14 @@ import styled from 'styled-components'; -import { H3, H4, DataIndicator, ParSm, widthQuery, Theme } from '@daohaus/ui'; +import { + H3, + H4, + DataIndicator, + ParSm, + widthQuery, + Theme, + Button, + Link, +} from '@daohaus/ui'; import { TDao } from '@daohaus/dao-context'; import { @@ -55,6 +64,15 @@ const TokenDataGrid = styled(DataGrid)` const StyledLink = styled.a` text-decoration: none; color: ${({ theme }: { theme: Theme }) => theme.link.color}; + :hover { + text-decoration: none; + } +`; + +const StyledButtonLink = styled(Link)` + :hover { + text-decoration: none; + } `; type GovernanceSettingsProps = { @@ -62,16 +80,36 @@ type GovernanceSettingsProps = { }; export const GovernanceSettings = ({ dao }: GovernanceSettingsProps) => { - const { daochain } = useParams(); + const { daochain, daoid } = useParams(); const networkData = useMemo(() => { if (!daochain) return null; return getNetwork(daochain); }, [daochain]); + const defaultValues = useMemo(() => { + if (!dao) return null; + return { + votingPeriod: dao.votingPeriod, + gracePeriod: dao.gracePeriod, + proposalOffering: dao.proposalOffering, + quorumPercent: dao.quorumPercent, + minRetention: dao.minRetentionPercent, + sponsorThreshold: dao.sponsorThreshold, + newOffering: dao.proposalOffering, + }; + }, [dao]); + return (

Governance Settings

+ + +
diff --git a/apps/core-app/src/components/MembersOverview.tsx b/apps/core-app/src/components/MembersOverview.tsx index a5771f300..cc8f18b53 100644 --- a/apps/core-app/src/components/MembersOverview.tsx +++ b/apps/core-app/src/components/MembersOverview.tsx @@ -8,6 +8,7 @@ const MembersOverviewCard = styled(Card)` background-color: ${({ theme }: { theme: Theme }) => theme.card.hoverBg}; border: none; padding: 3rem; + width: 100%; `; const DataGrid = styled.div` diff --git a/apps/core-app/src/components/MetadataSettings.tsx b/apps/core-app/src/components/MetadataSettings.tsx index e4c9584e3..9ac6a0158 100644 --- a/apps/core-app/src/components/MetadataSettings.tsx +++ b/apps/core-app/src/components/MetadataSettings.tsx @@ -62,7 +62,7 @@ export const MetadataSettings = ({ dao }: MetadataSettingsProps) => {

Metadata

{connectedMembership && Number(connectedMembership.shares) && ( - + )} diff --git a/apps/core-app/src/components/Profile.tsx b/apps/core-app/src/components/Profile.tsx index 6139eae40..382f0f387 100644 --- a/apps/core-app/src/components/Profile.tsx +++ b/apps/core-app/src/components/Profile.tsx @@ -140,7 +140,6 @@ export const Profile = ({ profile, membership }: ProfileProps) => { )} - {membership && dao && ( diff --git a/apps/core-app/src/components/ShamanList.tsx b/apps/core-app/src/components/ShamanList.tsx index 4e81790f2..3449b32f0 100644 --- a/apps/core-app/src/components/ShamanList.tsx +++ b/apps/core-app/src/components/ShamanList.tsx @@ -1,5 +1,5 @@ import styled from 'styled-components'; -import { AddressDisplay, Button, DataSm, widthQuery } from '@daohaus/ui'; +import { AddressDisplay, Button, DataSm, Link, widthQuery } from '@daohaus/ui'; import { TDao } from '@daohaus/dao-context'; import { useParams } from 'react-router-dom'; @@ -28,12 +28,18 @@ const ShamanContainer = styled.div` } `; +const StyledLink = styled(Link)` + :hover { + text-decoration: none; + } +`; + type ShamanListProps = { shamen: TDao['shamen']; }; export const ShamanList = ({ shamen }: ShamanListProps) => { - const { daochain } = useParams(); + const { daochain, daoid } = useParams(); return ( <> @@ -55,7 +61,18 @@ export const ShamanList = ({ shamen }: ShamanListProps) => {
{shaman.permissions} - + + +
))} diff --git a/apps/core-app/src/legos/form.ts b/apps/core-app/src/legos/form.ts index ab3205404..29a604511 100644 --- a/apps/core-app/src/legos/form.ts +++ b/apps/core-app/src/legos/form.ts @@ -6,11 +6,12 @@ import { TABULA_TX, TX } from './tx'; export const getFormLegoById = ( id: CustomFormLego['id'] ): CustomFormLego | undefined => { - const formKey = Object.keys(PROPOSAL_FORMS).find((key) => { - return PROPOSAL_FORMS[key].id === id; + const allForms = { ...PROPOSAL_FORMS, ...COMMON_FORMS }; + const formKey = Object.keys(allForms).find((key) => { + return allForms[key].id === id; }); if (!formKey) return; - return PROPOSAL_FORMS[formKey]; + return allForms[formKey]; }; // Proposal settings fields (e.g. proposal expiry, proposal offering) @@ -24,9 +25,8 @@ PROPOSAL_FORMS KEYS - SIGNAL - ISSUE - ADD_SHAMAN -- UPDATE_SHAMAN -- ISSUE_ERC20 -- ISSUE_NETWORK_TOKEN +- TRANSFER_ERC20 +- TRANSFER_NETWORK_TOKEN - UPDATE_GOV_SETTINGS - TOKEN_SETTINGS - TOKENS_FOR_SHARES @@ -36,6 +36,7 @@ PROPOSAL_FORMS KEYS COMMON_FORMS KEYS - METADATA_SETTINGS +- UPDATE_SHAMAN */ export const PROPOSAL_FORMS: Record = { @@ -114,27 +115,6 @@ export const PROPOSAL_FORMS: Record = { ...PROPOSAL_SETTINGS_FIELDS, ], }, - UPDATE_SHAMAN: { - id: 'UPDATE_SHAMAN', - title: 'Manage Shaman', - description: 'Learn more about Shamans in our documentation.', - subtitle: 'Manange Shaman Proposal', - requiredFields: { - title: true, - description: true, - shamanAddress: true, - shamanPermission: true, - }, - tx: TX.ADD_SHAMAN, - fields: [ - FIELD.TITLE, - FIELD.DESCRIPTION, - FIELD.LINK, - { ...FIELD.SHAMAN_ADDRESS, disabled: true }, - FIELD.SHAMAN_DELUXE, - ...PROPOSAL_SETTINGS_FIELDS, - ], - }, TRANSFER_ERC20: { id: 'TRANSFER_ERC20', title: 'Issue Funding (ERC20)', @@ -507,7 +487,7 @@ export const TABULA_FORMS: Record = { }, }; -export const COMMON_FORMS = { +export const COMMON_FORMS: Record = { METADATA_SETTINGS: { id: 'METADATA_SETTINGS', title: 'Update Metadata Settings', @@ -533,4 +513,25 @@ export const COMMON_FORMS = { FIELD.TAGS, ], }, + UPDATE_SHAMAN: { + id: 'UPDATE_SHAMAN', + title: 'Manage Shaman', + description: 'Learn more about Shamans in our documentation.', + subtitle: 'Manange Shaman Proposal', + requiredFields: { + title: true, + description: true, + shamanAddress: true, + shamanPermission: true, + }, + tx: TX.ADD_SHAMAN, + fields: [ + FIELD.TITLE, + FIELD.DESCRIPTION, + FIELD.LINK, + { ...FIELD.SHAMAN_ADDRESS, disabled: true }, + FIELD.SHAMAN_DELUXE, + ...PROPOSAL_SETTINGS_FIELDS, + ], + }, }; diff --git a/apps/core-app/src/pages/Members.tsx b/apps/core-app/src/pages/Members.tsx index ecb99b033..926dca540 100644 --- a/apps/core-app/src/pages/Members.tsx +++ b/apps/core-app/src/pages/Members.tsx @@ -8,6 +8,8 @@ import { AddressDisplay, Spinner, useBreakpoint, + Link, + Button, } from '@daohaus/ui'; import { charLimit, @@ -27,6 +29,7 @@ import { import { MembersOverview } from '../components/MembersOverview'; import { ProfileLink } from '../components/ProfileLink'; import { DaoTable } from '../components/DaohausTable'; +import { useParams } from 'react-router-dom'; const MemberContainer = styled(Card)` padding: 3rem; @@ -45,6 +48,12 @@ const MemberContainer = styled(Card)` } `; +const StyledButtonLink = styled(Link)` + :hover { + text-decoration: none; + } +`; + export type MembersTableType = TMembers[number]; export function Members() { @@ -58,6 +67,7 @@ export function Members() { } = useMembers(); const { connectedMembership } = useConnectedMembership(); const isMobile = useBreakpoint(widthQuery.sm); + const { daoid, daochain } = useParams(); const tableData = useMemo(() => { return members; @@ -184,14 +194,19 @@ export function Members() { return ( + + , connectedMembership && ( - ) - } + ), + ]} > {dao && } diff --git a/apps/core-app/src/pages/NewProposal.tsx b/apps/core-app/src/pages/NewProposal.tsx index d95296530..69ded665e 100644 --- a/apps/core-app/src/pages/NewProposal.tsx +++ b/apps/core-app/src/pages/NewProposal.tsx @@ -17,10 +17,22 @@ export function NewProposal() { const formLego = useMemo(() => { const params = new URLSearchParams(location.search); const legoId = params.get('formLego'); + if (!legoId) return null; return getFormLegoById(legoId); }, [location]); + const defaults = useMemo(() => { + if (formLego) { + const params = new URLSearchParams(location.search); + const defaultValues = params.get('defaultValues'); + + if (!defaultValues) return null; + return JSON.parse(defaultValues); + } + return null; + }, [location, formLego]); + if (!formLego) return null; return ( @@ -28,6 +40,7 @@ export function NewProposal() { form={formLego} customFields={CustomFields} onSuccess={onFormComplete} + defaultValues={defaults} /> ); } diff --git a/apps/core-app/src/pages/Proposals.tsx b/apps/core-app/src/pages/Proposals.tsx index 22a9f810d..7c6876b8d 100644 --- a/apps/core-app/src/pages/Proposals.tsx +++ b/apps/core-app/src/pages/Proposals.tsx @@ -30,11 +30,6 @@ const SearchFilterContainer = styled.div` gap: 2.1rem; `; -export const VALID_NEW_PROPOSALS = [ - PROPOSAL_FORMS.SIGNAL, - PROPOSAL_FORMS.SHARE_SWAP, -]; - export function Proposals() { const { proposals, diff --git a/apps/core-app/src/pages/Vaults.tsx b/apps/core-app/src/pages/Vaults.tsx index 02921c4ba..982338448 100644 --- a/apps/core-app/src/pages/Vaults.tsx +++ b/apps/core-app/src/pages/Vaults.tsx @@ -1,8 +1,17 @@ import styled from 'styled-components'; -import { Card, SingleColumnLayout, widthQuery } from '@daohaus/ui'; +import { + Button, + Card, + Link, + SingleColumnLayout, + widthQuery, +} from '@daohaus/ui'; import { useDao } from '@daohaus/dao-context'; import { VaultOverview } from '../components/VaultOverview'; +import { useParams } from 'react-router-dom'; +import { useMemo } from 'react'; +import { getNetwork } from '@daohaus/common-utilities'; const VaultContainer = styled(Card)` padding: 3rem; @@ -14,11 +23,36 @@ const VaultContainer = styled(Card)` } `; +const StyledButtonLink = styled(Link)` + :hover { + text-decoration: none; + } +`; + export function Vaults() { const { dao } = useDao(); + const { daoid, daochain } = useParams(); + const networkData = useMemo(() => { + if (!daochain) return null; + return getNetwork(daochain); + }, [daochain]); return ( - + + + , + + + , + ]} + > {dao && } ); diff --git a/libs/dao-context/src/DaoContext.tsx b/libs/dao-context/src/DaoContext.tsx index 09c5e59cb..0f55c72cf 100644 --- a/libs/dao-context/src/DaoContext.tsx +++ b/libs/dao-context/src/DaoContext.tsx @@ -235,7 +235,6 @@ export const DaoContextProvider = ({ Paging | undefined >(); - useEffect(() => { let shouldUpdate = true; if (daochain && daoid) {