Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/koni/dev/issue-162'…
Browse files Browse the repository at this point in the history
… into mythical-dev
  • Loading branch information
lw-cdm committed Dec 26, 2024
2 parents c0c11fa + e440ca0 commit 777b5dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function Component (props: Props): React.ReactElement<Props> {
id={modalId}
onCancel={onCancel}
>
<div className={'__modal-title'}>{t(`${metadata?.title || ''}`)}</div>
<div className={'__modal-title'}>{t(`${metadata?.title || 'modal'}`)}</div>

<div className={'__modal-description'}>
<ContentGenerator
Expand Down Expand Up @@ -112,6 +112,7 @@ export const TermAndConditionModal = styled(Component)<Props>(({ theme: { extend
maxWidth: 370,
maxHeight: 484,
paddingTop: 24,
width: '100%',
height: 'auto',
backgroundImage: 'url(/images/mythical/leaderboard-terms-conditions-bg.png)',
backgroundSize: '100% 100%',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import { TopThreeArea } from '@subwallet/extension-koni-ui/Popup/Home/Leaderboar
import { ThemeProps } from '@subwallet/extension-koni-ui/types';
import { openInNewTab } from '@subwallet/extension-koni-ui/utils';
import { ModalContext, Skeleton } from '@subwallet/react-ui';
import React, { useCallback, useContext, useEffect, useState } from 'react';
import CN from 'classnames';
import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import styled from 'styled-components';

Expand Down Expand Up @@ -111,14 +112,20 @@ const Component = ({ className }: Props): React.ReactElement => {
openInNewTab(LINK_NFL_APP_DOWNLOAD)();
}, []);

const shouldShowInfoButton = useMemo(() => {
const leaderboard = leaderboardInfo?.metadata as LeaderboardMetadata | undefined;

return !!(leaderboard && 'title' in leaderboard && 'content' in leaderboard);
}, [leaderboardInfo]);

return (
<div className={className}>
<MainScreenHeader
className={'main-screen-header'}
rightPartNode={
(
<button
className={'info-button'}
className={CN('info-button', { hidden: !shouldShowInfoButton })}
onClick={openTermAndConditionModal}
>
<InfoIcon />
Expand Down

0 comments on commit 777b5dd

Please sign in to comment.