-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into refactor/cleanup-tables
- Loading branch information
Showing
58 changed files
with
537 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
packages/desktop/components/popups/SignMessagePopup.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<script lang="ts"> | ||
import { Button, Text, TextHint, FontWeight, TextType, AccountLabel } from '@ui' | ||
import { localize } from '@core/i18n' | ||
import { closePopup } from '@desktop/auxiliary/popup' | ||
import { handleError } from '@core/error/handlers' | ||
import { onMount } from 'svelte' | ||
import { selectedAccount } from '@core/account/stores' | ||
import { sleep, truncateString } from '@core/utils' | ||
import { IConnectedDapp } from '@auxiliary/wallet-connect/interface' | ||
import { IAccountState } from '@core/account' | ||
import { IChain } from '@core/network' | ||
import { CallbackParameters } from '@auxiliary/wallet-connect/types' | ||
export let _onMount: (..._: any[]) => Promise<void> = async () => {} | ||
export let message: string | ||
export let account: IAccountState | ||
export let chain: IChain | ||
export let dapp: IConnectedDapp | undefined | ||
export let callback: (params: CallbackParameters) => void | ||
$: address = truncateString(account.evmAddresses[chain.getConfiguration().coinType] ?? '', 8, 8) | ||
let isBusy = false | ||
async function onConfirmClick(): Promise<void> { | ||
isBusy = true | ||
try { | ||
const signedMessage = await sign() | ||
callback({ result: signedMessage }) | ||
closePopup() | ||
} finally { | ||
isBusy = false | ||
} | ||
} | ||
async function sign(): Promise<string> { | ||
// TODO: Replace this with the correct signing implementation | ||
await sleep(500) | ||
return '0x3123' | ||
} | ||
function onCancelClick(): void { | ||
callback({ error: 'User rejected' }) | ||
closePopup() | ||
} | ||
onMount(async () => { | ||
try { | ||
await _onMount() | ||
} catch (err) { | ||
handleError(err) | ||
} | ||
}) | ||
</script> | ||
|
||
<div class="w-full h-full space-y-6 flex flex-auto flex-col shrink-0"> | ||
<Text type={TextType.h3} fontWeight={FontWeight.semibold} classes="text-left"> | ||
{localize('popups.signMessage.title')} | ||
</Text> | ||
<div class="space-y-4"> | ||
<section class="relative flex flex-col border border-solid border-gray-200 rounded-xl p-6"> | ||
<Text fontWeight={FontWeight.medium} color="gray-600">{localize('popups.signMessage.message')}</Text> | ||
<Text>{message}</Text> | ||
{#if dapp} | ||
<div class="absolute flex flex-row justify-between" style="top: -12px; left: 18px;"> | ||
<div class="flex flex-row gap-1 bg-white dark:bg-gray-800 items-center px-2"> | ||
<img | ||
style="width: 24px; height: 24px; border-radius: 24px;" | ||
src={dapp.metadata?.icons?.[0]} | ||
alt={dapp.metadata?.name} | ||
/> | ||
<Text fontSize="10" fontWeight={FontWeight.bold}> | ||
{dapp.metadata?.name} | ||
</Text> | ||
</div> | ||
</div> | ||
{/if} | ||
</section> | ||
<section class="flex flex-row justify-between items-center border border-solid border-gray-200 rounded-xl p-4"> | ||
<AccountLabel {account} /> | ||
<Text color="gray-600" fontWeight={FontWeight.semibold}> | ||
{address} | ||
</Text> | ||
</section> | ||
{#if dapp} | ||
<TextHint info text={localize('popups.signMessage.hint', { dappName: dapp.metadata?.name ?? 'Unkown' })} /> | ||
{:else} | ||
<TextHint warning text={localize('popups.signMessage.warning')} /> | ||
{/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" | ||
disabled={$selectedAccount.isTransferring || isBusy} | ||
isBusy={$selectedAccount.isTransferring || isBusy} | ||
onClick={onConfirmClick} | ||
> | ||
{localize('popups.signMessage.action')} | ||
</Button> | ||
</popup-buttons> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/desktop/views/dashboard/send-flow/views/components/DateTimePicker.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"author": "Charlie Varley <[email protected]>", | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"@bloomwalletio/ui": "0.7.10", | ||
"@bloomwalletio/ui": "0.7.12", | ||
"@iota/bundle": "1.0.0-beta.30", | ||
"@iota/converter": "1.0.0-beta.30", | ||
"@iota/crypto.js": "1.8.6", | ||
|
@@ -26,7 +26,6 @@ | |
"svelte": "3.58.0", | ||
"svelte-i18n": "3.7.0", | ||
"svelte-markdown": "0.2.3", | ||
"svelty-picker": "3.5.0", | ||
"web3": "1.10.0", | ||
"zxcvbn": "4.4.2" | ||
}, | ||
|
Oops, something went wrong.