Browse Source

fix: disbale toolbar and top bar

pull/9323/head
DarkPhoenix2704 2 months ago
parent
commit
8a2048f8a5
  1. 8
      packages/nc-gui/components/feed/Changelog/Item.vue
  2. 2
      packages/nc-gui/components/feed/Changelog/index.vue
  3. 14
      packages/nc-gui/components/feed/Recents/Card.vue
  4. 4
      packages/nc-gui/components/feed/Recents/index.vue
  5. 20
      packages/nc-gui/components/feed/Roadmap.vue
  6. 5
      packages/nc-gui/components/feed/Social.vue
  7. 2
      packages/nc-gui/components/feed/View.vue
  8. 15
      packages/nc-gui/components/feed/Youtube/Player.vue
  9. 6
      packages/nc-gui/components/smartsheet/Toolbar.vue
  10. 5
      packages/nc-gui/layouts/shared-view.vue

8
packages/nc-gui/components/feed/Changelog/Item.vue

@ -62,7 +62,7 @@ const renderedText = computedAsync(async () => {
</div> </div>
<div class="content"> <div class="content">
<div class="flex flex-col py-6 gap-8"> <div class="flex flex-col py-6 gap-5">
<div class="flex items-center"> <div class="flex items-center">
<div <div
v-for="tag in tags" v-for="tag in tags"
@ -73,7 +73,7 @@ const renderedText = computedAsync(async () => {
'bg-green-50': tag.color === 'green', 'bg-green-50': tag.color === 'green',
}" }"
:href="tag.href" :href="tag.href"
class="mr-4 flex gap-2 items-center px-1 rounded-md" class="mr-3 flex gap-2 items-center px-1 rounded-md"
> >
<component <component
:is="tag.icon" :is="tag.icon"
@ -90,7 +90,7 @@ const renderedText = computedAsync(async () => {
'text-purple-500': tag.color === 'purple', 'text-purple-500': tag.color === 'purple',
'text-green-500': tag.color === 'green', 'text-green-500': tag.color === 'green',
}" }"
class="leading-5" class="leading-5 text-[13px]"
> >
{{ tag.text }} {{ tag.text }}
</span> </span>
@ -147,7 +147,7 @@ const renderedText = computedAsync(async () => {
@apply sticky top-0 @apply sticky top-0
transform: translateY(calc(-50% + 3px)) translateX(50%); transform: translateY(calc(-50% + 3px)) translateX(50%);
&:before { &:before {
@apply bg-brand-500 absolute w-1.5 h-1.5 left-0 rounded-full transform -translate-x-1/2; @apply bg-brand-500 absolute w-2 h-2 border-2 border-white left-0 rounded-full transform -translate-x-1/2;
content: ''; content: '';
} }
} }

2
packages/nc-gui/components/feed/Changelog/index.vue

@ -27,7 +27,7 @@ const { isLoading } = useInfiniteScroll(
class="overflow-y-auto nc-scrollbar-md mx-auto w-full" class="overflow-y-auto nc-scrollbar-md mx-auto w-full"
> >
<div class="max-w-260 mx-auto"> <div class="max-w-260 mx-auto">
<FeedChangelogItem v-for="feed in githubFeed" :item="feed" /> <FeedChangelogItem v-for="feed in githubFeed" :key="feed.Id" :item="feed" />
</div> </div>
</div> </div>
</template> </template>

14
packages/nc-gui/components/feed/Recents/Card.vue

@ -19,9 +19,9 @@ const {
} = props } = props
const feedIcon = { const feedIcon = {
'Twitter': iconMap.twitter, Twitter: iconMap.twitter,
'Youtube': iconMap.youtube, Youtube: iconMap.youtube,
'Github Release': iconMap.githubSolid, Github: iconMap.githubSolid,
} }
const renderedText = computedAsync(async () => { const renderedText = computedAsync(async () => {
@ -40,9 +40,9 @@ const renderedText = computedAsync(async () => {
<template> <template>
<div class="bg-white rounded-2xl" style="width: 656px"> <div class="bg-white rounded-2xl" style="width: 656px">
<div class="flex items-center justify-between px-5 py-5"> <div class="flex items-center justify-between px-5 py-4">
<div class="flex items-center gap-3"> <div class="flex items-center gap-3">
<component :is="feedIcon[source]" class="w-4 h-4 stroke-transparent" /> <component :is="feedIcon[source as any]" class="w-4 h-4 stroke-transparent" />
<span class="font-weight-medium leading-5"> <span class="font-weight-medium leading-5">
{{ source }} {{ source }}
</span> </span>
@ -51,9 +51,9 @@ const renderedText = computedAsync(async () => {
{{ timeAgo(CreatedAt) }} {{ timeAgo(CreatedAt) }}
</div> </div>
</div> </div>
<template v-if="source === 'Github Release'"> <template v-if="source === 'Github'">
<LazyCellAttachmentPreviewImage v-if="Images?.length" :srcs="getPossibleAttachmentSrc(Images[0], 'card_cover')" /> <LazyCellAttachmentPreviewImage v-if="Images?.length" :srcs="getPossibleAttachmentSrc(Images[0], 'card_cover')" />
<div class="prose pl-5 mt-5" v-html="renderedText"></div> <div class="prose px-5 mt-5" v-html="renderedText"></div>
</template> </template>
<template v-else-if="source === 'Youtube'"> <template v-else-if="source === 'Youtube'">
<YoutubeVue3 :videoid="extractYoutubeVideoId(Url)" :height="410" :width="656" :autoplay="0" /> <YoutubeVue3 :videoid="extractYoutubeVideoId(Url)" :height="410" :width="656" :autoplay="0" />

4
packages/nc-gui/components/feed/Recents/index.vue

@ -24,11 +24,11 @@ const { isLoading } = useInfiniteScroll(
<div <div
ref="scrollContainer" ref="scrollContainer"
:style="{ :style="{
height: 'calc(100dvh - var(--toolbar-height) - 3.25rem)', height: 'calc(100dvh - var(--toolbar-height) - 3.1rem)',
}" }"
class="overflow-y-auto nc-scrollbar-md w-full" class="overflow-y-auto nc-scrollbar-md w-full"
> >
<div class="flex flex-col items-center gap-6"> <div class="flex flex-col my-6 items-center gap-6">
<FeedRecentsCard v-for="feed in socialFeed" :key="feed.Id" :item="feed" /> <FeedRecentsCard v-for="feed in socialFeed" :key="feed.Id" :item="feed" />
</div> </div>
</div> </div>

20
packages/nc-gui/components/feed/Roadmap.vue

@ -4,22 +4,6 @@ const iFrame = ref<HTMLIFrameElement | null>(null)
const isLoaded = ref(false) const isLoaded = ref(false)
const handleIframeLoad = () => { const handleIframeLoad = () => {
if (!iFrame.value) {
return
}
const iframeDocument = iFrame.value?.contentDocument || iFrame.value?.contentWindow?.document
const classList = ['.nc-table-topbar', '.nc-table-toolbar']
for (const className of classList) {
nextTick(() => {
const element = iframeDocument?.querySelector(className)
if (element) {
element.remove()
}
})
}
isLoaded.value = true isLoaded.value = true
} }
</script> </script>
@ -27,7 +11,7 @@ const handleIframeLoad = () => {
<template> <template>
<div <div
:style="{ :style="{
height: 'calc(100dvh - var(--toolbar-height))', height: 'calc(100dvh - var(--toolbar-height) + 4rem)',
}" }"
:class="{ :class="{
'hidden': !isLoaded, 'hidden': !isLoaded,
@ -40,7 +24,7 @@ const handleIframeLoad = () => {
<iframe <iframe
ref="iFrame" ref="iFrame"
src="http://localhost:3000/#/nc/kanban/dc9d297d-2d89-4a33-9804-87924148913a" src="http://localhost:3000/#/nc/kanban/dc9d297d-2d89-4a33-9804-87924148913a?disableTopbar=true&disableToolbar=true"
width="100%" width="100%"
height="100%" height="100%"
style="border: none" style="border: none"

5
packages/nc-gui/components/feed/Social.vue

@ -33,16 +33,17 @@ const openUrl = (url: string) => {
</script> </script>
<template> <template>
<div style="width: 232px" class="flex flex-col border-gray-200 rounded-lg border-1"> <div style="width: 232px" class="flex flex-col bg-white border-gray-200 rounded-lg border-1">
<div class="text-gray-800 font-semibold leading-6 border-b-1 border-gray-200 px-4 py-3">Stay tuned</div> <div class="text-gray-800 font-semibold leading-6 border-b-1 border-gray-200 px-4 py-3">Stay tuned</div>
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<div <div
v-for="social in socialIcons" v-for="social in socialIcons"
:key="social.name" :key="social.name"
class="flex items-center cursor-pointer rounded-lg hover:bg-gray-100 py-3 px-4 gap-2 text-gray-800" class="flex items-center cursor-pointer rounded-lg hover:bg-gray-100 py-3 px-4 gap-2 text-gray-800"
@click="openUrl(social.link)"
> >
<component :is="social.icon" class="w-5 h-5 stroke-transparent" /> <component :is="social.icon" class="w-5 h-5 stroke-transparent" />
<span class="font-semibold" @click="openUrl(social.link)">{{ social.name }}</span> <span class="font-semibold">{{ social.name }}</span>
</div> </div>
</div> </div>
</div> </div>

2
packages/nc-gui/components/feed/View.vue

@ -43,7 +43,7 @@ const tabs = [
<template> <template>
<FeedHeader /> <FeedHeader />
<FeedSocial class="absolute right-4 top-28" /> <FeedSocial v-if="activeTab === 'recents'" class="absolute right-4 top-28" />
<div class="flex flex-col h-full"> <div class="flex flex-col h-full">
<NcTabs v-model:activeKey="activeTab" centered> <NcTabs v-model:activeKey="activeTab" centered>
<a-tab-pane v-for="tab in tabs" :key="tab.key" class="bg-gray-50 !h-full"> <a-tab-pane v-for="tab in tabs" :key="tab.key" class="bg-gray-50 !h-full">

15
packages/nc-gui/components/feed/Youtube/Player.vue

@ -14,9 +14,17 @@ const {
</script> </script>
<template> <template>
<div class="flex flex-col mt-6 gap-5"> <div class="mt-6 border-b-1 border-gray-200">
<YoutubeVue3 :videoid="extractYoutubeVideoId(Url)" :height="470" :width="764" :autoplay="0" :controls="1" /> <YoutubeVue3
:videoid="extractYoutubeVideoId(Url)"
class="!rounded-xl"
:height="470"
:width="764"
:autoplay="0"
:controls="1"
/>
<div class="flex flex-col py-5 gap-4">
<div class="text-gray-900 font-bold text-2xl"> <div class="text-gray-900 font-bold text-2xl">
{{ Title }} {{ Title }}
</div> </div>
@ -24,6 +32,5 @@ const {
{{ Description.length > 200 ? `${Description.slice(0, 280)}...` : Description }} {{ Description.length > 200 ? `${Description.slice(0, 280)}...` : Description }}
</div> </div>
</div> </div>
</div>
</template> </template>
<style lang="scss"></style>

6
packages/nc-gui/components/smartsheet/Toolbar.vue

@ -12,6 +12,10 @@ const containerRef = ref<HTMLElement>()
const { width } = useElementSize(containerRef) const { width } = useElementSize(containerRef)
const router = useRouter()
const disableToolbar = computed(() => router.currentRoute.value.query?.disableToolbar === 'true')
const isTab = computed(() => { const isTab = computed(() => {
if (!isCalendar.value) return false if (!isCalendar.value) return false
return width.value > 1200 return width.value > 1200
@ -29,7 +33,7 @@ provide(IsToolbarIconMode, isToolbarIconMode)
<template> <template>
<div <div
v-if="!isMobileMode" v-if="!isMobileMode && !disableToolbar"
ref="containerRef" ref="containerRef"
:class="{ :class="{
'px-4': isMobileMode, 'px-4': isMobileMode,

5
packages/nc-gui/layouts/shared-view.vue

@ -7,6 +7,10 @@ const { sharedView, allowCSVDownload } = useSharedView()
const router = useRouter() const router = useRouter()
const route = router.currentRoute
const disableTopbar = computed(() => route.value.query?.disableTopbar === 'true')
onMounted(() => { onMounted(() => {
// check if we are inside an iframe // check if we are inside an iframe
// if we are, communicate to the parent page whenever we navigate to a new url, // if we are, communicate to the parent page whenever we navigate to a new url,
@ -50,6 +54,7 @@ export default {
<a-layout id="nc-app"> <a-layout id="nc-app">
<a-layout class="!flex-col bg-white"> <a-layout class="!flex-col bg-white">
<a-layout-header <a-layout-header
v-if="!disableTopbar"
class="nc-table-topbar flex items-center justify-between !bg-transparent !px-3 !py-2 border-b-1 border-gray-200 !h-[46px]" class="nc-table-topbar flex items-center justify-between !bg-transparent !px-3 !py-2 border-b-1 border-gray-200 !h-[46px]"
> >
<div class="flex items-center gap-6 h-7 max-w-[calc(100%_-_280px)] xs:max-w-[calc(100%_-_90px)]"> <div class="flex items-center gap-6 h-7 max-w-[calc(100%_-_280px)] xs:max-w-[calc(100%_-_90px)]">

Loading…
Cancel
Save