From c9514602b10175219630275cb07c0aebc7cf78bb Mon Sep 17 00:00:00 2001 From: Johns Beharry Date: Tue, 20 Sep 2022 17:24:53 +0200 Subject: [PATCH 1/3] fix(login): use new link for "sign in with lightning" information --- src/features/Auth/pages/LoginPage/LoginPage.tsx | 2 +- .../OverviewPage/RegisterationModals/LoginModal/LoginModal.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/Auth/pages/LoginPage/LoginPage.tsx b/src/features/Auth/pages/LoginPage/LoginPage.tsx index 5b4b37e..8840b32 100644 --- a/src/features/Auth/pages/LoginPage/LoginPage.tsx +++ b/src/features/Auth/pages/LoginPage/LoginPage.tsx @@ -182,7 +182,7 @@ export default function LoginPage() { color='gray' onClick={copyToClipboard} >{copied ? "Copied" : "Copy"} - What is a lightning wallet? diff --git a/src/features/Tournaments/pages/OverviewPage/RegisterationModals/LoginModal/LoginModal.tsx b/src/features/Tournaments/pages/OverviewPage/RegisterationModals/LoginModal/LoginModal.tsx index 043091a..9617266 100644 --- a/src/features/Tournaments/pages/OverviewPage/RegisterationModals/LoginModal/LoginModal.tsx +++ b/src/features/Tournaments/pages/OverviewPage/RegisterationModals/LoginModal/LoginModal.tsx @@ -153,7 +153,7 @@ export default function LinkingAccountModal({ onClose, direction, tournamentId, color='gray' onClick={copyToClipboard} >{copied ? "Copied" : "Copy"} - What is a lightning wallet? From a8358de7600005d0ac25344c47e753be09c545a4 Mon Sep 17 00:00:00 2001 From: MTG2000 Date: Tue, 20 Sep 2022 18:38:24 +0300 Subject: [PATCH 2/3] fix: hide make on non-register --- src/features/Tournaments/pages/MakersPage/MakersPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/Tournaments/pages/MakersPage/MakersPage.tsx b/src/features/Tournaments/pages/MakersPage/MakersPage.tsx index ebdf5d4..c9dd9a5 100644 --- a/src/features/Tournaments/pages/MakersPage/MakersPage.tsx +++ b/src/features/Tournaments/pages/MakersPage/MakersPage.tsx @@ -20,7 +20,7 @@ export default function MakersPage() { {query.loading ? : - query.data?.me ? + (query.data?.me && !!query.data.tournamentParticipationInfo) ? : null } From 3f3786c076dd264278a2fb6d1bd7f3ed3cbe78c8 Mon Sep 17 00:00:00 2001 From: MTG2000 Date: Tue, 20 Sep 2022 18:48:12 +0300 Subject: [PATCH 3/3] fix: edit story link --- .../Components/StoryPageContent/useUpdateStory.tsx | 3 ++- src/utils/routing/routes.ts | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/features/Posts/pages/PostDetailsPage/Components/StoryPageContent/useUpdateStory.tsx b/src/features/Posts/pages/PostDetailsPage/Components/StoryPageContent/useUpdateStory.tsx index 48b10e4..ac64108 100644 --- a/src/features/Posts/pages/PostDetailsPage/Components/StoryPageContent/useUpdateStory.tsx +++ b/src/features/Posts/pages/PostDetailsPage/Components/StoryPageContent/useUpdateStory.tsx @@ -8,6 +8,7 @@ import { NotificationsService } from "src/services/notifications.service"; import { useAppDispatch } from "src/utils/hooks"; import { useReduxEffect } from "src/utils/hooks/useReduxEffect"; import { openModal } from "src/redux/features/modals.slice"; +import { createRoute } from "src/utils/routing"; const CONFIRM_DELETE_STORY = createAction<{ confirmed?: boolean }>('DELETE_STORY_CONFIRMED')({}) @@ -31,7 +32,7 @@ export const useUpdateStory = (story: Story) => { cover_image: story.cover_image ? { id: null, name: null, url: story.cover_image } : null, })) - navigate("/blog/create-post?type=story") + navigate(createRoute({ type: "write-story" })) }; const onConfirmDelete = useCallback(({ payload: { confirmed } }: typeof CONFIRM_DELETE_STORY) => { diff --git a/src/utils/routing/routes.ts b/src/utils/routing/routes.ts index c53a03e..2e27f36 100644 --- a/src/utils/routing/routes.ts +++ b/src/utils/routing/routes.ts @@ -14,6 +14,10 @@ type RouteOptions = title?: string, username?: string, } + | { + type: "write-story", + id?: number, + } | { type: "bounty", id: string | number, @@ -51,6 +55,10 @@ export function createRoute(options: RouteOptions) { + (!onlyId ? "-" : "") + `${options.id}` } + + if (options.type === 'write-story') + return "/story/write?type=story" + if ((options.type === "post" && options.postType.toLowerCase() === 'bounty') || options.type === "bounty") return `/blog/post/bounty/${options.id}`