@edgedev/create-edge-app 1.0.62 → 1.0.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,8 @@
1
1
  <script setup lang="ts">
2
+ import { SIDEBAR_WIDTH_MOBILE, useSidebar } from './utils'
2
3
  import type { SidebarProps } from '.'
3
4
  import { Sheet, SheetContent } from '@/components/ui/sheet'
4
5
  import { cn } from '@/lib/utils'
5
- import { SIDEBAR_WIDTH_MOBILE, useSidebar } from './utils'
6
-
7
- defineOptions({
8
- inheritAttrs: false,
9
- })
10
6
 
11
7
  const props = withDefaults(defineProps<SidebarProps>(), {
12
8
  side: 'left',
@@ -14,6 +10,10 @@ const props = withDefaults(defineProps<SidebarProps>(), {
14
10
  collapsible: 'offcanvas',
15
11
  })
16
12
 
13
+ defineOptions({
14
+ inheritAttrs: false,
15
+ })
16
+
17
17
  const { isMobile, state, openMobile, setOpenMobile } = useSidebar()
18
18
  </script>
19
19
 
@@ -31,7 +31,7 @@ const { isMobile, state, openMobile, setOpenMobile } = useSidebar()
31
31
  data-sidebar="sidebar"
32
32
  data-mobile="true"
33
33
  :side="side"
34
- class="w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden"
34
+ :class="cn('w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden', props.class)"
35
35
  :style="{
36
36
  '--sidebar-width': SIDEBAR_WIDTH_MOBILE,
37
37
  }"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgedev/create-edge-app",
3
- "version": "1.0.62",
3
+ "version": "1.0.63",
4
4
  "description": "Create Edge Starter App",
5
5
  "bin": {
6
6
  "create-edge-app": "./bin/cli.js"
@@ -57,7 +57,7 @@ const page = computed(() => {
57
57
  <div
58
58
  v-if="edgeFirebase?.user?.loggedIn"
59
59
  >
60
- <Card class="w-full flex-1 bg-muted/50 max-w-7xl m-auto ">
60
+ <Card class="w-full flex-1 bg-muted/50 m-auto">
61
61
  <edge-organization-settings v-if="page === 'organization-settings'" :subscribe-options="subscribeOptions" :form-schema="orgSchema" :org-fields="orgFields" />
62
62
  <edge-my-account v-if="page === 'my-account'" />
63
63
  <edge-my-profile v-if="page === 'my-profile'" :form-schema="metaSchema" :meta-fields="metaFields" />
@@ -0,0 +1,73 @@
1
+ <script setup>
2
+ const edgeFirebase = inject('edgeFirebase')
3
+ const isAdmin = computed(() => {
4
+ const orgRole = edgeFirebase?.user?.roles.find(role =>
5
+ role.collectionPath === edgeGlobal.edgeState.organizationDocPath.replaceAll('/', '-'),
6
+ )
7
+ return orgRole && orgRole.role === 'admin'
8
+ })
9
+
10
+ const adminMenuItems = [
11
+ {
12
+ title: 'Organization',
13
+ to: '/app/account/organization-settings',
14
+ icon: 'Settings',
15
+ },
16
+ {
17
+ title: 'Members',
18
+ to: '/app/account/organization-members',
19
+ icon: 'Users',
20
+ },
21
+ ]
22
+
23
+ const menuItems = [
24
+ {
25
+ title: 'Profile',
26
+ to: '/app/account/my-profile',
27
+ icon: 'User',
28
+ },
29
+ {
30
+ title: 'Account',
31
+ to: '/app/account/my-account',
32
+ icon: 'CircleUser',
33
+ },
34
+ {
35
+ title: 'Organizations',
36
+ to: '/app/account/my-organizations',
37
+ icon: 'Group',
38
+ },
39
+ ]
40
+ </script>
41
+
42
+ <template>
43
+ <div
44
+ v-if="edgeGlobal.edgeState.organizationDocPath"
45
+ >
46
+ <div class="h-full p-0">
47
+ <SidebarProvider class="min-h-full">
48
+ <div class="h-full md:w-[180px]">
49
+ <edge-side-menu
50
+ :menu-items="menuItems"
51
+ :settings-menu-items="isAdmin ? adminMenuItems : []"
52
+ collapsible="submenu"
53
+ class="bg-background text-foreground border-none w-[180px] absolute shadow-none"
54
+ :show-settings-section="false"
55
+ title="My Settings"
56
+ settings-title="Organization Settings"
57
+ group-label-classes="text-foreground/70"
58
+ >
59
+ <template #header>
60
+ <h1 class="text-xl">
61
+ Settings
62
+ </h1>
63
+ </template>
64
+ </edge-side-menu>
65
+ </div>
66
+ <NuxtPage class="flex-1 flex flex-col overflow-y-auto p-3" keepalive />
67
+ </SidebarProvider>
68
+ </div>
69
+ </div>
70
+ </template>
71
+
72
+ <style lang="scss">
73
+ </style>