Skip to content

Commit

Permalink
Merge branch 'develop' into migrate-to-iota-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
msarcev authored Aug 8, 2023
2 parents 12bf34a + 15af11a commit ccc4b7f
Show file tree
Hide file tree
Showing 158 changed files with 1,228 additions and 5,160 deletions.
10 changes: 7 additions & 3 deletions packages/desktop/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import { showAppNotification } from '@auxiliary/notification'
import { closePopup, openPopup, PopupId, popupState } from '@auxiliary/popup'
import { getLocalisedMenuItems } from './lib/helpers'
import { ToastContainer, Transition } from '@ui'
import { NotificationManager, Transition } from '@ui'
import { TitleBar, Popup } from '@components'
import { Dashboard, LoginRouter, Settings, Splash } from '@views'
import {
Expand Down Expand Up @@ -160,6 +160,10 @@
})
}
}
function onCloseSettingsClick(): void {
settings = false
}
</script>

<app-container class="block w-full h-full">
Expand Down Expand Up @@ -192,9 +196,9 @@
<OnboardingRouterView />
{/if}
{#if settings}
<Settings handleClose={() => (settings = false)} />
<Settings handleClose={onCloseSettingsClick} />
{/if}
<ToastContainer classes="absolute right-5 bottom-5 w-100" />
<NotificationManager />
{/if}
</app-body>
</app-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { resetMintTokenDetails } from '@core/wallet'
import { closePopup, openPopup, PopupId } from '@auxiliary/popup'
import { TextHintVariant } from 'shared/components/enums'
$: hasAliases = $selectedAccount.balances?.aliases.length > 0
Expand All @@ -21,7 +22,7 @@
props: {
title: localize('popups.noAlias.title'),
hint: localize('popups.noAlias.description'),
warning: true,
variant: TextHintVariant.Warning,
confirmText: localize('actions.createAlias'),
onConfirm: () => {
closePopup()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { showAppNotification } from '@auxiliary/notification'
import { closePopup, openPopup, PopupId } from '@auxiliary/popup'
import { TextHintVariant } from 'shared/components/enums'
function refreshTokenMetadata(): void {
refreshAccountAssetsForActiveProfile(true)
Expand All @@ -23,7 +24,7 @@
props: {
title: localize('actions.refreshTokenMetadata'),
hint: localize('general.refreshTokenMetadataHint'),
warning: true,
variant: TextHintVariant.Warning,
confirmText: localize('actions.reset'),
onConfirm: refreshTokenMetadata,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import { closePopup, openPopup, PopupId } from '@auxiliary/popup'
import { onMount } from 'svelte'
import { ExplorerEndpoint } from '@core/network'
import { TextHintVariant } from 'shared/components/enums'
export let activityId: string
export let _onMount: (..._: any[]) => Promise<void> = async () => {}
Expand Down Expand Up @@ -70,9 +71,8 @@
title: localize('actions.confirmRejection.title'),
description: localize('actions.confirmRejection.description'),
hint: localize('actions.confirmRejection.node'),
info: true,
confirmText: localize('actions.reject'),
warning: true,
variant: TextHintVariant.Warning,
onConfirm: () => {
rejectActivity(activityId)
closePopup()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { localize } from '@core/i18n'
import { Button, Logo, Text, ExportStrongholdButton, TextType } from 'shared/components'
import { closePopup } from '@auxiliary/popup'
import { Logo as LogoEnum } from 'shared/components/enums'
const busy = false
Expand All @@ -16,7 +17,7 @@
</Text>
<div class="flex flex-col space-y-4">
<div class="w-full p-10 bg-gray-50 dark:bg-gray-800 flex justify-center content-center">
<Logo width="50%" logo="logo-stronghold" />
<Logo width="50%" logo={LogoEnum.Stronghold} />
</div>
<div class="w-full">
<Text type={TextType.p} color="gray-700">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { consolidateOutputs } from '@core/wallet/actions/consolidateOutputs'
import { getStorageDepositFromOutput } from '@core/wallet/utils/generateActivity/helper'
import { UnlockCondition, UnlockConditionType, OutputType, CommonOutput } from '@iota/wallet/out/types'
import { TextHintVariant } from 'shared/components/enums'
import { BalanceSummarySection, Button, FontWeight, Text, TextType } from 'shared/components'
interface BalanceBreakdown {
Expand Down Expand Up @@ -120,7 +121,7 @@
title: localize('popups.minimizeStorageDeposit.title'),
description: localize('popups.minimizeStorageDeposit.description'),
confirmText: localize('popups.minimizeStorageDeposit.confirmButton'),
info: true,
variant: TextHintVariant.Info,
onConfirm: async () => {
await checkActiveProfileAuth(
async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { handleError } from '@core/error/handlers'
import { onMount } from 'svelte'
import { selectedAccount } from '@core/account'
import { TextHintVariant } from 'shared/components/enums'
export let asset: IAsset
export let rawAmount: string
Expand Down Expand Up @@ -55,7 +56,7 @@
<div class="space-y-4">
<KeyValueBox keyText={localize('popups.nativeToken.property.assetId')} valueText={asset.id} isCopyable />
<KeyValueBox keyText={localize('general.amount')} valueText={formattedAmount} />
<TextHint warning text={localize('actions.confirmTokenBurn.hint')} />
<TextHint variant={TextHintVariant.Warning} text={localize('actions.confirmTokenBurn.hint')} />
</div>
<popup-buttons class="flex flex-row flex-nowrap w-full space-x-4">
<Button classes="w-full" outline onClick={onBackClick}>{localize('actions.back')}</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { localize } from '@core/i18n'
import { closePopup, openPopup, PopupId } from '@auxiliary/popup'
import { IAsset } from '@core/wallet'
import { TextHintVariant } from 'shared/components/enums'
export let asset: IAsset
export let rawAmount: string = '0'
Expand Down Expand Up @@ -32,7 +33,7 @@
</Text>
<div class="space-y-4">
<AssetAmountInput bind:this={assetAmountInput} bind:rawAmount {asset} containsSlider disableAssetSelection />
<TextHint warning text={localize('actions.confirmTokenBurn.hint')} />
<TextHint variant={TextHintVariant.Warning} text={localize('actions.confirmTokenBurn.hint')} />
</div>
<popup-buttons class="flex flex-row flex-nowrap w-full space-x-4">
<Button classes="w-full" outline onClick={closePopup}>{localize('actions.cancel')}</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import { formatDate, localize } from '@core/i18n'
import { closePopup } from '@auxiliary/popup'
import features from '@features/features'
import { TextHintVariant } from 'shared/components/enums'
let hasAutoUpdate = false
Expand Down Expand Up @@ -50,7 +51,7 @@
valueText={localize(`popups.appUpdate.${get(appStage)}`)}
/>
{#if $appVersionDetails.upToDate}
<TextHint success classes="w-full" text={localize('popups.appUpdate.latestInstalled')} />
<TextHint variant={TextHintVariant.Success} text={localize('popups.appUpdate.latestInstalled')} />
{:else}
<KeyValueBox keyText={localize('popups.appUpdate.newVerion')} valueText={$appVersionDetails.newVersion} />
<KeyValueBox
Expand All @@ -61,8 +62,7 @@
})}
/>
<TextHint
info
classes="w-full"
variant={TextHintVariant.Info}
text={localize(`popups.appUpdate.${hasAutoUpdate ? 'updateAvailable' : 'updatesDisabled'}`)}
/>
{/if}
Expand Down
13 changes: 7 additions & 6 deletions packages/desktop/components/popups/ConfirmationPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@
import { handleError } from '@core/error/handlers'
import { onMount } from 'svelte'
import { selectedAccount } from '@core/account'
import { TextHintVariant } from 'shared/components/enums'
export let title: string
export let description: string = ''
export let hint: string = ''
export let info: boolean = false
export let success: boolean = false
export let warning: boolean = false
export let danger: boolean = false
export let variant: TextHintVariant | undefined = undefined
export let confirmText: string = localize('actions.confirm')
export let onConfirm: () => Promise<void> = undefined
export let onCancel: () => void = undefined
export let _onMount: (..._: any[]) => Promise<void> = async () => {}
let isBusy = false
$: buttonVariant = [TextHintVariant.Warning, TextHintVariant.Danger].includes(variant)
? ButtonVariant.Warning
: ButtonVariant.Primary
async function onConfirmClick(): Promise<void> {
isBusy = true
Expand Down Expand Up @@ -56,14 +57,14 @@
<Text fontSize="14" classes="text-left break-words">{description}</Text>
{/if}
{#if hint}
<TextHint {info} {success} {warning} {danger} text={hint} />
<TextHint {variant} text={hint} />
{/if}
</div>
<popup-buttons class="flex flex-row flex-nowrap w-full space-x-4">
<Button classes="w-full" outline onClick={onCancelClick}>{localize('actions.cancel')}</Button>
<Button
classes="w-full"
variant={warning || danger ? ButtonVariant.Warning : ButtonVariant.Primary}
variant={buttonVariant}
disabled={$selectedAccount.isTransferring || isBusy}
isBusy={$selectedAccount.isTransferring || isBusy}
onClick={onConfirmClick}
Expand Down
9 changes: 5 additions & 4 deletions packages/desktop/components/popups/ConnectLedgerPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { isFunction } from '@core/utils'
import { Button, LedgerAnimation, Text, TextHint, FontWeight, TextType } from 'shared/components'
import { closePopup } from '@auxiliary/popup'
import { TextHintVariant } from 'shared/components/enums'
import { AnimationEnum } from '@auxiliary/animation'
export let onCancel: () => void
Expand Down Expand Up @@ -54,13 +55,13 @@
</Text>
<LedgerAnimation {animation} />
{#if isNotConnected}
<TextHint danger text={localize('popups.ledgerNotConnected.notConnected')} />
<TextHint variant={TextHintVariant.Danger} text={localize('popups.ledgerNotConnected.notConnected')} />
{:else if isLocked}
<TextHint warning text={localize('popups.ledgerNotConnected.locked')} />
<TextHint variant={TextHintVariant.Warning} text={localize('popups.ledgerNotConnected.locked')} />
{:else if isAppNotOpen}
<TextHint info text={localize('popups.ledgerNotConnected.appNotOpen')} />
<TextHint variant={TextHintVariant.Info} text={localize('popups.ledgerNotConnected.appNotOpen')} />
{:else if isCorrectAppOpen}
<TextHint success text={localize('popups.ledgerNotConnected.correctAppOpen')} />
<TextHint variant={TextHintVariant.Success} text={localize('popups.ledgerNotConnected.correctAppOpen')} />
{/if}
<popup-buttons class="flex flex-row flex-nowrap w-full space-x-4">
<Button classes="w-full" outline onClick={onCancelClick}>
Expand Down
3 changes: 2 additions & 1 deletion packages/desktop/components/popups/DeepLinkErrorPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { localize } from '@core/i18n'
import { Text, Button, TextHint, FontWeight } from 'shared/components'
import { closePopup } from '@auxiliary/popup'
import { TextHintVariant } from 'shared/components/enums'
export let error: Error
</script>
Expand All @@ -12,7 +13,7 @@
</Text>
<div class="flex flex-col space-y-4">
<Text fontSize="15" color="gray-700" classes="text-left">{localize('popups.deeplinkError.body')}</Text>
<TextHint danger text={error.message} />
<TextHint variant={TextHintVariant.Danger} text={error.message} />
</div>
<popup-buttons class="flex flex-row flex-nowrap w-full space-x-4">
<Button classes="w-1/2" secondary onClick={closePopup}>{localize('actions.close')}</Button>
Expand Down
3 changes: 2 additions & 1 deletion packages/desktop/components/popups/DeleteAccountPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { isSoftwareProfile } from '@core/profile'
import { selectedAccount } from '@core/account'
import { handleError } from '@core/error/handlers/handleError'
import { TextHintVariant } from 'shared/components/enums'
export let deleteAccount: (index: number) => Promise<void> = async () => {}
Expand Down Expand Up @@ -47,7 +48,7 @@
</div>
<form on:submit|preventDefault={onDeleteClick} class="flex w-full flex-col space-y-5">
<Text secondary>{localize('popups.deleteAccount.body')}</Text>
<TextHint info text={localize('popups.deleteAccount.hint')} />
<TextHint variant={TextHintVariant.Info} text={localize('popups.deleteAccount.hint')} />
<div class="flex w-full flex-col space-y-3">
{#if $isSoftwareProfile}
<Text secondary>{localize('popups.deleteAccount.typePassword')}</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
>{localize(`popups.ledgerConnectionGuide.steps.${stepIndex}.text`)}</Text
>
<Link
classes="ml-0.5 inline-block text-13 leading-160"
onClick={() =>
on:click={() =>
openUrlInBrowser(
'https://support.ledger.com/hc/en-us/articles/360019868977-Fix-USB-connection-issues-with-Ledger-Live?support=true'
)}
Expand Down
10 changes: 5 additions & 5 deletions packages/desktop/components/popups/LegalUpdatePopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
function getTitleText(): string {
if (tos && privacyPolicy) {
return 'views.legal.title'
return 'popups.legalUpdate.tosAndPrivPolicyBody'
} else if (tos) {
return 'popups.legalUpdate.tosTitle'
} else if (privacyPolicy) {
Expand Down Expand Up @@ -73,16 +73,16 @@
<Text type="p" secondary>{localize(getBodyText())}</Text>
{#if tos && privacyPolicy}
<ul>
<li><Link onClick={onViewTosClick}>{localize('popups.legalUpdate.tosTitle')}</Link></li>
<li><Link onClick={onViewPrivPolicyClick}>{localize('popups.legalUpdate.privPolicyTitle')}</Link></li>
<li><Link on:click={onViewTosClick}>{localize('popups.legalUpdate.tosTitle')}</Link></li>
<li><Link on:click={onViewPrivPolicyClick}>{localize('popups.legalUpdate.privPolicyTitle')}</Link></li>
</ul>
{:else if tos}
<ul>
<li><Link onClick={onViewTosClick}>{localize('popups.legalUpdate.tosTitle')}</Link></li>
<li><Link on:click={onViewTosClick}>{localize('popups.legalUpdate.tosTitle')}</Link></li>
</ul>
{:else if privacyPolicy}
<ul>
<li><Link onClick={onViewPrivPolicyClick}>{localize('popups.legalUpdate.privPolicyTitle')}</Link></li>
<li><Link on:click={onViewPrivPolicyClick}>{localize('popups.legalUpdate.privPolicyTitle')}</Link></li>
</ul>
{/if}
<Checkbox label={localize(getCheckboxText())} bind:checked classes="mt-4" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { Button, Text, TextHint, AssetAmountInput } from 'shared/components'
import { HTMLButtonType, TextType } from 'shared/components/enums'
import { HTMLButtonType, TextType, TextHintVariant } from 'shared/components/enums'
import { selectedAccount } from '@core/account/stores'
import { handleError } from '@core/error/handlers'
import { setVotingPower } from '@contexts/governance/actions'
Expand Down Expand Up @@ -87,7 +87,7 @@
disabled={hasTransactionInProgress}
{votingPower}
/>
<TextHint info text={localize('popups.manageVotingPower.hint')} />
<TextHint variant={TextHintVariant.Info} text={localize('popups.manageVotingPower.hint')} />
</div>
<div class="flex flex-row flex-nowrap w-full space-x-4">
<Button outline disabled={hasTransactionInProgress} classes="w-full" onClick={onCancelClick}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { onMount } from 'svelte'
import { Button, Text, FontWeight, NftImageOrIconBox, Tabs, KeyValueBox } from 'shared/components'
import { Button, Text, FontWeight, NftImageOrIconBox, Tabs, KeyValueBox, NftSize } from 'shared/components'
import { localize } from '@core/i18n'
import { selectedAccount } from '@core/account'
import { buildNftOutputData, formatTokenAmountPrecise, mintNft, mintNftDetails } from '@core/wallet'
Expand Down Expand Up @@ -97,7 +97,7 @@
</Text>
<div class="space-y-2 max-h-100 scrollable-y flex-1">
<nft-details class="flex flex-col justify-center items-center space-y-4">
<NftImageOrIconBox size="large" {type} />
<NftImageOrIconBox size={NftSize.Large} />
<activity-details class="w-full h-full space-y-2 flex flex-auto flex-col shrink-0">
<Tabs bind:activeTab {tabs} />
{#if activeTab === Tab.Transaction}
Expand Down
4 changes: 3 additions & 1 deletion packages/desktop/components/popups/NodeInfoPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -175,5 +175,7 @@
</Button>
</div>
{:else}
<Spinner busy message={localize('popups.node.loadingNodeInfo')} classes="my-12 justify-center" />
<div class="my-12">
<Spinner message={localize('popups.node.loadingNodeInfo')} />
</div>
{/if}
4 changes: 2 additions & 2 deletions packages/desktop/components/popups/RemoveProposalPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import { updateActiveAccountPersistedData } from '@core/profile/actions'
import { governanceRouter } from '@core/router'
import { Button, Text, TextHint, TextType } from 'shared/components'
import { ButtonVariant } from 'shared/components/enums'
import { ButtonVariant, TextHintVariant } from 'shared/components/enums'
function onCancelClick(): void {
closePopup()
Expand Down Expand Up @@ -55,7 +55,7 @@
<div class="flex flex-col w-full space-y-4 mt-6">
<Text fontSize="15">{localize('popups.removeProposal.body')}</Text>
{#if isTextHintVisible}
<TextHint info text={localize('popups.removeProposal.hint')} />
<TextHint variant={TextHintVariant.Info} text={localize('popups.removeProposal.hint')} />
{/if}
</div>
<div class="flex w-full space-x-4 mt-6">
Expand Down
Loading

0 comments on commit ccc4b7f

Please sign in to comment.