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