Skip to content

Commit

Permalink
Merge pull request #168 from Koniverse/koni/dev/issue-143
Browse files Browse the repository at this point in the history
[Issue-143] [Mythical] Update link download app for Download task
  • Loading branch information
lw-cdm authored Nov 27, 2024
2 parents caf1dbc + 5abc6fd commit b20e497
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/extension-koni-ui/src/Popup/Home/InviteNew/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import { GameAccountItemType } from '@subwallet/extension-koni-ui/components/Myt
import { BookaSdk } from '@subwallet/extension-koni-ui/connector/booka/sdk';
import { ReferralRecord } from '@subwallet/extension-koni-ui/connector/booka/types';
import { TelegramConnector } from '@subwallet/extension-koni-ui/connector/telegram';
import { LINK_NFL_APP_DOWNLOAD } from '@subwallet/extension-koni-ui/constants';
import { useDefaultNavigate, useNotification, useSetCurrentPage, useTranslation } from '@subwallet/extension-koni-ui/hooks';
import { ThemeProps } from '@subwallet/extension-koni-ui/types';
import { copyToClipboard } from '@subwallet/extension-koni-ui/utils';
import { copyToClipboard, openInNewTab } from '@subwallet/extension-koni-ui/utils';
import CN from 'classnames';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import styled from 'styled-components';
Expand Down Expand Up @@ -55,6 +56,10 @@ const Component = ({ className }: Props): React.ReactElement => {
telegramConnector.openTelegramLink(inviteURL);
}, [inviteURL]);

const openAppStoreLink = useCallback(() => {
openInNewTab(LINK_NFL_APP_DOWNLOAD)();
}, []);

const copyLink = useCallback(() => {
copyToClipboard(apiSDK.getInviteURL());

Expand Down Expand Up @@ -131,6 +136,7 @@ const Component = ({ className }: Props): React.ReactElement => {
<CallToAction
buttonLabel={'Play now'}
className={'call-to-action'}
onAction={openAppStoreLink}
subtitle={'Download NFL Rivals App'}
title={'Want more friends?'}
/>
Expand Down Expand Up @@ -219,9 +225,7 @@ const Invite = styled(Component)<ThemeProps>(({ theme: { extendToken, token } }:
}
},

'.call-to-action': {

}
'.call-to-action': {}
};
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
import { CallToAction, InfoIcon, MainScreenHeader, TimeRemaining } from '@subwallet/extension-koni-ui/components/Mythical';
import { BookaSdk } from '@subwallet/extension-koni-ui/connector/booka/sdk';
import { LeaderboardGroups, LeaderboardInfo, LeaderboardPerson } from '@subwallet/extension-koni-ui/connector/booka/types';
import { LINK_NFL_APP_DOWNLOAD } from '@subwallet/extension-koni-ui/constants';
import { HomeContext } from '@subwallet/extension-koni-ui/contexts/screen/HomeContext';
import { useSetCurrentPage } from '@subwallet/extension-koni-ui/hooks';
import { GameAccountListArea } from '@subwallet/extension-koni-ui/Popup/Home/LeaderboardTemp/GameAccountListArea';
import { TERM_AND_CONDITION_MODAL_ID, TermAndConditionModal } from '@subwallet/extension-koni-ui/Popup/Home/LeaderboardTemp/TermAndConditionModal';
import { TopThreeArea } from '@subwallet/extension-koni-ui/Popup/Home/LeaderboardTemp/TopThreeArea';
import { ThemeProps } from '@subwallet/extension-koni-ui/types';
import { openInNewTab } from '@subwallet/extension-koni-ui/utils';
import { ModalContext } from '@subwallet/react-ui';
import React, { useCallback, useContext, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -100,6 +102,10 @@ const Component = ({ className }: Props): React.ReactElement => {
inactiveModal(TERM_AND_CONDITION_MODAL_ID);
}, [inactiveModal]);

const openAppStoreLink = useCallback(() => {
openInNewTab(LINK_NFL_APP_DOWNLOAD)();
}, []);

return (
<div className={className}>
<MainScreenHeader
Expand Down Expand Up @@ -131,6 +137,7 @@ const Component = ({ className }: Props): React.ReactElement => {
<CallToAction
buttonLabel={'Play now'}
className={'call-to-action'}
onAction={openAppStoreLink}
subtitle={'Download NFL Rivals App'}
title={'Want to get to the big league?'}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import { FilterTabItemType, FilterTabs } from '@subwallet/extension-koni-ui/comp
import { CallToAction, MainScreenHeader, TimeRemaining } from '@subwallet/extension-koni-ui/components/Mythical';
import { BookaSdk } from '@subwallet/extension-koni-ui/connector/booka/sdk';
import { Achievement, Task, TaskCategory, TaskCategoryType } from '@subwallet/extension-koni-ui/connector/booka/types';
import { LINK_NFL_APP_DOWNLOAD } from '@subwallet/extension-koni-ui/constants';
import { HomeContext } from '@subwallet/extension-koni-ui/contexts/screen/HomeContext';
import { useSetCurrentPage } from '@subwallet/extension-koni-ui/hooks';
import { ThemeProps } from '@subwallet/extension-koni-ui/types';
import { openInNewTab } from '@subwallet/extension-koni-ui/utils';
import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import styled from 'styled-components';
Expand Down Expand Up @@ -51,6 +53,10 @@ const Component = ({ className }: Props): React.ReactElement => {
setSelectedFilterTab(value);
}, []);

const openAppStoreLink = useCallback(() => {
openInNewTab(LINK_NFL_APP_DOWNLOAD)();
}, []);

const endTime = useMemo(() => {
if (selectedFilterTab === TaskCategoryType.DAILY && metadata?.timeRange?.daily) {
return new Date(metadata?.timeRange?.daily?.end).toString();
Expand Down Expand Up @@ -145,6 +151,7 @@ const Component = ({ className }: Props): React.ReactElement => {
<CallToAction
buttonLabel={'Play now'}
className={'call-to-action'}
onAction={openAppStoreLink}
subtitle={'Download NFL Rivals App'}
title={'Want to score more points?'}
/>
Expand Down
7 changes: 7 additions & 0 deletions packages/extension-koni-ui/src/Popup/Home/MyProfile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
import { CallToAction, EmptyListContent, MainScreenHeader, MythButton } from '@subwallet/extension-koni-ui/components/Mythical';
import { BookaSdk } from '@subwallet/extension-koni-ui/connector/booka/sdk';
import { BookaAccount } from '@subwallet/extension-koni-ui/connector/booka/types';
import { LINK_NFL_APP_DOWNLOAD } from '@subwallet/extension-koni-ui/constants';
import { AuthenticationMythContext } from '@subwallet/extension-koni-ui/contexts/AuthenticationMythProvider';
import { useSetCurrentPage } from '@subwallet/extension-koni-ui/hooks';
import { RootState } from '@subwallet/extension-koni-ui/stores';
import { ThemeProps } from '@subwallet/extension-koni-ui/types';
import { openInNewTab } from '@subwallet/extension-koni-ui/utils';
import React, { useCallback, useContext, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
Expand All @@ -32,6 +34,10 @@ const Component = ({ className }: Props): React.ReactElement => {
currentAccount?.address && linkMythAccount().catch(console.error);
}, [currentAccount?.address, linkMythAccount]);

const openAppStoreLink = useCallback(() => {
openInNewTab(LINK_NFL_APP_DOWNLOAD)();
}, []);

// @ts-ignore
const logIn = useCallback(() => {
setLoading(true);
Expand Down Expand Up @@ -117,6 +123,7 @@ const Component = ({ className }: Props): React.ReactElement => {
<CallToAction
buttonLabel={'Play now'}
className={'call-to-action'}
onAction={openAppStoreLink}
subtitle={'Download NFL Rivals App'}
title={'Want to take your profile to the next level?'}
/>
Expand Down
2 changes: 2 additions & 0 deletions packages/extension-koni-ui/src/constants/myth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ export const eventStat = {
JMP: 'jump'
};

export const LINK_NFL_APP_DOWNLOAD = 'https://nflrivals.sng.link/D6fxh/ss0n/f0ei';

export * from './authentication';
export * from './optionFilterCard';

0 comments on commit b20e497

Please sign in to comment.