Skip to content

Commit 87bfb24

Browse files
committed
refactor(common, survey): minor changes to timepicker type field after rebasing
1 parent d51c70e commit 87bfb24

File tree

3 files changed

+151
-218
lines changed

3 files changed

+151
-218
lines changed

apps/admin/src/components/prompts/standard/meal-time-prompt.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<v-tab-item key="options" value="options">
33
<v-card-text>
44
<v-row>
5-
<v-col class="bg-red" cols="12" lg="4" md="6">
5+
<v-col cols="12" lg="4" md="6">
66
<v-card-title>
7-
{{ $t("survey-schemes.prompts.timePicker.allowedMinutes._") }}
7+
{{ $t('survey-schemes.prompts.timePicker.allowedMinutes._') }}
88
</v-card-title>
99
<v-select
1010
:items="[1, 5, 10, 15, 20, 30]"
@@ -39,7 +39,7 @@
3939
</v-col>
4040
<v-col cols="12" lg="4" md="6">
4141
<v-card-title>
42-
{{ $t("survey-schemes.prompts.timePicker.format._") }}
42+
{{ $t('survey-schemes.prompts.timePicker.format._') }}
4343
</v-card-title>
4444
<v-btn-toggle
4545
class="d-flex"
@@ -53,20 +53,20 @@
5353
:title="$t('survey-schemes.prompts.timePicker.format.24hr')"
5454
value="24hr"
5555
>
56-
{{ $t("survey-schemes.prompts.timePicker.format.24hr") }}
56+
{{ $t('survey-schemes.prompts.timePicker.format.24hr') }}
5757
</v-btn>
5858
<v-btn
5959
class="px-10 flex-grow-1 flex-md-grow-0"
6060
:title="$t('survey-schemes.prompts.timePicker.format.ampm')"
6161
value="ampm"
6262
>
63-
{{ $t("survey-schemes.prompts.timePicker.format.ampm") }}
63+
{{ $t('survey-schemes.prompts.timePicker.format.ampm') }}
6464
</v-btn>
6565
</v-btn-toggle>
6666
</v-col>
6767
<v-col cols="12" lg="6" md="6">
6868
<v-card-title>
69-
{{ $t("survey-schemes.prompts.timePicker.pickerType._") }}
69+
{{ $t('survey-schemes.prompts.timePicker.pickerType._') }}
7070
</v-card-title>
7171
<v-btn-toggle
7272
class="d-flex"
@@ -80,14 +80,14 @@
8080
:title="$t('survey-schemes.prompts.timePicker.pickerType.clock')"
8181
value="clock"
8282
>
83-
{{ $t("survey-schemes.prompts.timePicker.pickerType.clock") }}
83+
{{ $t('survey-schemes.prompts.timePicker.pickerType.clock') }}
8484
</v-btn>
8585
<v-btn
8686
class="px-10 flex-grow-1 flex-md-grow-0"
8787
:title="$t('survey-schemes.prompts.timePicker.pickerType.simple')"
8888
value="simple"
8989
>
90-
{{ $t("survey-schemes.prompts.timePicker.pickerType.simple") }}
90+
{{ $t('survey-schemes.prompts.timePicker.pickerType.simple') }}
9191
</v-btn>
9292
</v-btn-toggle>
9393
</v-col>

apps/survey/src/components/prompts/standard/MealTimePrompt.vue

Lines changed: 2 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777

7878
<script lang="ts">
7979
import type { PropType } from 'vue';
80-
import { computed, defineComponent, ref, watch } from 'vue';
80+
import { computed, defineComponent } from 'vue';
8181
8282
import type { MealState, MealTime } from '@intake24/common/types';
8383
import { fromMealTime, toMealTime } from '@intake24/common/surveys';
@@ -109,8 +109,6 @@ export default defineComponent({
109109
setup(props, ctx) {
110110
const { action, translatePrompt } = usePromptUtils(props, ctx);
111111
112-
const selectedTime = ref('12:00');
113-
114112
const allowedMinutes = computed(
115113
() => (minutes: number) => minutes % props.prompt.allowedMinutes === 0,
116114
);
@@ -125,15 +123,7 @@ export default defineComponent({
125123
});
126124
const isValid = computed(() => !!state.value);
127125
128-
watch(
129-
() => state.value,
130-
(newState) => {
131-
console.log(newState);
132-
},
133-
{ immediate: true },
134-
);
135-
136-
return { action, allowedMinutes, selectedTime, isValid, promptI18n, state };
126+
return { action, allowedMinutes, isValid, promptI18n, state };
137127
},
138128
});
139129
</script>
@@ -144,61 +134,4 @@ export default defineComponent({
144134
justify-content: center;
145135
}
146136
}
147-
148-
.vue__time-picker {
149-
input.display-time {
150-
border-radius: 0.375rem;
151-
border: 1px solid #ddd;
152-
padding: 1.5rem 1rem;
153-
font-size: 1.5rem;
154-
color: #444;
155-
background-color: #fafafa;
156-
transition: all 0.3s ease;
157-
158-
&:focus {
159-
outline: none;
160-
border-color: #fd7e14;
161-
box-shadow: 0 0 8px rgba(253, 126, 20, 0.6);
162-
background-color: #fff;
163-
}
164-
165-
&::placeholder {
166-
color: #bbb;
167-
}
168-
169-
&:hover {
170-
border-color: #fd7e14;
171-
background-color: #fff;
172-
}
173-
}
174-
175-
.dropdown {
176-
margin-top: 1.4rem;
177-
178-
ul {
179-
li {
180-
transition:
181-
background 0.3s,
182-
color 0.3s;
183-
border-radius: 0.5rem;
184-
font-size: 1.2rem;
185-
186-
&:not([disabled]).active {
187-
background: #fd7e14;
188-
color: #fff;
189-
font-weight: bold;
190-
191-
&:hover {
192-
background: rgba(253, 126, 20, 0.9);
193-
}
194-
}
195-
196-
&:hover:not([disabled]) {
197-
background: #f1f1f1;
198-
color: #333;
199-
}
200-
}
201-
}
202-
}
203-
}
204137
</style>

0 commit comments

Comments
 (0)