Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/koni/dev/mythical-d…
Browse files Browse the repository at this point in the history
…ev' into koni/dev/mythical-dev
  • Loading branch information
saltict committed Oct 25, 2024
2 parents 835ee77 + 34ad7cd commit ea554b7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import styled from 'styled-components';

type Props = ThemeProps & {
isLinked?: boolean;
doLinkAccount?: VoidFunction;
};

const Component = ({ className, isLinked }: Props): React.ReactElement => {
const Component = ({ className, doLinkAccount, isLinked }: Props): React.ReactElement => {
const { t } = useTranslation();

return (
Expand Down Expand Up @@ -40,7 +41,10 @@ const Component = ({ className, isLinked }: Props): React.ReactElement => {

{
!isLinked && (
<MythButton className={'__linked-account-button __button'}>
<MythButton
className={'__linked-account-button __button'}
onClick={doLinkAccount}
>
{t('Link mythical account')}
</MythButton>
)
Expand Down
14 changes: 12 additions & 2 deletions packages/extension-koni-ui/src/Popup/Home/MyProfile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { MainScreenHeader } from '@subwallet/extension-koni-ui/components/Mythical';
import { useSetCurrentPage } from '@subwallet/extension-koni-ui/hooks';
import { ThemeProps } from '@subwallet/extension-koni-ui/types';
import React from 'react';
import React, { useCallback, useState } from 'react';
import styled from 'styled-components';

import { AccountEditorArea } from './AccountEditorArea';
Expand All @@ -17,11 +17,21 @@ type Props = ThemeProps;
const Component = ({ className }: Props): React.ReactElement => {
useSetCurrentPage('/home/my-profile');

const [isAccountLinked, setIsAccountLinked] = useState<boolean>(false);

const doLinkAccount = useCallback(() => {
setIsAccountLinked(true);
}, []);

return (
<div className={className}>
<MainScreenHeader />
<AccountEditorArea className={'account-editor-area'} />
<LinkAccountArea className={'link-account-area'} />
<LinkAccountArea
className={'link-account-area'}
doLinkAccount={doLinkAccount}
isLinked={isAccountLinked}
/>
<WalletInfoArea className={'wallet-info-area'} />
<RewardHistoryArea className={'reward-history-area'} />
</div>
Expand Down

0 comments on commit ea554b7

Please sign in to comment.