Skip to content

Commit

Permalink
chore: remove unused locale (#662)
Browse files Browse the repository at this point in the history
* chore: remove unused locales

* chore: remove unused component

* chore: remove unused menu items

* chore: remove seed checking

* chore: simplify locales

* fix: show governance filter names

* feat: replace firefly with Bloom
  • Loading branch information
Tuditi authored Sep 11, 2023
1 parent 91f11ff commit a487774
Show file tree
Hide file tree
Showing 57 changed files with 1,318 additions and 1,978 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
</Button>
{#if hasAutoUpdate && !$appVersionDetails.upToDate}
<Button classes="w-1/2" onClick={onDownloadClick} disabled={$appUpdateState.busy}>
{localize('actions.updateFirefly')}
{localize('actions.updateBloom')}
</Button>
{:else if !$appVersionDetails.upToDate}
<Button classes="w-1/2" onClick={onVisitDownloadsClick}>
Expand Down
2 changes: 0 additions & 2 deletions packages/desktop/components/popups/Popup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import NodeAuthRequiredPopup from './NodeAuthRequiredPopup.svelte'
import NodeInfoPopup from './NodeInfoPopup.svelte'
import ReceiveAddressPopup from './ReceiveAddressPopup.svelte'
import RemoveNode from './RemoveNode.svelte'
import RemoveProposalPopup from './RemoveProposalPopup.svelte'
import RevotePopup from './RevotePopup.svelte'
import SignMessagePopup from './SignMessagePopup.svelte'
Expand Down Expand Up @@ -122,7 +121,6 @@
[PopupId.NodeAuthRequired]: NodeAuthRequiredPopup,
[PopupId.NodeInfo]: NodeInfoPopup,
[PopupId.ReceiveAddress]: ReceiveAddressPopup,
[PopupId.RemoveNode]: RemoveNode,
[PopupId.RemoveProposal]: RemoveProposalPopup,
[PopupId.Revote]: RevotePopup,
[PopupId.SendFlow]: SendFlowPopup,
Expand Down
25 changes: 0 additions & 25 deletions packages/desktop/components/popups/RemoveNode.svelte

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export enum PopupId {
NodeAuthRequired = 'nodeAuthRequired',
NodeInfo = 'nodeInfo',
ReceiveAddress = 'receiveAddress',
RemoveNode = 'removeNode',
RemoveProposal = 'removeProposal',
Revote = 'revote',
SignMessage = 'signMessage',
Expand Down
2 changes: 0 additions & 2 deletions packages/desktop/lib/electron/menus/menu-state.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export const MENU_STATE = {
about: 'About Bloom',
checkForUpdates: 'Check for Updates',
settings: 'Settings',
general: 'General',
security: 'Security',
advanced: 'Advanced',
errorLog: 'Error Log',
Expand All @@ -24,7 +23,6 @@ export const MENU_STATE = {
wallet: 'Wallet',
addAccount: 'Add Account',
help: 'Help',
troubleshoot: 'Troubleshoot',
faq: 'FAQ',
documentation: 'Documentation',
discord: 'Discord',
Expand Down
2 changes: 0 additions & 2 deletions packages/desktop/lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export const getLocalisedMenuItems = (): unknown => ({
about: localize('views.settings.about.title'),
checkForUpdates: localize('actions.checkForUpdates'),
settings: localize('views.settings.settings'),
general: localize('views.settings.general.title'),
security: localize('views.settings.security.title'),
advanced: localize('views.settings.advanced.title'),
errorLog: localize('views.settings.errorLog.title'),
Expand All @@ -31,7 +30,6 @@ export const getLocalisedMenuItems = (): unknown => ({
wallet: localize('general.wallet'),
addAccount: localize('actions.addAccount'),
help: localize('general.help'),
troubleshoot: localize('views.settings.troubleshoot.title'),
faq: localize('views.settings.faq.title'),
documentation: localize('views.settings.documentation.title'),
discord: localize('views.settings.discord.title'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
{/each}
<Button
variant="text"
text={localize(`views.dashboard.drawers.contactBook.${ContactBookRoute.EditNetworkAddresses}.addAddress`)}
text={localize('general.addAddress')}
icon={IconName.Plus}
width="full"
on:click={onAddNewAddressClick}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@
<Modal bind:this={modal} position={{ bottom: '30px', right: '0px' }} size="large">
<gift-storage-deposit-modal class="flex flex-row justify-between items-center p-4" in:fade={{ duration: 100 }}>
<div class="flex flex-col">
<Text fontWeight={FontWeight.medium}
>{localize('popups.transactionDetails.giftedStorageDeposit.tooltipTitle')}</Text
>
<Text fontWeight={FontWeight.medium}>{localize('popups.giftedStorageDeposit.tooltipTitle')}</Text>
<Text fontWeight={FontWeight.medium} color="gray-600" darkColor="gray-400"
>{localize('popups.transactionDetails.giftedStorageDeposit.tooltipDescription')}</Text
>{localize('popups.giftedStorageDeposit.tooltipDescription')}</Text
>
</div>
<Toggle color="green" active={giftStorageDeposit} onClick={toggleGiftStorageDeposit} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { OnboardingLayout } from '@components'
import { onboardingProfile, updateOnboardingProfile } from '@contexts/onboarding'
import { updateOnboardingProfile } from '@contexts/onboarding'
import { localize } from '@core/i18n'
import { Animation, Button, HTMLButtonType, ImportTextfield, Text } from '@ui'
import { onMount } from 'svelte'
Expand Down Expand Up @@ -34,7 +34,7 @@
>
<Text type="h5" classes="mb-3">{localize('views.onboarding.profileRecovery.importMnemonicPhrase.enter')}</Text>
<form on:submit|preventDefault={onContinueClick} id="text-import-form">
<ImportTextfield type={$onboardingProfile?.restoreProfileType} bind:value={input} />
<ImportTextfield bind:value={input} />
</form>
</div>
<div slot="leftpane__action" class="flex flex-row flex-wrap justify-between items-center space-x-4">
Expand Down
54 changes: 12 additions & 42 deletions packages/shared/src/components/inputs/ImportTextfield.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,15 @@
import { debounce } from '@core/utils'
import { Mnemonic } from '@contexts/onboarding'
enum Type {
Seed = 'seed',
Mnemonic = 'mnemonic',
}
export let value: string
export let type = Type.Mnemonic
export let disabled = false
export let minHeight: number = 200
let statusMessage = ''
let content = ''
let error = false
function checkSeed(value: string): string {
if (value.length !== 81) {
return localize('error.backup.seedTooShort', {
values: {
length: value.length,
},
})
}
if (!/^[9A-Z]+$/.test(value)) {
return localize('error.backup.seedCharacters')
}
}
function checkMnemonic(words: Mnemonic): string {
function checkMnemonic(words: Mnemonic): string | undefined {
if (words.length !== 24) {
return localize('error.backup.phraseWordCount', {
values: {
Expand Down Expand Up @@ -71,30 +52,19 @@
if (trimmedContent.length >= 3) {
const words = trimmedContent?.split(' ')
if (type === Type.Seed) {
const seedValidations = checkSeed(trimmedContent)
if (seedValidations) {
statusMessage = seedValidations
error = true
} else {
statusMessage = localize('views.importFromText.seedDetected')
const mnemonicValidations = checkMnemonic(words)
if (mnemonicValidations) {
statusMessage = mnemonicValidations
error = true
} else {
try {
await verifyMnemonic(trimmedContent)
statusMessage = localize('views.onboarding.profileRecovery.importMnemonicPhrase.phraseDetected')
value = trimmedContent
}
} else if (type === Type.Mnemonic) {
const mnemonicValidations = checkMnemonic(words)
if (mnemonicValidations) {
statusMessage = mnemonicValidations
} catch (err) {
error = true
} else {
try {
await verifyMnemonic(trimmedContent)
statusMessage = localize('views.onboarding.profileRecovery.importMnemonicPhrase.phraseDetected')
value = trimmedContent
} catch (err) {
error = true
console.error(err)
statusMessage = localize(err.error)
}
console.error(err)
statusMessage = localize(err.error)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const DEFAULT_PROPOSAL_FILTER: IProposalFilter = {
active: false,
type: 'selection',
labelKey: 'filters.phase.label',
localeKey: 'pills.proposalStatus',
localeKey: 'pills.governance.proposalStatus',
selected: EventStatus.Commencing,
choices: [EventStatus.Commencing, EventStatus.Upcoming, EventStatus.Holding, EventStatus.Ended],
},
Expand Down
Loading

0 comments on commit a487774

Please sign in to comment.