From 108661efee396eadfa62b6b2cce4f87b208c391a Mon Sep 17 00:00:00 2001 From: skuhlmann Date: Wed, 6 Nov 2024 11:40:36 -0700 Subject: [PATCH 1/4] adds dao overview link --- apps/admin/src/pages/DaoOverview.tsx | 6 ++- .../src/assets/farcaster-logo.svg | 5 +++ .../components/DaoOverview/DaoOverview.tsx | 4 +- .../src/components/DaoOverview/DaoProfile.tsx | 13 +++++- .../components/Layout/MetadataLinkLists.tsx | 41 ++++++++++++++++++- libs/utils/src/utils/farcastle.ts | 27 ++++++++++++ libs/utils/src/utils/index.ts | 1 + 7 files changed, 91 insertions(+), 6 deletions(-) create mode 100644 libs/moloch-v3-macro-ui/src/assets/farcaster-logo.svg create mode 100644 libs/utils/src/utils/farcastle.ts diff --git a/apps/admin/src/pages/DaoOverview.tsx b/apps/admin/src/pages/DaoOverview.tsx index 096a4014..54a69fa3 100644 --- a/apps/admin/src/pages/DaoOverview.tsx +++ b/apps/admin/src/pages/DaoOverview.tsx @@ -10,7 +10,11 @@ export const DaoOverview = () => { return ( {dao && ( - + )} ); diff --git a/libs/moloch-v3-macro-ui/src/assets/farcaster-logo.svg b/libs/moloch-v3-macro-ui/src/assets/farcaster-logo.svg new file mode 100644 index 00000000..9ece0859 --- /dev/null +++ b/libs/moloch-v3-macro-ui/src/assets/farcaster-logo.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/libs/moloch-v3-macro-ui/src/components/DaoOverview/DaoOverview.tsx b/libs/moloch-v3-macro-ui/src/components/DaoOverview/DaoOverview.tsx index e21b79d2..b2950686 100644 --- a/libs/moloch-v3-macro-ui/src/components/DaoOverview/DaoOverview.tsx +++ b/libs/moloch-v3-macro-ui/src/components/DaoOverview/DaoOverview.tsx @@ -14,12 +14,14 @@ type DaoOverviewProps = { daoChain: ValidNetwork; daoId: string; graphApiKeys?: Keychain; + showFarcatserLink?: boolean; }; export const DaoOverview = ({ daoChain, daoId, graphApiKeys, + showFarcatserLink, }: DaoOverviewProps) => { const { dao } = useDaoData({ daoChain, @@ -34,7 +36,7 @@ export const DaoOverview = ({ {dao && ( <> - + diff --git a/libs/moloch-v3-macro-ui/src/components/DaoOverview/DaoProfile.tsx b/libs/moloch-v3-macro-ui/src/components/DaoOverview/DaoProfile.tsx index 2b78c099..03b5dc74 100644 --- a/libs/moloch-v3-macro-ui/src/components/DaoOverview/DaoProfile.tsx +++ b/libs/moloch-v3-macro-ui/src/components/DaoOverview/DaoProfile.tsx @@ -15,13 +15,19 @@ import { daoProfileHasLinks, missingDaoProfileData, } from '../../utils/daoDataDisplayHelpers'; -import { OverviewIconLinkList, OverviewLinkList, TagList } from '../Layout'; +import { + FarcasterShareLink, + OverviewIconLinkList, + OverviewLinkList, + TagList, +} from '../Layout'; type DaoProfileProps = { dao: MolochV3Dao; + showFarcatserLink?: boolean; }; -export const DaoProfile = ({ dao }: DaoProfileProps) => { +export const DaoProfile = ({ dao, showFarcatserLink }: DaoProfileProps) => { const { daoChain, daoId } = useCurrentDao(); const missingProfile = useMemo(() => { @@ -63,6 +69,9 @@ export const DaoProfile = ({ dao }: DaoProfileProps) => { )} + {showFarcatserLink && ( + + )} {dao.tags && } diff --git a/libs/moloch-v3-macro-ui/src/components/Layout/MetadataLinkLists.tsx b/libs/moloch-v3-macro-ui/src/components/Layout/MetadataLinkLists.tsx index 6b14c09b..420828fe 100644 --- a/libs/moloch-v3-macro-ui/src/components/Layout/MetadataLinkLists.tsx +++ b/libs/moloch-v3-macro-ui/src/components/Layout/MetadataLinkLists.tsx @@ -9,8 +9,9 @@ import { } from 'react-icons/ri/index.js'; import { DaoProfileLink } from '@daohaus/moloch-v3-data'; -import { DataMd, Link, ParMd } from '@daohaus/ui'; -import { charLimit } from '@daohaus/utils'; +import { DataMd, DataSm, Link, ParMd } from '@daohaus/ui'; +import { charLimit, getFarcastleFramemUrl } from '@daohaus/utils'; +import FarcasterLogo from '../../assets/farcaster-logo.svg'; export const isPredefinedSettingsLink = (link: DaoProfileLink) => { return ( @@ -40,6 +41,19 @@ const IconLinkContainer = styled.div` margin: 1.5rem 0; `; +const FarcasterLinkContainer = styled.div` + display: flex; + gap: 1.5rem; + margin: 1.5rem 0; + padding-left: 0.5rem; +`; + +const FarcasterLinkContents = styled.div` + display: flex; + align-items: center; + gap: 0.5rem; +`; + const MetadataLinkIcons: { [key: string]: React.ReactNode } = { Github: , Discord: , @@ -117,3 +131,26 @@ export const OverviewLinkList = ({ links }: LinkListsProps) => { ); }; + +export const FarcasterShareLink = ({ + daoId, + daoChain, + location, +}: { + daoId?: string; + daoChain?: string; + location?: string; +}) => { + if (!daoId || !daoChain) return null; + const url = getFarcastleFramemUrl({ daoId, daoChain, location }); + return ( + + + + farcaster + Cast Farcastle Frame + + + + ); +}; diff --git a/libs/utils/src/utils/farcastle.ts b/libs/utils/src/utils/farcastle.ts new file mode 100644 index 00000000..ceae6d7e --- /dev/null +++ b/libs/utils/src/utils/farcastle.ts @@ -0,0 +1,27 @@ +export const getFarcastleFramemUrl = ({ + daoChain, + daoId, + location, +}: { + daoChain: string; + daoId: string; + location?: string; +}): string | undefined => { + if (daoChain === '0xaa36a7') return; + const baseUrl = `https://warpcast.com/~/compose?text=&embeds[]=https://frames.farcastle.net/molochv3/${daoChain}/${daoId}`; + + return location ? `${baseUrl}/${location}` : baseUrl; +}; + +// https://warpcast.com/~/compose?text=&embeds[]=https://frames.farcastle.net/molochv3/0x64/0xe2f816d08c568a447d3804b265f1e277bc2c688d + +// app.frame("molochv3/:chainid/:daoid", async (c) => { +// return daoHomeFrame(c); +// }); +// // app.frame("molochv3/:chainid/:daoid/proposals", async (c) => { +// // return proposalFrame(c); +// // }); +// app.frame("molochv3/:chainid/:daoid/proposals/:proposalids", async (c) => { +// return proposalFrame(c); +// }); +// app.frame("molochv3/:chainid/:daoid/proposals/:proposalids/vote", async (c) => { diff --git a/libs/utils/src/utils/index.ts b/libs/utils/src/utils/index.ts index b551bb03..25cab037 100644 --- a/libs/utils/src/utils/index.ts +++ b/libs/utils/src/utils/index.ts @@ -2,6 +2,7 @@ export * from './cache'; export * from './dates'; export * from './gas'; export * from './general'; +export * from './farcastle'; export * from './formatting'; export * from './gnosis'; export * from './typeguards'; From de544a3402b3e86c7c071b31505735d27117cdc0 Mon Sep 17 00:00:00 2001 From: skuhlmann Date: Wed, 6 Nov 2024 11:52:05 -0700 Subject: [PATCH 2/4] adds to settings --- apps/admin/src/pages/DaoOverview.tsx | 3 ++- apps/admin/src/pages/Settings.tsx | 2 ++ .../src/components/DaoOverview/DaoOverview.tsx | 6 +++--- .../src/components/DaoOverview/DaoProfile.tsx | 6 +++--- .../src/components/DaoSettings/DaoSettings.tsx | 3 +++ .../src/components/DaoSettings/MetadataSettings.tsx | 12 +++++++++++- .../src/components/Layout/MetadataLinkLists.tsx | 4 ++-- libs/utils/src/utils/farcastle.ts | 2 ++ 8 files changed, 28 insertions(+), 10 deletions(-) diff --git a/apps/admin/src/pages/DaoOverview.tsx b/apps/admin/src/pages/DaoOverview.tsx index 54a69fa3..bc03651a 100644 --- a/apps/admin/src/pages/DaoOverview.tsx +++ b/apps/admin/src/pages/DaoOverview.tsx @@ -2,6 +2,7 @@ import { useCurrentDao, useDaoData } from '@daohaus/moloch-v3-hooks'; import { SingleColumnLayout } from '@daohaus/ui'; import { DaoOverview as DaoOverviewCard } from '@daohaus/moloch-v3-macro-ui'; import { Keychain } from '@daohaus/keychain-utils'; +import { farcastleChain } from '@daohaus/utils'; export const DaoOverview = () => { const { daoChain } = useCurrentDao(); @@ -13,7 +14,7 @@ export const DaoOverview = () => { )} diff --git a/apps/admin/src/pages/Settings.tsx b/apps/admin/src/pages/Settings.tsx index dc1dbbde..68e676db 100644 --- a/apps/admin/src/pages/Settings.tsx +++ b/apps/admin/src/pages/Settings.tsx @@ -3,6 +3,7 @@ import { useCurrentDao, useDaoData } from '@daohaus/moloch-v3-hooks'; import { SingleColumnLayout } from '@daohaus/ui'; import { DaoSettings } from '@daohaus/moloch-v3-macro-ui'; import { Keychain } from '@daohaus/keychain-utils'; +import { farcastleChain } from '@daohaus/utils'; export const Settings = () => { const { daoChain } = useCurrentDao(); @@ -15,6 +16,7 @@ export const Settings = () => { daoChain={daoChain as keyof Keychain} daoId={dao.id} includeLinks={true} + showFarcasterLink={farcastleChain(daoChain)} /> )} diff --git a/libs/moloch-v3-macro-ui/src/components/DaoOverview/DaoOverview.tsx b/libs/moloch-v3-macro-ui/src/components/DaoOverview/DaoOverview.tsx index b2950686..c8125c4d 100644 --- a/libs/moloch-v3-macro-ui/src/components/DaoOverview/DaoOverview.tsx +++ b/libs/moloch-v3-macro-ui/src/components/DaoOverview/DaoOverview.tsx @@ -14,14 +14,14 @@ type DaoOverviewProps = { daoChain: ValidNetwork; daoId: string; graphApiKeys?: Keychain; - showFarcatserLink?: boolean; + showFarcasterLink?: boolean; }; export const DaoOverview = ({ daoChain, daoId, graphApiKeys, - showFarcatserLink, + showFarcasterLink, }: DaoOverviewProps) => { const { dao } = useDaoData({ daoChain, @@ -36,7 +36,7 @@ export const DaoOverview = ({ {dao && ( <> - + diff --git a/libs/moloch-v3-macro-ui/src/components/DaoOverview/DaoProfile.tsx b/libs/moloch-v3-macro-ui/src/components/DaoOverview/DaoProfile.tsx index 03b5dc74..9cd49924 100644 --- a/libs/moloch-v3-macro-ui/src/components/DaoOverview/DaoProfile.tsx +++ b/libs/moloch-v3-macro-ui/src/components/DaoOverview/DaoProfile.tsx @@ -24,10 +24,10 @@ import { type DaoProfileProps = { dao: MolochV3Dao; - showFarcatserLink?: boolean; + showFarcasterLink?: boolean; }; -export const DaoProfile = ({ dao, showFarcatserLink }: DaoProfileProps) => { +export const DaoProfile = ({ dao, showFarcasterLink }: DaoProfileProps) => { const { daoChain, daoId } = useCurrentDao(); const missingProfile = useMemo(() => { @@ -69,7 +69,7 @@ export const DaoProfile = ({ dao, showFarcatserLink }: DaoProfileProps) => { )} - {showFarcatserLink && ( + {showFarcasterLink && ( )} diff --git a/libs/moloch-v3-macro-ui/src/components/DaoSettings/DaoSettings.tsx b/libs/moloch-v3-macro-ui/src/components/DaoSettings/DaoSettings.tsx index c3508f41..0b1cdb9f 100644 --- a/libs/moloch-v3-macro-ui/src/components/DaoSettings/DaoSettings.tsx +++ b/libs/moloch-v3-macro-ui/src/components/DaoSettings/DaoSettings.tsx @@ -13,6 +13,7 @@ type DaoSettingsProps = { daoId: string; includeLinks?: boolean; graphApiKeys?: Keychain; + showFarcasterLink?: boolean; }; export const DaoSettings = ({ @@ -20,6 +21,7 @@ export const DaoSettings = ({ daoId, includeLinks = false, graphApiKeys, + showFarcasterLink, }: DaoSettingsProps) => { const { dao } = useDaoData({ daoChain, @@ -35,6 +37,7 @@ export const DaoSettings = ({ dao={dao} daoChain={daoChain} includeLinks={includeLinks} + showFarcasterLink={showFarcasterLink} /> diff --git a/libs/moloch-v3-macro-ui/src/components/DaoSettings/MetadataSettings.tsx b/libs/moloch-v3-macro-ui/src/components/DaoSettings/MetadataSettings.tsx index ba679a59..ea4c385b 100644 --- a/libs/moloch-v3-macro-ui/src/components/DaoSettings/MetadataSettings.tsx +++ b/libs/moloch-v3-macro-ui/src/components/DaoSettings/MetadataSettings.tsx @@ -25,7 +25,12 @@ import { } from './DaoSettings.styles'; import { useDHConnect } from '@daohaus/connect'; import { useDaoMember } from '@daohaus/moloch-v3-hooks'; -import { ButtonRouterLink, SettingsLinkList, TagList } from '../Layout'; +import { + ButtonRouterLink, + FarcasterShareLink, + SettingsLinkList, + TagList, +} from '../Layout'; import { daoProfileHasLinks } from '../../utils/daoDataDisplayHelpers'; import { useMemo } from 'react'; @@ -33,12 +38,14 @@ type MetadataSettingsProps = { dao: MolochV3Dao; daoChain: ValidNetwork; includeLinks?: boolean; + showFarcasterLink?: boolean; }; export const MetadataSettings = ({ dao, daoChain, includeLinks, + showFarcasterLink, }: MetadataSettingsProps) => { const { address } = useDHConnect(); const { member } = useDaoMember({ @@ -96,6 +103,9 @@ export const MetadataSettings = ({ {daoProfileHasLinks(dao.links) && ( )} + {showFarcasterLink && ( + + )} {dao.forwarder !== ZERO_ADDRESS && (
diff --git a/libs/moloch-v3-macro-ui/src/components/Layout/MetadataLinkLists.tsx b/libs/moloch-v3-macro-ui/src/components/Layout/MetadataLinkLists.tsx index 420828fe..d1978ce7 100644 --- a/libs/moloch-v3-macro-ui/src/components/Layout/MetadataLinkLists.tsx +++ b/libs/moloch-v3-macro-ui/src/components/Layout/MetadataLinkLists.tsx @@ -147,8 +147,8 @@ export const FarcasterShareLink = ({ - farcaster - Cast Farcastle Frame + farcaster + Cast Farcastle Frame diff --git a/libs/utils/src/utils/farcastle.ts b/libs/utils/src/utils/farcastle.ts index ceae6d7e..9bd38571 100644 --- a/libs/utils/src/utils/farcastle.ts +++ b/libs/utils/src/utils/farcastle.ts @@ -13,6 +13,8 @@ export const getFarcastleFramemUrl = ({ return location ? `${baseUrl}/${location}` : baseUrl; }; +export const farcastleChain = (daoChain?: string) => daoChain !== '0xaa36a7'; + // https://warpcast.com/~/compose?text=&embeds[]=https://frames.farcastle.net/molochv3/0x64/0xe2f816d08c568a447d3804b265f1e277bc2c688d // app.frame("molochv3/:chainid/:daoid", async (c) => { From 01a6e0c403028aaa726d73ebd1394cd34ddb97c7 Mon Sep 17 00:00:00 2001 From: skuhlmann Date: Wed, 6 Nov 2024 11:57:58 -0700 Subject: [PATCH 3/4] adds farcastle links --- apps/admin/src/pages/Proposal.tsx | 2 ++ .../ProposalDetails/ProposalDetails.tsx | 11 +++++++++++ .../ProposalDetailsContainer.tsx | 3 +++ libs/utils/src/utils/farcastle.ts | 17 ++--------------- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/apps/admin/src/pages/Proposal.tsx b/apps/admin/src/pages/Proposal.tsx index cd4f50a8..6344b86d 100644 --- a/apps/admin/src/pages/Proposal.tsx +++ b/apps/admin/src/pages/Proposal.tsx @@ -12,6 +12,7 @@ import { import { BiColumnLayout, Card, ParLg, Loading, widthQuery } from '@daohaus/ui'; import { DAO_METHOD_TO_PROPOSAL_TYPE, + farcastleChain, getProposalTypeLabel, PROPOSAL_TYPE_LABELS, PROPOSAL_TYPE_WARNINGS, @@ -95,6 +96,7 @@ export const Proposal = () => { daoId={daoId} proposal={proposal} includeLinks={true} + showFarcasterLink={farcastleChain(daoChain)} proposalActionConfig={{ sensitiveProposalTypes: SENSITIVE_PROPOSAL_TYPES, actionToProposalType: DAO_METHOD_TO_PROPOSAL_TYPE, diff --git a/libs/moloch-v3-macro-ui/src/components/ProposalDetails/ProposalDetails.tsx b/libs/moloch-v3-macro-ui/src/components/ProposalDetails/ProposalDetails.tsx index 26bbf545..353aca1a 100644 --- a/libs/moloch-v3-macro-ui/src/components/ProposalDetails/ProposalDetails.tsx +++ b/libs/moloch-v3-macro-ui/src/components/ProposalDetails/ProposalDetails.tsx @@ -30,6 +30,7 @@ import styled from 'styled-components'; import { ProposalActionConfig } from '../ProposalActionData'; import ReactMarkdown from 'react-markdown'; +import { FarcasterShareLink } from '../Layout'; const Spacer = styled.div` margin-bottom: 2rem; @@ -66,6 +67,7 @@ type ProposalDetailsProps = { actionData?: DecodedMultiTX | null; decodeError: boolean; proposalActionConfig?: ProposalActionConfig; + showFarcasterLink?: boolean; }; export const ProposalDetails = ({ @@ -76,6 +78,7 @@ export const ProposalDetails = ({ actionData, decodeError = false, proposalActionConfig, + showFarcasterLink, }: ProposalDetailsProps) => { const { networks } = useDHConnect(); const { profile: submitterProfile } = useProfile({ @@ -203,6 +206,14 @@ export const ProposalDetails = ({ daoChain={daoChain} proposalActionConfig={proposalActionConfig} /> + + {showFarcasterLink && ( + + )} ); }; diff --git a/libs/moloch-v3-macro-ui/src/components/ProposalDetails/ProposalDetailsContainer.tsx b/libs/moloch-v3-macro-ui/src/components/ProposalDetails/ProposalDetailsContainer.tsx index d6678f17..7e13773d 100644 --- a/libs/moloch-v3-macro-ui/src/components/ProposalDetails/ProposalDetailsContainer.tsx +++ b/libs/moloch-v3-macro-ui/src/components/ProposalDetails/ProposalDetailsContainer.tsx @@ -29,6 +29,7 @@ type ProposalDetailsContainerProps = { includeLinks: boolean; proposalActionConfig?: ProposalActionConfig; txLegos?: Record; + showFarcasterLink?: boolean; }; export const ProposalDetailsContainer = ({ @@ -36,6 +37,7 @@ export const ProposalDetailsContainer = ({ daoId, proposal, includeLinks = false, + showFarcasterLink, proposalActionConfig = { sensitiveProposalTypes: SENSITIVE_PROPOSAL_TYPES, actionToProposalType: DAO_METHOD_TO_PROPOSAL_TYPE, @@ -92,6 +94,7 @@ export const ProposalDetailsContainer = ({ actionData={actionData} decodeError={decodeError} includeLinks={includeLinks} + showFarcasterLink={showFarcasterLink} proposalActionConfig={proposalActionConfig} /> daoChain !== '0xaa36a7'; + export const getFarcastleFramemUrl = ({ daoChain, daoId, @@ -12,18 +14,3 @@ export const getFarcastleFramemUrl = ({ return location ? `${baseUrl}/${location}` : baseUrl; }; - -export const farcastleChain = (daoChain?: string) => daoChain !== '0xaa36a7'; - -// https://warpcast.com/~/compose?text=&embeds[]=https://frames.farcastle.net/molochv3/0x64/0xe2f816d08c568a447d3804b265f1e277bc2c688d - -// app.frame("molochv3/:chainid/:daoid", async (c) => { -// return daoHomeFrame(c); -// }); -// // app.frame("molochv3/:chainid/:daoid/proposals", async (c) => { -// // return proposalFrame(c); -// // }); -// app.frame("molochv3/:chainid/:daoid/proposals/:proposalids", async (c) => { -// return proposalFrame(c); -// }); -// app.frame("molochv3/:chainid/:daoid/proposals/:proposalids/vote", async (c) => { From bacd3dca2cbf99c44634cd6660e995df91a58ad8 Mon Sep 17 00:00:00 2001 From: skuhlmann Date: Wed, 6 Nov 2024 17:05:33 -0700 Subject: [PATCH 4/4] finishes farcastle links --- apps/admin/src/components/CancelProposal.tsx | 1 + apps/admin/src/pages/Proposal.tsx | 26 +++++++++++--- apps/admin/src/pages/Settings.tsx | 2 -- .../src/assets/farcaster-logo-yellow.svg | 5 +++ .../src/assets/farcaster-logo.svg | 6 ++-- .../DaoSettings/DaoSettings.styles.ts | 6 ++++ .../components/DaoSettings/DaoSettings.tsx | 3 -- .../DaoSettings/FarcastleButton.tsx | 28 +++++++++++++++ .../DaoSettings/MetadataSettings.tsx | 36 +++++++++---------- .../src/components/DaoSettings/index.ts | 1 + .../components/Layout/MetadataLinkLists.tsx | 4 +-- .../ProposalDetails/ProposalDetails.tsx | 10 ------ .../ProposalDetailsContainer.tsx | 3 -- 13 files changed, 85 insertions(+), 46 deletions(-) create mode 100644 libs/moloch-v3-macro-ui/src/assets/farcaster-logo-yellow.svg create mode 100644 libs/moloch-v3-macro-ui/src/components/DaoSettings/FarcastleButton.tsx diff --git a/apps/admin/src/components/CancelProposal.tsx b/apps/admin/src/components/CancelProposal.tsx index 48cf2ac8..4e594a53 100644 --- a/apps/admin/src/components/CancelProposal.tsx +++ b/apps/admin/src/components/CancelProposal.tsx @@ -110,6 +110,7 @@ export const CancelProposal = ({ color="secondary" rules={[daoExists, isConnectedToDao, addressCanCancel]} onClick={handleCancel} + style={{ paddingLeft: '1rem', paddingRight: '1rem' }} // centerAlign > {isLoading ? : 'Cancel'} diff --git a/apps/admin/src/pages/Proposal.tsx b/apps/admin/src/pages/Proposal.tsx index 6344b86d..e9c7b0e6 100644 --- a/apps/admin/src/pages/Proposal.tsx +++ b/apps/admin/src/pages/Proposal.tsx @@ -5,23 +5,33 @@ import { useDaoProposal, } from '@daohaus/moloch-v3-hooks'; import { + FarcastleButton, ProposalActions, ProposalDetailsContainer, ProposalHistory, } from '@daohaus/moloch-v3-macro-ui'; -import { BiColumnLayout, Card, ParLg, Loading, widthQuery } from '@daohaus/ui'; +import { + BiColumnLayout, + Card, + ParLg, + Loading, + widthQuery, + Button, +} from '@daohaus/ui'; import { DAO_METHOD_TO_PROPOSAL_TYPE, farcastleChain, + getFarcastleFramemUrl, getProposalTypeLabel, PROPOSAL_TYPE_LABELS, PROPOSAL_TYPE_WARNINGS, - ProposalTypeIds, SENSITIVE_PROPOSAL_TYPES, } from '@daohaus/utils'; import { CancelProposal } from '../components/CancelProposal'; +import FarcasterLogo from '../assets/farcaster-logo.svg'; + const LoadingContainer = styled.div` margin-top: 5rem; `; @@ -85,7 +95,16 @@ export const Proposal = () => { )}`} actions={ proposal && ( - refetch()} /> + <> + refetch()} /> + {farcastleChain(daoChain) && ( + + )} + ) } left={ @@ -96,7 +115,6 @@ export const Proposal = () => { daoId={daoId} proposal={proposal} includeLinks={true} - showFarcasterLink={farcastleChain(daoChain)} proposalActionConfig={{ sensitiveProposalTypes: SENSITIVE_PROPOSAL_TYPES, actionToProposalType: DAO_METHOD_TO_PROPOSAL_TYPE, diff --git a/apps/admin/src/pages/Settings.tsx b/apps/admin/src/pages/Settings.tsx index 68e676db..dc1dbbde 100644 --- a/apps/admin/src/pages/Settings.tsx +++ b/apps/admin/src/pages/Settings.tsx @@ -3,7 +3,6 @@ import { useCurrentDao, useDaoData } from '@daohaus/moloch-v3-hooks'; import { SingleColumnLayout } from '@daohaus/ui'; import { DaoSettings } from '@daohaus/moloch-v3-macro-ui'; import { Keychain } from '@daohaus/keychain-utils'; -import { farcastleChain } from '@daohaus/utils'; export const Settings = () => { const { daoChain } = useCurrentDao(); @@ -16,7 +15,6 @@ export const Settings = () => { daoChain={daoChain as keyof Keychain} daoId={dao.id} includeLinks={true} - showFarcasterLink={farcastleChain(daoChain)} /> )} diff --git a/libs/moloch-v3-macro-ui/src/assets/farcaster-logo-yellow.svg b/libs/moloch-v3-macro-ui/src/assets/farcaster-logo-yellow.svg new file mode 100644 index 00000000..9ece0859 --- /dev/null +++ b/libs/moloch-v3-macro-ui/src/assets/farcaster-logo-yellow.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/libs/moloch-v3-macro-ui/src/assets/farcaster-logo.svg b/libs/moloch-v3-macro-ui/src/assets/farcaster-logo.svg index 9ece0859..49d9c151 100644 --- a/libs/moloch-v3-macro-ui/src/assets/farcaster-logo.svg +++ b/libs/moloch-v3-macro-ui/src/assets/farcaster-logo.svg @@ -1,5 +1,5 @@ - - - + + + \ No newline at end of file diff --git a/libs/moloch-v3-macro-ui/src/components/DaoSettings/DaoSettings.styles.ts b/libs/moloch-v3-macro-ui/src/components/DaoSettings/DaoSettings.styles.ts index fbb78c07..ecb8cc76 100644 --- a/libs/moloch-v3-macro-ui/src/components/DaoSettings/DaoSettings.styles.ts +++ b/libs/moloch-v3-macro-ui/src/components/DaoSettings/DaoSettings.styles.ts @@ -20,6 +20,12 @@ export const MetaCardHeader = styled.div` margin-bottom: 3rem; `; +export const MetaCardLinks = styled.div` + display: flex; + flex-wrap: wrap; + gap: 1rem; +`; + export const MetaContent = styled.div` display: flex; justify-content: flex-start; diff --git a/libs/moloch-v3-macro-ui/src/components/DaoSettings/DaoSettings.tsx b/libs/moloch-v3-macro-ui/src/components/DaoSettings/DaoSettings.tsx index 0b1cdb9f..c3508f41 100644 --- a/libs/moloch-v3-macro-ui/src/components/DaoSettings/DaoSettings.tsx +++ b/libs/moloch-v3-macro-ui/src/components/DaoSettings/DaoSettings.tsx @@ -13,7 +13,6 @@ type DaoSettingsProps = { daoId: string; includeLinks?: boolean; graphApiKeys?: Keychain; - showFarcasterLink?: boolean; }; export const DaoSettings = ({ @@ -21,7 +20,6 @@ export const DaoSettings = ({ daoId, includeLinks = false, graphApiKeys, - showFarcasterLink, }: DaoSettingsProps) => { const { dao } = useDaoData({ daoChain, @@ -37,7 +35,6 @@ export const DaoSettings = ({ dao={dao} daoChain={daoChain} includeLinks={includeLinks} - showFarcasterLink={showFarcasterLink} /> diff --git a/libs/moloch-v3-macro-ui/src/components/DaoSettings/FarcastleButton.tsx b/libs/moloch-v3-macro-ui/src/components/DaoSettings/FarcastleButton.tsx new file mode 100644 index 00000000..b71dbfe9 --- /dev/null +++ b/libs/moloch-v3-macro-ui/src/components/DaoSettings/FarcastleButton.tsx @@ -0,0 +1,28 @@ +import { Button } from '@daohaus/ui'; +import { getFarcastleFramemUrl } from '@daohaus/utils'; + +import FarcasterLogo from '../../assets/farcaster-logo.svg'; + +export const FarcastleButton = ({ + daoId, + daoChain, + location, +}: { + daoId: string; + daoChain: string; + location?: string; +}) => { + return ( + + ); +}; diff --git a/libs/moloch-v3-macro-ui/src/components/DaoSettings/MetadataSettings.tsx b/libs/moloch-v3-macro-ui/src/components/DaoSettings/MetadataSettings.tsx index ea4c385b..d2053194 100644 --- a/libs/moloch-v3-macro-ui/src/components/DaoSettings/MetadataSettings.tsx +++ b/libs/moloch-v3-macro-ui/src/components/DaoSettings/MetadataSettings.tsx @@ -10,6 +10,7 @@ import { import { charLimit, + farcastleChain, formatLongDateFromSeconds, ZERO_ADDRESS, } from '@daohaus/utils'; @@ -19,33 +20,28 @@ import { MolochV3Dao } from '@daohaus/moloch-v3-data'; import { DaoProfileAvatar, MetaCardHeader, + MetaCardLinks, MetaContent, SettingsContainer, WarningContainer, } from './DaoSettings.styles'; import { useDHConnect } from '@daohaus/connect'; import { useDaoMember } from '@daohaus/moloch-v3-hooks'; -import { - ButtonRouterLink, - FarcasterShareLink, - SettingsLinkList, - TagList, -} from '../Layout'; +import { ButtonRouterLink, SettingsLinkList, TagList } from '../Layout'; import { daoProfileHasLinks } from '../../utils/daoDataDisplayHelpers'; import { useMemo } from 'react'; +import { FarcastleButton } from './FarcastleButton'; type MetadataSettingsProps = { dao: MolochV3Dao; daoChain: ValidNetwork; includeLinks?: boolean; - showFarcasterLink?: boolean; }; export const MetadataSettings = ({ dao, daoChain, includeLinks, - showFarcasterLink, }: MetadataSettingsProps) => { const { address } = useDHConnect(); const { member } = useDaoMember({ @@ -64,14 +60,19 @@ export const MetadataSettings = ({

Metadata

- {includeLinks && enableActions && ( - - Update Metadata - - )} + + {includeLinks && enableActions && ( + + Update Metadata + + )} + {farcastleChain(daoChain) && ( + + )} +
@@ -103,9 +104,6 @@ export const MetadataSettings = ({ {daoProfileHasLinks(dao.links) && ( )} - {showFarcasterLink && ( - - )} {dao.forwarder !== ZERO_ADDRESS && (
diff --git a/libs/moloch-v3-macro-ui/src/components/DaoSettings/index.ts b/libs/moloch-v3-macro-ui/src/components/DaoSettings/index.ts index 4b1c5053..1901740d 100644 --- a/libs/moloch-v3-macro-ui/src/components/DaoSettings/index.ts +++ b/libs/moloch-v3-macro-ui/src/components/DaoSettings/index.ts @@ -1,5 +1,6 @@ export * from './ContractSettings'; export * from './DaoSettings'; +export * from './FarcastleButton'; export * from './GovernanceSettings'; export * from './MetadataSettings'; export * from './ShamanSettings'; diff --git a/libs/moloch-v3-macro-ui/src/components/Layout/MetadataLinkLists.tsx b/libs/moloch-v3-macro-ui/src/components/Layout/MetadataLinkLists.tsx index d1978ce7..d9cd107b 100644 --- a/libs/moloch-v3-macro-ui/src/components/Layout/MetadataLinkLists.tsx +++ b/libs/moloch-v3-macro-ui/src/components/Layout/MetadataLinkLists.tsx @@ -9,9 +9,9 @@ import { } from 'react-icons/ri/index.js'; import { DaoProfileLink } from '@daohaus/moloch-v3-data'; -import { DataMd, DataSm, Link, ParMd } from '@daohaus/ui'; +import { DataMd, Link, ParMd } from '@daohaus/ui'; import { charLimit, getFarcastleFramemUrl } from '@daohaus/utils'; -import FarcasterLogo from '../../assets/farcaster-logo.svg'; +import FarcasterLogo from '../../assets/farcaster-logo-yellow.svg'; export const isPredefinedSettingsLink = (link: DaoProfileLink) => { return ( diff --git a/libs/moloch-v3-macro-ui/src/components/ProposalDetails/ProposalDetails.tsx b/libs/moloch-v3-macro-ui/src/components/ProposalDetails/ProposalDetails.tsx index 353aca1a..5dd6f779 100644 --- a/libs/moloch-v3-macro-ui/src/components/ProposalDetails/ProposalDetails.tsx +++ b/libs/moloch-v3-macro-ui/src/components/ProposalDetails/ProposalDetails.tsx @@ -67,7 +67,6 @@ type ProposalDetailsProps = { actionData?: DecodedMultiTX | null; decodeError: boolean; proposalActionConfig?: ProposalActionConfig; - showFarcasterLink?: boolean; }; export const ProposalDetails = ({ @@ -78,7 +77,6 @@ export const ProposalDetails = ({ actionData, decodeError = false, proposalActionConfig, - showFarcasterLink, }: ProposalDetailsProps) => { const { networks } = useDHConnect(); const { profile: submitterProfile } = useProfile({ @@ -206,14 +204,6 @@ export const ProposalDetails = ({ daoChain={daoChain} proposalActionConfig={proposalActionConfig} /> - - {showFarcasterLink && ( - - )} ); }; diff --git a/libs/moloch-v3-macro-ui/src/components/ProposalDetails/ProposalDetailsContainer.tsx b/libs/moloch-v3-macro-ui/src/components/ProposalDetails/ProposalDetailsContainer.tsx index 7e13773d..d6678f17 100644 --- a/libs/moloch-v3-macro-ui/src/components/ProposalDetails/ProposalDetailsContainer.tsx +++ b/libs/moloch-v3-macro-ui/src/components/ProposalDetails/ProposalDetailsContainer.tsx @@ -29,7 +29,6 @@ type ProposalDetailsContainerProps = { includeLinks: boolean; proposalActionConfig?: ProposalActionConfig; txLegos?: Record; - showFarcasterLink?: boolean; }; export const ProposalDetailsContainer = ({ @@ -37,7 +36,6 @@ export const ProposalDetailsContainer = ({ daoId, proposal, includeLinks = false, - showFarcasterLink, proposalActionConfig = { sensitiveProposalTypes: SENSITIVE_PROPOSAL_TYPES, actionToProposalType: DAO_METHOD_TO_PROPOSAL_TYPE, @@ -94,7 +92,6 @@ export const ProposalDetailsContainer = ({ actionData={actionData} decodeError={decodeError} includeLinks={includeLinks} - showFarcasterLink={showFarcasterLink} proposalActionConfig={proposalActionConfig} />