Skip to content

Commit 777578e

Browse files
feat: add "copy profile system location" option to login view (#8162)
Co-authored-by: Begoña Álvarez de la Cruz <balvarez@boxfish.studio>
1 parent 7a81d6c commit 777578e

File tree

4 files changed

+41
-2
lines changed

4 files changed

+41
-2
lines changed

packages/desktop/views/login/views/EnterPinView.svelte

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import { loginRouter } from '@core/router'
1616
import { isValidPin } from '@core/utils'
1717
import features from '@features/features'
18-
import { Icon, PinInput, Profile, Text, TextHint } from '@ui'
18+
import { Icon, InitProfileActionsModal, MeatballMenuButton, Modal, PinInput, Profile, Text, TextHint } from '@ui'
1919
import { TextHintVariant } from 'shared/components/enums'
2020
import { onDestroy } from 'svelte'
2121
@@ -35,6 +35,7 @@
3535
let buttonText: string = getButtonText(timeRemainingBeforeNextAttempt)
3636
let maxAttemptsTimer: ReturnType<typeof setTimeout> = null
3737
let shakeTimeout: ReturnType<typeof setTimeout> = null
38+
let modal: Modal
3839
3940
$: if (needsToAcceptLatestPrivacyPolicy() || needsToAcceptLatestTermsOfService()) {
4041
openPopup({
@@ -150,6 +151,12 @@
150151
<enter-pin-view class="block w-full h-full bg-white dark:bg-gray-900">
151152
<div class="flex w-full h-full justify-center items-center">
152153
<div class="w-96 flex flex-col flex-wrap items-center mb-20">
154+
<div class="flex justify-end w-full">
155+
<div class="max-h-7 max-w-9 overflow-visible relative">
156+
<MeatballMenuButton onClick={modal?.toggle} />
157+
<InitProfileActionsModal bind:modal />
158+
</div>
159+
</div>
153160
<div class="flex flex-col gap-8 w-full items-center">
154161
<Profile profile={$activeProfile} {updateRequired} />
155162
{#if updateRequired}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<script lang="ts">
2+
import { localize } from '@core/i18n'
3+
import { Icon } from '@lib/auxiliary/icon'
4+
import { MenuItem, Modal } from 'shared/components'
5+
import { showAppNotification } from '@lib/auxiliary/notification'
6+
import { setClipboard } from '@lib/core/utils'
7+
import { activeProfile, getStorageDirectoryOfProfile } from '@lib/core/profile'
8+
9+
export let modal: Modal | undefined
10+
11+
async function handleCopyProfileSystemLocation(): Promise<void> {
12+
const profileDirectory = await getStorageDirectoryOfProfile($activeProfile?.id)
13+
setClipboard(profileDirectory, false)
14+
showAppNotification({
15+
type: 'info',
16+
message: localize('general.copiedToClipboard'),
17+
})
18+
modal?.close()
19+
}
20+
</script>
21+
22+
<Modal bind:this={modal} {...$$restProps}>
23+
<div class="flex flex-col">
24+
<MenuItem
25+
icon={Icon.Copy}
26+
title={localize('actions.copyProfileSystemLocation')}
27+
onClick={handleCopyProfileSystemLocation}
28+
/>
29+
</div>
30+
</Modal>

packages/shared/components/modals/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ export { default as AssetActionsModal } from './AssetActionsModal.svelte'
22
export { default as CollectibleActionsModal } from './CollectibleActionsModal.svelte'
33
export { default as Modal } from './Modal.svelte'
44
export { default as ProfileActionsModal } from './ProfileActionsModal.svelte'
5+
export { default as InitProfileActionsModal } from './InitProfileActionsModal.svelte'

packages/shared/locales/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,8 @@
14081408
"revote": "Revote",
14091409
"skipAndKeep": "Skip and keep old password",
14101410
"addChain": "Add chain",
1411-
"viewVestingRewardsFinder": "Find vesting rewards"
1411+
"viewVestingRewardsFinder": "Find vesting rewards",
1412+
"copyProfileSystemLocation": "Copy profile system location"
14121413
},
14131414
"general": {
14141415
"recipient": "Recipient",

0 commit comments

Comments
 (0)