Skip to content

Commit

Permalink
Improved: select operating time modal (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais committed Nov 15, 2023
1 parent 72acd0a commit c4fdeeb
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 16 deletions.
70 changes: 54 additions & 16 deletions src/components/SelectOperatingTimeModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,63 @@

<ion-content>
<ion-list>
<ion-item>
<ion-item lines="none">
<ion-label>
{{ "Start Time" }}
{{ translate("Opening Time") }}
</ion-label>
<ion-button fill="outline">Change</ion-button>
<ion-button color="medium" @click="selectTime">{{ "10:45 am" }}</ion-button>
</ion-item>
<ion-item lines="none">
<ion-label>
{{ translate("Closing Time") }}
</ion-label>
<ion-button color="medium" @click="selectTime">{{ "10:45 am" }}</ion-button>
</ion-item>
</ion-list>

<ion-fab vertical="bottom" horizontal="end" slot="fixed">
<ion-fab-button>
<ion-icon :icon="saveOutline" />
</ion-fab-button>
</ion-fab>
</ion-content>

<ion-modal class="date-time-modal" :is-open="isTimeModalOpen" @didDismiss="() => isTimeModalOpen = false">
<ion-content>
<ion-datetime
presentation="time"
show-default-buttons
hour-cycle="h12"
/>
</ion-content>
</ion-modal>

<ion-footer>
<ion-toolbar>
<ion-item lines="none">
<ion-button color="danger">{{ translate("Reset") }}</ion-button>
</ion-item>
<ion-item slot="end" lines="none">
<ion-button class="ion-margin-end" fill="outline">{{ translate("Cancel") }}</ion-button>
<ion-button >{{ translate("Save") }}</ion-button>
</ion-item>
</ion-toolbar>
</ion-footer>
</template>

<script lang="ts">
import {
IonButtons,
IonButton,
IonContent,
IonFab,
IonFabButton,
IonDatetime,
IonFooter,
IonHeader,
IonIcon,
IonItem,
IonLabel,
IonList,
IonModal,
IonTitle,
IonToolbar,
modalController
} from "@ionic/vue";
import { defineComponent } from "vue";
import { closeOutline, saveOutline } from "ionicons/icons";
import { closeOutline } from "ionicons/icons";
import { translate } from '@hotwax/dxp-components'
export default defineComponent({
Expand All @@ -54,28 +77,43 @@ export default defineComponent({
IonButtons,
IonButton,
IonContent,
IonFab,
IonFabButton,
IonDatetime,
IonFooter,
IonHeader,
IonIcon,
IonItem,
IonLabel,
IonList,
IonModal,
IonTitle,
IonToolbar,
},
data() {
return {
isTimeModalOpen: false as boolean
}
},
methods: {
closeModal() {
modalController.dismiss({ dismissed: true});
},
selectTime() {
this.isTimeModalOpen = true
}
},
setup() {
return {
closeOutline,
saveOutline,
translate
};
},
});
</script>


<style scoped>
ion-modal.date-time-modal {
--width: 290px;
--height: 440px;
--border-radius: 8px;
}
</style>
4 changes: 4 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"Change time zone": "Change time zone",
"City": "City",
"Click the backdrop to dismiss.": "Click the backdrop to dismiss.",
"Closing Time": "Closing Time",
"Configure the order fulfillment capacity of your facility.": "Configure the order fulfillment capacity of your facility.",
"Country": "Country",
"Days to ship": "Days to ship",
Expand All @@ -33,11 +34,14 @@
"No time zone found": "No time zone found",
"OMS": "OMS",
"Online Order Fulfillment": "Online Order Fulfillment",
"Opening Time": "Opening Time",
"Operating hours": "Operating hours",
"Password": "Password",
"primary store": "primary store",
"Product Stores": "Product Stores",
"Reset": "Reset",
"Saturday": "Saturday",
"Save": "Save",
"Select time": "Select time",
"Select time zone": "Select time zone",
"Search time zones": "Search time zones",
Expand Down

0 comments on commit c4fdeeb

Please sign in to comment.