From 8a2366536e6defbd7224cdfb2e1457edac4e6a9d Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 8 Aug 2024 15:42:15 +0530 Subject: [PATCH] refactor: sidebar banner ui corrections (#9181) Signed-off-by: Pranav C --- .../nc-gui/components/dashboard/Sidebar.vue | 5 ++- packages/nc-gui/components/general/Gift.vue | 38 +++---------------- 2 files changed, 8 insertions(+), 35 deletions(-) diff --git a/packages/nc-gui/components/dashboard/Sidebar.vue b/packages/nc-gui/components/dashboard/Sidebar.vue index a733d86d32..80090a04f5 100644 --- a/packages/nc-gui/components/dashboard/Sidebar.vue +++ b/packages/nc-gui/components/dashboard/Sidebar.vue @@ -56,8 +56,9 @@ onUnmounted(() => { > - -
+
+ +
diff --git a/packages/nc-gui/components/general/Gift.vue b/packages/nc-gui/components/general/Gift.vue index 2e20498ba7..0d197a0f01 100644 --- a/packages/nc-gui/components/general/Gift.vue +++ b/packages/nc-gui/components/general/Gift.vue @@ -4,15 +4,15 @@ import { OrgUserRoles, extractRolesObj } from 'nocodb-sdk' const { appInfo, giftBannerDismissedCount, user } = useGlobal() const isBannerClosed = ref(true) -const isModalOpen = ref(false) const confirmDialog = ref(false) +const hideImage = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0) < 780 const isAvailable = computed(() => { return ( !isEeUI && user.value?.email && [OrgUserRoles.CREATOR, OrgUserRoles.SUPER_ADMIN].some((r) => extractRolesObj(user.value?.roles)?.[r]) && - !/^[a-zA-Z0-9._%+-]+@(gmail|yahoo|hotmail|outlook|aol|icloud|qq|163|126|sina)(\.com)?$/i.test(user.value?.email) && + !/^[a-zA-Z0-9._%+-]+@(gmail|yahoo|hotmail|outlook|aol|icloud|qq|163|126|sina|nocodb)(\.com)?$/i.test(user.value?.email) && (!giftBannerDismissedCount.value || giftBannerDismissedCount.value < 5) ) }) @@ -26,7 +26,8 @@ if (giftBannerDismissedCount.value) { } const open = () => { - isModalOpen.value = true + giftBannerDismissedCount.value++ + window.open(appInfo.value?.giftUrl, '_blank', 'noopener,noreferrer') } const closeBanner = () => { @@ -49,18 +50,6 @@ const closeAndShowAgain = () => { giftBannerDismissedCount.value++ confirmDialog.value = false } - -const closeModal = () => { - isModalOpen.value = false - giftBannerDismissedCount.value++ - isBannerClosed.value = true -} - -const onVisibleChange = (visible: boolean) => { - if (!visible) { - closeModal() - } -}