From 409371bdaf535d76097008efd2b877217a63b242 Mon Sep 17 00:00:00 2001 From: bigint <69431456+bigint@users.noreply.github.com> Date: Sun, 25 Feb 2024 11:15:56 +0530 Subject: [PATCH] feat: add mint url --- .../src/components/Shared/Oembed/Portal/index.tsx | 15 ++++++++++----- packages/types/misc.d.ts | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/apps/web/src/components/Shared/Oembed/Portal/index.tsx b/apps/web/src/components/Shared/Oembed/Portal/index.tsx index 1e1c019ec3ec..84bec8bf443d 100644 --- a/apps/web/src/components/Shared/Oembed/Portal/index.tsx +++ b/apps/web/src/components/Shared/Oembed/Portal/index.tsx @@ -82,9 +82,9 @@ const Portal: FC = ({ portal, publicationId }) => { className="justify-center" disabled={loading || !publicationId || !currentProfile} icon={ - (action === 'link' || action === 'post_redirect') && ( - - ) + (action === 'link' || + action === 'post_redirect' || + action === 'mint') && } key={index} onClick={() => { @@ -93,8 +93,13 @@ const Portal: FC = ({ portal, publicationId }) => { publication_id: publicationId }); - if (action === 'link' || action === 'post_redirect') { - window.open(target || portalUrl, '_blank'); + if ( + action === 'link' || + action === 'post_redirect' || + action === 'mint' + ) { + const url = action === 'mint' ? portalUrl : target || portalUrl; + window.open(url, '_blank'); } else if (action === 'post') { onPost(index); } diff --git a/packages/types/misc.d.ts b/packages/types/misc.d.ts index 8d10b807f048..5241e8eb2f48 100644 --- a/packages/types/misc.d.ts +++ b/packages/types/misc.d.ts @@ -38,7 +38,7 @@ export interface Nft { sourceUrl: string; } -export type ButtonType = 'link' | 'post_redirect' | 'post'; +export type ButtonType = 'link' | 'mint' | 'post_redirect' | 'post'; export interface Portal { buttons: {