Browse Source

feat: Integrated OpenLeftSidebarBtn icon with mobile view and view info with mobile

pull/6474/head
Muhammed Mustafa 1 year ago
parent
commit
5c83a74e6d
  1. 7
      packages/nc-gui/components/general/OpenLeftSidebarBtn.vue
  2. 2
      packages/nc-gui/components/smartsheet/toolbar/ViewInfo.vue
  3. 1
      packages/nc-gui/utils/iconUtils.ts

7
packages/nc-gui/components/general/OpenLeftSidebarBtn.vue

@ -2,6 +2,8 @@
const { isLeftSidebarOpen: _isLeftSidebarOpen } = storeToRefs(useSidebarStore()) const { isLeftSidebarOpen: _isLeftSidebarOpen } = storeToRefs(useSidebarStore())
const isLeftSidebarOpen = ref(_isLeftSidebarOpen.value) const isLeftSidebarOpen = ref(_isLeftSidebarOpen.value)
const { isMobileMode } = useGlobal()
watch(_isLeftSidebarOpen, (val) => { watch(_isLeftSidebarOpen, (val) => {
if (val) { if (val) {
isLeftSidebarOpen.value = true isLeftSidebarOpen.value = true
@ -37,7 +39,7 @@ const onClick = () => {
}} }}
</template> </template>
<NcButton <NcButton
type="text" :type="isMobileMode ? 'secondary' : 'text'"
size="small" size="small"
class="nc-sidebar-left-toggle-icon !text-gray-600 !hover:text-gray-800" class="nc-sidebar-left-toggle-icon !text-gray-600 !hover:text-gray-800"
:class="{ :class="{
@ -46,7 +48,8 @@ const onClick = () => {
@click="onClick" @click="onClick"
> >
<div class="flex items-center text-inherit"> <div class="flex items-center text-inherit">
<GeneralIcon icon="doubleRightArrow" class="duration-150 transition-all !text-lg -mt-0.25" /> <GeneralIcon v-if="isMobileMode" icon="menu" />
<GeneralIcon v-else icon="doubleRightArrow" class="duration-150 transition-all !text-lg -mt-0.25" />
</div> </div>
</NcButton> </NcButton>
</NcTooltip> </NcTooltip>

2
packages/nc-gui/components/smartsheet/toolbar/ViewInfo.vue

@ -14,7 +14,7 @@ const { activeTable } = storeToRefs(useTablesStore())
:class="{ :class="{
'min-w-2/5 max-w-2/5': !isMobileMode && activeView?.type !== ViewTypes.KANBAN, 'min-w-2/5 max-w-2/5': !isMobileMode && activeView?.type !== ViewTypes.KANBAN,
'min-w-1/4 max-w-1/4': !isMobileMode && activeView?.type === ViewTypes.KANBAN, 'min-w-1/4 max-w-1/4': !isMobileMode && activeView?.type === ViewTypes.KANBAN,
'min-w-1/2 max-w-1/2': isMobileMode, 'min-w-1/2 max-w-1/2 text-base': isMobileMode,
}" }"
> >
<template v-if="!(isMobileMode && !activeView?.is_default)"> <template v-if="!(isMobileMode && !activeView?.is_default)">

1
packages/nc-gui/utils/iconUtils.ts

@ -398,6 +398,7 @@ export const iconMap = {
drag: MaterialSymbolsDragIndicator, drag: MaterialSymbolsDragIndicator,
comment: h('span', { class: 'material-symbols' }, 'comment'), comment: h('span', { class: 'material-symbols' }, 'comment'),
doc: h('span', { class: 'material-symbols' }, 'menu_book'), doc: h('span', { class: 'material-symbols' }, 'menu_book'),
menu: h('span', { class: 'material-symbols' }, 'menu'),
move: MsMove, move: MsMove,
creditCard: NcCreditCard, creditCard: NcCreditCard,
heightShort: NcIconsRowHeightShort, heightShort: NcIconsRowHeightShort,

Loading…
Cancel
Save