Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit b207153

Browse files
committed
Disallowed onboarding to proceed to PIN creation unless profile name and DWN are given
1 parent 59925ff commit b207153

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

src/components/Onboarding.vue

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,15 @@
4646
/>
4747
</div>
4848

49-
<button @click="nextStep" class="my-2 w-full bg-[#fcec03] text-black p-2 rounded-full active:bg-yellow-300">Next</button>
49+
<!-- Disable the button unless both inputs are filled -->
50+
<button
51+
@click="nextStep"
52+
:disabled="!canProceedToPinCreation"
53+
class="my-2 w-full bg-[#fcec03] text-black p-2 rounded-full active:bg-yellow-300 disabled:opacity-50"
54+
>
55+
Next
56+
</button>
57+
5058
<button @click="previousStep" class="my-2 w-full bg-gray-500 text-white p-2 rounded-full active:bg-gray-600">Previous</button>
5159
</div>
5260
</div>
@@ -59,7 +67,8 @@
5967

6068
<!-- PinInput Component -->
6169
<PinInput
62-
class="my-4" v-model:pin="pin" :length="6" :mask="false"/>
70+
class="my-4" v-model:pin="pin" :length="6" :mask="false"
71+
/>
6372

6473
<!-- Next button is disabled until pin is obtained -->
6574
<button
@@ -69,6 +78,7 @@
6978
>
7079
Finish
7180
</button>
81+
7282
<button @click="previousStep" class="my-2 w-full bg-gray-500 text-white p-2 rounded-full active:bg-gray-600">Previous</button>
7383
</div>
7484
</div>
@@ -90,7 +100,7 @@
90100

91101
<script setup lang="ts">
92102
import { ProfileManager } from '../ProfileManager';
93-
import { ref } from 'vue';
103+
import { ref, computed } from 'vue';
94104
import PinInput from './PinInput.vue';
95105
96106
// Used for displaying debug info
@@ -102,6 +112,8 @@ const currentStep = ref(1);
102112
// Step 2 inputs
103113
const profileName = ref('');
104114
const dwnEndpoint = ref('https://dwn.tbddev.org/beta');
115+
// Computed property to check if both profileName and dwnEndpoint are filled
116+
const canProceedToPinCreation = computed(() => profileName.value.trim() !== '' && dwnEndpoint.value.trim() !== '');
105117
106118
// Step 3 inputs
107119
const pin = ref('');

src/views/ProfilesView.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="flex flex-col h-screen">
3-
<!-- Top Header -->
4-
<div class="bg-[#fcec03] p-4 flex items-center justify-between">
3+
<!-- Top Header with space for the mobile status bar (time, battery, etc.) -->
4+
<div class="bg-[#fcec03] p-4 flex items-center justify-between pt-24">
55
<p class="text-4xl font-bold">Profiles</p>
66
</div>
77

0 commit comments

Comments
 (0)