Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into refactor/component…
Browse files Browse the repository at this point in the history
…s/texthint
  • Loading branch information
begonaalvarezd committed Aug 1, 2023
2 parents 21bde31 + afda857 commit 2a9f684
Show file tree
Hide file tree
Showing 149 changed files with 861 additions and 2,009 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/handbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: retypeapp/action-build@v2
- uses: retypeapp/action-build@v3
with:
config: docs

- uses: retypeapp/action-github-pages@v2
- uses: retypeapp/action-github-pages@latest
with:
branch: retype
update-branch: true
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"patch-package": "^7.0.0",
"prettier": "^2.3.2",
"prettier-plugin-svelte": "^2.7.0",
"retypeapp": "^2.3.0",
"retypeapp": "^3.1.0",
"typescript": "^5.0.3"
},
"scripts": {
Expand All @@ -30,7 +30,7 @@
"check-types": "yarn check-types:shared && yarn check-types:desktop",
"check-types:desktop": "cd packages/desktop && tsc --pretty --noEmit",
"check-types:shared": "cd packages/shared && tsc --project tsconfig.base.json --pretty --noEmit",
"docs:start": "cd docs/ && retype watch",
"docs:start": "cd docs/ && retype start",
"format": "yarn format:write",
"format:check": "prettier -c \"**/*.{ts,js,json,scss,css,svelte}\"",
"format:write": "prettier -w \"**/*.{ts,js,json,scss,css,svelte}\"",
Expand Down
15 changes: 7 additions & 8 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 All @@ -40,7 +40,6 @@
openSettings,
} from '@desktop/routers'
import { downloadNextNftInQueue, nftDownloadQueue } from '@core/nfts'
import { closeDrawer } from '@desktop/auxiliary/drawer'
import features from '@features/features'
import { OnboardingRouterView } from '@views/onboarding'
Expand Down Expand Up @@ -122,14 +121,12 @@
Platform.onEvent('menu-navigate-settings', () => {
if ($loggedIn) {
closePopup()
closeDrawer()
$routerManager.openSettings()
} else {
settings = true
}
})
Platform.onEvent('menu-check-for-update', () => {
closeDrawer()
openPopup({
id: PopupId.CheckForUpdates,
props: {
Expand All @@ -138,11 +135,9 @@
})
})
Platform.onEvent('menu-error-log', () => {
closeDrawer()
openPopup({ id: PopupId.ErrorLog })
})
Platform.onEvent('menu-diagnostics', () => {
closeDrawer()
openPopup({ id: PopupId.Diagnostics })
})
Expand All @@ -165,6 +160,10 @@
})
}
}
function onCloseSettingsClick(): void {
settings = false
}
</script>

<app-container class="block w-full h-full">
Expand Down Expand Up @@ -197,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
2 changes: 0 additions & 2 deletions packages/desktop/components/AccountSwitcher.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { AccountSwitcherModal } from '@components'
import { selectedAccount } from '@core/account/stores'
import { Icon as IconEnum } from '@auxiliary/icon'
import { closeDrawer } from '@desktop/auxiliary/drawer'
let modal: Modal
let isModalOpened: boolean = false
Expand All @@ -13,7 +12,6 @@
}
function onButtonClick(): void {
closeDrawer()
modal?.toggle()
}
</script>
Expand Down
109 changes: 0 additions & 109 deletions packages/desktop/components/drawers/Drawer.svelte

This file was deleted.

1 change: 0 additions & 1 deletion packages/desktop/components/drawers/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/desktop/components/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from './buttons'
export * from './drawers'
export * from './filter'
export * from './menu-buttons'
export * from './modals'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { localize } from '@core/i18n'
import { getBaseToken, checkActiveProfileAuth } from '@core/profile'
import {
mintNativeToken,
createNativeToken,
mintTokenDetails,
TokenStandard,
buildFoundryOutputData,
Expand All @@ -27,7 +27,12 @@
async function prepareFoundryOutput(): Promise<void> {
if ($mintTokenDetails && $selectedAccount && metadata) {
const { totalSupply, circulatingSupply, aliasId } = $mintTokenDetails
const outputData = buildFoundryOutputData(Number(totalSupply), Number(circulatingSupply), metadata, aliasId)
const outputData = await buildFoundryOutputData(
Number(totalSupply),
Number(circulatingSupply),
metadata,
aliasId
)
const preparedOutput = await $selectedAccount.buildFoundryOutput(outputData)
storageDeposit = formatTokenAmountPrecise(Number(preparedOutput.amount) ?? 0, getBaseToken())
}
Expand Down Expand Up @@ -89,7 +94,7 @@
async function mintAction(): Promise<void> {
try {
if ($mintTokenDetails && metadata) {
await mintNativeToken(
await createNativeToken(
Number($mintTokenDetails.totalSupply),
Number($mintTokenDetails.circulatingSupply),
metadata
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
11 changes: 9 additions & 2 deletions packages/desktop/components/popups/TokenInformationPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,21 @@
Button,
Text,
TextHint,
AssetActionsButton,
AssetTile,
KeyValueBox,
FontWeight,
TextType,
AssetActionsModal,
MeatballMenuButton,
Modal,
} from 'shared/components'
import { TextHintVariant } from 'shared/components/enums'
export let asset: IAsset
export let activityId: string = undefined
let modal: Modal
function onSkipClick(): void {
unverifyAsset(asset.id, NotVerifiedStatus.Skipped)
if (activityId) {
Expand Down Expand Up @@ -84,7 +88,10 @@
: asset.metadata?.name}
</Text>
{#if asset.standard === TokenStandard.Irc30}
<AssetActionsButton {asset} />
<div class="max-h-7 max-w-9 overflow-visible relative">
<MeatballMenuButton onClick={modal?.toggle} />
<AssetActionsModal bind:modal {asset} position={{ right: '0' }} classes="mt-1.5" />
</div>
{/if}
</div>

Expand Down
15 changes: 13 additions & 2 deletions packages/desktop/components/popups/UnlockStrongholdPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@
let password: string
let error = ''
let isBusy = false
async function onSubmit(): Promise<void> {
try {
isBusy = true
const response = await unlockStronghold(password)
closePopup()
onSuccess(returnPassword ? password : response)
} catch (err) {
console.error(err)
error = localize(err?.message ?? err)
} finally {
isBusy = false
}
}
Expand Down Expand Up @@ -50,8 +54,15 @@
autofocus
/>
<div class="flex flex-row justify-between w-full space-x-4">
<Button outline classes="w-1/2" onClick={onCancelClick}>{localize('actions.cancel')}</Button>
<Button classes="w-1/2" type={HTMLButtonType.Submit} disabled={!password || password.length === 0}>
<Button outline classes="w-1/2" onClick={onCancelClick} disabled={isBusy}>
{localize('actions.cancel')}
</Button>
<Button
disabled={!password || password.length === 0 || isBusy}
type={HTMLButtonType.Submit}
classes="w-1/2"
{isBusy}
>
{localize('actions.unlock')}
</Button>
</div>
Expand Down
22 changes: 13 additions & 9 deletions packages/desktop/electron/lib/errorPreload.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ const { version } = require('../../package.json')

contextBridge.exposeInMainWorld('error', {
getData: () =>
ipcRenderer.invoke('error-data').then((data) => ({
iconPath: './assets/logos/firefly_logo.svg',
version,
diagnostics: data.diagnostics
.map((d) => `${d.label.replace('popups.diagnostics.', '')}: ${d.value}`)
.join('\r\n'),
errorType: data.errorType,
error: data.error,
})),
ipcRenderer.invoke('error-data').then((data) => {
const stage = process.env.STAGE
const errorData = {
iconPath: `./assets/logos/darkmode/${stage}_firefly_logo.svg`,
version,
diagnostics: data.diagnostics
.map((d) => `${d.label.replace('popups.diagnostics.', '')}: ${d.value}`)
.join('\r\n'),
errorType: data.errorType,
error: data.error,
}
return errorData
}),
openUrl: (url) => {
ipcRenderer.invoke('open-url', url)
},
Expand Down
Loading

0 comments on commit 2a9f684

Please sign in to comment.