diff --git a/src/views/Auth/components/ImportWalletComponent.vue b/src/views/Auth/components/ImportWalletComponent.vue
index 6fd4d7c..6822b05 100644
--- a/src/views/Auth/components/ImportWalletComponent.vue
+++ b/src/views/Auth/components/ImportWalletComponent.vue
@@ -1,99 +1,35 @@
@@ -113,68 +49,25 @@ const handleContinue = () => {
-
-
-
-
-
-
-
-
-
-
{{ seedError }}
+
Continue
@@ -230,93 +123,13 @@ const handleContinue = () => {
.tab-pane {
margin-top: 0.5rem;
}
- .seed-row-radio {
- display: flex;
- gap: 24px;
- align-items: center;
- margin-bottom: 16px;
- .radio {
- background: var(--bg-secondary);
- color: var(--text-secondary);
- border-radius: 14px;
- font-size: 1.08rem;
- padding: 7px 24px 7px 18px;
- font-weight: 500;
- display: flex;
- align-items: center;
- gap: 5px;
- &.active {
- background: var(--primary-color);
- color: var(--text-light);
- }
- opacity: 1;
- }
- }
- .seed-inputs {
- width: 100%;
- }
- .seed-input-grid {
- display: grid;
- grid-template-columns: repeat(4, 1fr);
- gap: 12px;
- }
- .seed-box input {
- width: 100%;
- padding: 8px 12px;
- border-radius: 9px;
- border: 2px solid var(--border-color);
- background: var(--bg-secondary);
- color: var(--text-secondary);
- outline: none;
- font-size: 15px;
- transition:
- border 0.16s,
- box-shadow 0.16s;
- &:focus {
- border-color: var(--primary-color);
- box-shadow: 0 2px 8px var(--shadow-primary);
- }
- &.error {
- border-color: var(--error-color);
- background: var(--bg-secondary);
- color: var(--text-light);
- }
- }
- .form-row {
- margin-top: 19px;
- margin-bottom: 4px;
- }
- .paste-hint {
- text-align: center;
- font-size: var(--font-sm);
- color: var(--text-secondary);
- margin-top: var(--spacing-md);
- padding: var(--spacing-sm) var(--spacing-md);
- background: var(--bg-secondary);
- border-radius: var(--radius-md);
- }
- .mt-sm {
- margin-top: 9px;
- }
- .mb-md {
- margin-bottom: 14px;
- }
.mt-lg {
margin-top: 32px;
}
- .error-text {
- color: var(--error-color);
- font-size: 0.97em;
- margin-top: 3px;
- }
}
@include screen(mobile) {
.import-wallet {
padding: 16px 5px;
}
- .seed-input-grid {
- gap: 8px;
- grid-template-columns: repeat(3, 1fr);
- }
}
diff --git a/src/views/Auth/components/KeystoreTab.vue b/src/views/Auth/components/KeystoreTab.vue
new file mode 100644
index 0000000..ba33029
--- /dev/null
+++ b/src/views/Auth/components/KeystoreTab.vue
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
diff --git a/src/views/Auth/components/LoginTab.vue b/src/views/Auth/components/LoginTab.vue
index 2f83339..6cbb6ea 100644
--- a/src/views/Auth/components/LoginTab.vue
+++ b/src/views/Auth/components/LoginTab.vue
@@ -7,10 +7,7 @@ const emit = defineEmits<{ goToCreate: [] }>()
const stage = ref<'import' | 'password'>('import')
const importData = ref(null)
-const handleImported = (payload: {
- type: 'seed' | 'keystore'
- value: string | string[]
-}) => {
+const handleImported = (payload: { type: 'seed' | 'keystore'; value: string | string[] }) => {
importData.value = payload
stage.value = 'password'
}
@@ -22,8 +19,8 @@ const handleNavigateToCreate = () => {
-
+import { ref } from 'vue'
+import { validateSeedPhrase18 } from '@/utils/helpers/seedPhrase'
+
+const emit = defineEmits<{
+ (e: 'update:valid', valid: boolean): void
+ (e: 'submit', words: string[]): void
+}>()
+
+const seedWords = ref(Array.from({ length: 18 }, () => ''))
+const seedError = ref('')
+
+const updateValidity = () => {
+ const words = seedWords.value.filter((w) => w.trim())
+ const isValid = words.length === 18 && !seedError.value
+ emit('update:valid', isValid)
+}
+
+const inputBoxFocus = (idx: number) => {
+ document.getElementById('input-' + idx)?.focus()
+}
+
+const handleGridInput = (index: number, value: string) => {
+ seedWords.value[index] = value
+ updateValidity()
+}
+
+const handlePaste = (event: ClipboardEvent) => {
+ event.preventDefault()
+ const pastedData = event.clipboardData?.getData('text') || ''
+ const words = pastedData
+ .trim()
+ .split(/\s+/)
+ .filter((w) => w)
+
+ if (words.length === 0) return
+
+ seedWords.value = words
+ seedError.value = ''
+ updateValidity()
+}
+
+const validateSeed = () => {
+ const words = seedWords.value.filter((w) => w.trim())
+
+ if (words.length !== 18) {
+ seedError.value = 'Please enter all 18 words.'
+ return false
+ }
+ if (!validateSeedPhrase18(words)) {
+ seedError.value = 'One or more words are invalid.'
+ return false
+ }
+ seedError.value = ''
+ return true
+}
+
+const handleSubmit = () => {
+ if (validateSeed()) {
+ emit('submit', seedWords.value.filter((w) => w.trim()))
+ }
+ updateValidity()
+}
+
+defineExpose({
+ handleSubmit,
+})
+
+
+
+
+
+
+
+
+
{{ seedError }}
+
+
+
+
+
diff --git a/src/views/Auth/components/index.ts b/src/views/Auth/components/index.ts
index cca054e..559e03e 100644
--- a/src/views/Auth/components/index.ts
+++ b/src/views/Auth/components/index.ts
@@ -3,6 +3,8 @@ export { default as LoginTab } from './LoginTab.vue'
export { default as CreateTab } from './CreateTab.vue'
export { default as RecoveryTab } from './RecoveryTab.vue'
export { default as ConfirmTab } from './ConfirmTab.vue'
+export { default as SeedPhraseTab } from './SeedPhraseTab.vue'
+export { default as KeystoreTab } from './KeystoreTab.vue'
// Auth Components
export { default as OnboardingComponent } from './OnboardingComponent.vue'