From 2bc1fb002b997951623d08be7b7a61233343f2cb Mon Sep 17 00:00:00 2001 From: Jakz Date: Fri, 3 May 2024 15:07:13 +0800 Subject: [PATCH] replace static username --- .../GalleryEditor/GalleryEditorRenderer.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/mobile/src/components/GalleryEditor/GalleryEditorRenderer.tsx b/apps/mobile/src/components/GalleryEditor/GalleryEditorRenderer.tsx index f5c2573bf..627c827fe 100644 --- a/apps/mobile/src/components/GalleryEditor/GalleryEditorRenderer.tsx +++ b/apps/mobile/src/components/GalleryEditor/GalleryEditorRenderer.tsx @@ -30,6 +30,13 @@ export function GalleryEditorRenderer({ queryRef }: Props) { graphql` fragment GalleryEditorRendererQueryFragment on Query { ...GalleryEditorSectionFragment + viewer { + ... on Viewer { + user { + username + } + } + } } `, queryRef @@ -41,6 +48,8 @@ export function GalleryEditorRenderer({ queryRef }: Props) { const navigation = useNavigation(); const route = useRoute>(); + const username = query.viewer?.user?.username; + useEffect(() => { if (route.params.isNewGallery) { // reset the navigation stack to remove the nft selector screen @@ -57,7 +66,7 @@ export function GalleryEditorRenderer({ queryRef }: Props) { params: { screen: 'Profile', params: { - username: 'fraser', + username, navigateToTab: 'Galleries', }, }, @@ -96,6 +105,7 @@ export function GalleryEditorRenderer({ queryRef }: Props) { toggleTokensStaged, route.params.galleryId, route.params.isNewGallery, + username, ]); const items = useMemo((): ListItemType[] => {