From da163785109b5ed0ea61f6be61aa37c973e5f031 Mon Sep 17 00:00:00 2001 From: jordan Date: Thu, 8 Aug 2024 14:08:01 -0700 Subject: [PATCH 1/2] rich text editor box resizes --- src/.graphclient/index.ts | 6 +++--- src/components/RTEditor.tsx | 7 ++++--- src/components/feed/RichTextUpdate.tsx | 2 +- src/components/grant/AllocationComplete.tsx | 2 +- src/components/grant/GrantCard.tsx | 4 ++-- src/contexts/GlobalState.tsx | 2 +- src/graphql/newQueries/getProjects.graphql | 4 ++-- src/pages/MyProjects.tsx | 1 - src/pages/Projects.tsx | 2 +- src/queries/getProjectCards.ts | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/.graphclient/index.ts b/src/.graphclient/index.ts index 9ab869f2..be794e5d 100644 --- a/src/.graphclient/index.ts +++ b/src/.graphclient/index.ts @@ -10253,7 +10253,7 @@ export type GetProjectsQuery = { Project: Array<( )> }; export type GetUserProjectsQueryVariables = Exact<{ - id: Scalars['String']; + chainId: Scalars['String']; }>; @@ -10889,10 +10889,10 @@ export const GetProjectsDocument = gql` ${ProjectDetailsFragmentDoc} ${RawMetadataFragmentDoc}` as unknown as DocumentNode; export const GetUserProjectsDocument = gql` - query GetUserProjects($id: String!) { + query GetUserProjects($chainId: String!) { Project( order_by: {db_write_timestamp: desc, hasEditedProfile: desc_nulls_last} - where: {owner: {_eq: $id}} + where: {owner: {_eq: $chainId}} ) { ...ProjectDetails metadata { diff --git a/src/components/RTEditor.tsx b/src/components/RTEditor.tsx index 070fa0ee..2ed3e870 100644 --- a/src/components/RTEditor.tsx +++ b/src/components/RTEditor.tsx @@ -35,9 +35,9 @@ export const RTEditor = ({ return ( @@ -65,7 +65,8 @@ export const RTEditor = ({ p="lg" fz="md" bg={'transparent'} - mih={editorHeight} + // mih={editorHeight} + // h="100%" onClick={handleContentEditorFocus} /> diff --git a/src/components/feed/RichTextUpdate.tsx b/src/components/feed/RichTextUpdate.tsx index 8874ba07..d6ad945b 100644 --- a/src/components/feed/RichTextUpdate.tsx +++ b/src/components/feed/RichTextUpdate.tsx @@ -50,7 +50,7 @@ export const RichTextUpdate = () => { isLoading, error, } = useQuery({ - queryKey: ['post', id], + queryKey: ['post', id, chainId], queryFn: () => getRTUpdate(id as string, chainId), enabled: !!id, }); diff --git a/src/components/grant/AllocationComplete.tsx b/src/components/grant/AllocationComplete.tsx index d250b5b4..def5f73f 100644 --- a/src/components/grant/AllocationComplete.tsx +++ b/src/components/grant/AllocationComplete.tsx @@ -1,7 +1,7 @@ import { formatEther } from 'viem'; import { useGrant } from '../../hooks/useGrant'; import { InsetUpdate } from './InsetUpdate'; -import { IconLock, IconShieldHalf } from '@tabler/icons-react'; +import { IconShieldHalf } from '@tabler/icons-react'; import { Text } from '@mantine/core'; import { Bold } from '../Typography'; import { GAME_TOKEN } from '../../constants/gameSetup'; diff --git a/src/components/grant/GrantCard.tsx b/src/components/grant/GrantCard.tsx index 9ea69d0f..c5036ff4 100644 --- a/src/components/grant/GrantCard.tsx +++ b/src/components/grant/GrantCard.tsx @@ -106,7 +106,7 @@ const GrantStatusIndicator = ({ if (status === GrantStatus.ApplicationSubmitted) { return ( } /> ); @@ -122,7 +122,7 @@ const GrantStatusIndicator = ({ if (status === GrantStatus.ApplicationApproved) { return ( } /> ); diff --git a/src/contexts/GlobalState.tsx b/src/contexts/GlobalState.tsx index 676086b3..43ed01db 100644 --- a/src/contexts/GlobalState.tsx +++ b/src/contexts/GlobalState.tsx @@ -47,7 +47,7 @@ export const GlobalStateProvider = ({ error: userStateError, refetch: refetchUserState, } = useQuery({ - queryKey: [`user-state-${address}`], + queryKey: [`user-state-${address}`, chainId], queryFn: () => getUserData(address as string, chainId), enabled: !!address, }); diff --git a/src/graphql/newQueries/getProjects.graphql b/src/graphql/newQueries/getProjects.graphql index 0c0695e7..5e8a77a5 100644 --- a/src/graphql/newQueries/getProjects.graphql +++ b/src/graphql/newQueries/getProjects.graphql @@ -24,10 +24,10 @@ query GetProjects($chainId: Int!) { } } -query GetUserProjects($id: String!) { +query GetUserProjects($chainId: String!) { Project( order_by: { db_write_timestamp: desc, hasEditedProfile: desc_nulls_last } - where: { owner: { _eq: $id } } + where: { owner: { _eq: $chainId } } ) { ...ProjectDetails metadata { diff --git a/src/pages/MyProjects.tsx b/src/pages/MyProjects.tsx index cc777717..76be913f 100644 --- a/src/pages/MyProjects.tsx +++ b/src/pages/MyProjects.tsx @@ -43,7 +43,6 @@ const getUserProjects = async (projects: ProjectCardFromQuery[]) => { }; export const MyProjects = () => { - const chainId = useChainId(); const { id } = useParams(); const theme = useMantineTheme(); diff --git a/src/pages/Projects.tsx b/src/pages/Projects.tsx index 323a0e28..4821cc7c 100644 --- a/src/pages/Projects.tsx +++ b/src/pages/Projects.tsx @@ -16,7 +16,7 @@ export const Projects = () => { const chainId = useChainId(); const { data, isLoading, error } = useQuery({ - queryKey: ['projects'], + queryKey: ['projects', chainId], queryFn: () => getProjectCards({ chainId }), enabled: !!chainId, }); diff --git a/src/queries/getProjectCards.ts b/src/queries/getProjectCards.ts index ad0c2391..2cb104cc 100644 --- a/src/queries/getProjectCards.ts +++ b/src/queries/getProjectCards.ts @@ -40,7 +40,7 @@ const projectMetadataResolver = async (project: ProjectCardFromQuery) => { export const getProjectCards = async ({ chainId }: { chainId: number }) => { try { const { GetProjects } = getBuiltGraphSDK(); - + console.log('chainId', chainId); const result = await GetProjects({ chainId }); const filteredProjects = result.Project?.filter( From a68a7366c477ac0dd869e83a03198c9635706169 Mon Sep 17 00:00:00 2001 From: jordan Date: Thu, 8 Aug 2024 14:10:28 -0700 Subject: [PATCH 2/2] clean out logs --- src/components/grant/MilestonesDrawer.tsx | 2 -- src/queries/getProjectCards.ts | 1 - 2 files changed, 3 deletions(-) diff --git a/src/components/grant/MilestonesDrawer.tsx b/src/components/grant/MilestonesDrawer.tsx index b5afc51d..5b34fac2 100644 --- a/src/components/grant/MilestonesDrawer.tsx +++ b/src/components/grant/MilestonesDrawer.tsx @@ -113,8 +113,6 @@ export const MilestonesDrawer = ({ }); }; - console.log('formData', formData); - const handlePostMilestones = async () => { setIsLoading(true); diff --git a/src/queries/getProjectCards.ts b/src/queries/getProjectCards.ts index 2cb104cc..eb66cd3a 100644 --- a/src/queries/getProjectCards.ts +++ b/src/queries/getProjectCards.ts @@ -40,7 +40,6 @@ const projectMetadataResolver = async (project: ProjectCardFromQuery) => { export const getProjectCards = async ({ chainId }: { chainId: number }) => { try { const { GetProjects } = getBuiltGraphSDK(); - console.log('chainId', chainId); const result = await GetProjects({ chainId }); const filteredProjects = result.Project?.filter(