From 632a0b7fe30c58a8f1735d64ab666050f924724a Mon Sep 17 00:00:00 2001 From: ChaituVR Date: Thu, 9 Nov 2023 16:37:39 +0530 Subject: [PATCH] Refactor date input components to use is-editing prop --- src/components/SpaceCreateVoting.vue | 4 ++-- src/components/SpaceCreateVotingDateEnd.vue | 5 ++++- src/components/SpaceCreateVotingDateStart.vue | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/SpaceCreateVoting.vue b/src/components/SpaceCreateVoting.vue index 4873ad0ed6a9..0a999e25ac42 100644 --- a/src/components/SpaceCreateVoting.vue +++ b/src/components/SpaceCreateVoting.vue @@ -192,14 +192,14 @@ defineEmits<{ diff --git a/src/components/SpaceCreateVotingDateEnd.vue b/src/components/SpaceCreateVotingDateEnd.vue index ac385699b700..0d8bf1bf8d36 100644 --- a/src/components/SpaceCreateVotingDateEnd.vue +++ b/src/components/SpaceCreateVotingDateEnd.vue @@ -4,6 +4,7 @@ const { d } = useI18n(); const props = withDefaults( defineProps<{ period?: number | null; + isEditing?: boolean; date: number; }>(), { @@ -12,6 +13,7 @@ const props = withDefaults( ); const dateString = computed(() => d(props.date * 1e3, 'short', 'en-US')); +const isDisabled = computed(() => !!props.period || props.isEditing); const emit = defineEmits(['select']); @@ -20,9 +22,10 @@ const emit = defineEmits(['select']); diff --git a/src/components/SpaceCreateVotingDateStart.vue b/src/components/SpaceCreateVotingDateStart.vue index c7c53df2bef6..09c3ad544c48 100644 --- a/src/components/SpaceCreateVotingDateStart.vue +++ b/src/components/SpaceCreateVotingDateStart.vue @@ -4,6 +4,7 @@ const { t, d } = useI18n(); const props = withDefaults( defineProps<{ delay?: number | null; + isEditing?: boolean; date: number; }>(), { @@ -17,6 +18,7 @@ const dateString = computed(() => ? t('create.now') : d(props.date * 1e3, 'short', 'en-US') ); +const isDisabled = computed(() => !!props.delay || props.isEditing); const emit = defineEmits(['select']); @@ -25,9 +27,10 @@ const emit = defineEmits(['select']);