refactor: improvements made to how banners are to be dismissed (#3656)
This commit is contained in:
committed by
GitHub
parent
93082c3816
commit
cf8b5975ac
@@ -14,7 +14,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<icon-lucide-x
|
<icon-lucide-x
|
||||||
v-if="dismissible"
|
v-if="banner.dismissible"
|
||||||
class="opacity-50 hover:cursor-pointer hover:opacity-100"
|
class="opacity-50 hover:cursor-pointer hover:opacity-100"
|
||||||
@click="emit('dismiss')"
|
@click="emit('dismiss')"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -214,7 +214,7 @@
|
|||||||
<AppBanner
|
<AppBanner
|
||||||
v-if="bannerContent"
|
v-if="bannerContent"
|
||||||
:banner="bannerContent"
|
:banner="bannerContent"
|
||||||
:dismissible="true"
|
:dismissable="bannerContent.dismissible"
|
||||||
@dismiss="dismissOfflineBanner"
|
@dismiss="dismissOfflineBanner"
|
||||||
/>
|
/>
|
||||||
<TeamsModal :show="showTeamsModal" @hide-modal="showTeamsModal = false" />
|
<TeamsModal :show="showTeamsModal" @hide-modal="showTeamsModal = false" />
|
||||||
@@ -295,6 +295,7 @@ const offlineBanner: BannerContent = {
|
|||||||
text: (t) => t("helpers.offline"),
|
text: (t) => t("helpers.offline"),
|
||||||
alternateText: (t) => t("helpers.offline_short"),
|
alternateText: (t) => t("helpers.offline_short"),
|
||||||
score: BANNER_PRIORITY_HIGH,
|
score: BANNER_PRIORITY_HIGH,
|
||||||
|
dismissible: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
const network = reactive(useNetwork())
|
const network = reactive(useNetwork())
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export type BannerContent = {
|
|||||||
alternateText?: (t: ReturnType<typeof getI18n>) => string
|
alternateText?: (t: ReturnType<typeof getI18n>) => string
|
||||||
// Used to determine which banner should be displayed when multiple banners are present
|
// Used to determine which banner should be displayed when multiple banners are present
|
||||||
score: number
|
score: number
|
||||||
|
dismissible?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Banner = {
|
export type Banner = {
|
||||||
|
|||||||
@@ -30,8 +30,10 @@ declare module '@vue/runtime-core' {
|
|||||||
HoppSmartTable: typeof import('@hoppscotch/ui')['HoppSmartTable']
|
HoppSmartTable: typeof import('@hoppscotch/ui')['HoppSmartTable']
|
||||||
HoppSmartTabs: typeof import('@hoppscotch/ui')['HoppSmartTabs']
|
HoppSmartTabs: typeof import('@hoppscotch/ui')['HoppSmartTabs']
|
||||||
HoppSmartToggle: typeof import('@hoppscotch/ui')['HoppSmartToggle']
|
HoppSmartToggle: typeof import('@hoppscotch/ui')['HoppSmartToggle']
|
||||||
|
IconLucideArrowLeft: typeof import('~icons/lucide/arrow-left')['default']
|
||||||
IconLucideChevronDown: typeof import('~icons/lucide/chevron-down')['default']
|
IconLucideChevronDown: typeof import('~icons/lucide/chevron-down')['default']
|
||||||
IconLucideInbox: typeof import('~icons/lucide/inbox')['default']
|
IconLucideInbox: typeof import('~icons/lucide/inbox')['default']
|
||||||
|
IconLucideUser: typeof import('~icons/lucide/user')['default']
|
||||||
SettingsAuthProvider: typeof import('./components/settings/AuthProvider.vue')['default']
|
SettingsAuthProvider: typeof import('./components/settings/AuthProvider.vue')['default']
|
||||||
SettingsConfigurations: typeof import('./components/settings/Configurations.vue')['default']
|
SettingsConfigurations: typeof import('./components/settings/Configurations.vue')['default']
|
||||||
SettingsReset: typeof import('./components/settings/Reset.vue')['default']
|
SettingsReset: typeof import('./components/settings/Reset.vue')['default']
|
||||||
|
|||||||
Reference in New Issue
Block a user