create-nextjs-cms 0.8.0 → 0.8.2
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.
- package/package.json +3 -3
- package/templates/default/components/SectionIcon.tsx +8 -0
- package/templates/default/components/Sidebar.tsx +4 -1
- package/templates/default/components/SidebarDropdownItem.tsx +6 -3
- package/templates/default/components/SidebarItem.tsx +5 -1
- package/templates/default/components/form/helpers/_section-hot-reload.js +1 -1
- package/templates/default/package.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-nextjs-cms",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"tsx": "^4.20.6",
|
|
30
30
|
"typescript": "^5.9.2",
|
|
31
31
|
"@lzcms/eslint-config": "0.3.0",
|
|
32
|
-
"@lzcms/
|
|
33
|
-
"@lzcms/
|
|
32
|
+
"@lzcms/prettier-config": "0.1.0",
|
|
33
|
+
"@lzcms/tsconfig": "0.1.0"
|
|
34
34
|
},
|
|
35
35
|
"prettier": "@lzcms/prettier-config",
|
|
36
36
|
"scripts": {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import {DynamicIcon} from 'lucide-react/dynamic'
|
|
4
|
+
import type { IconName } from 'lucide-react/dynamic'
|
|
5
|
+
|
|
6
|
+
export default function SectionIcon({ name, className }: { name: string; className?: string }) {
|
|
7
|
+
return <DynamicIcon name={name as IconName} className={className} />
|
|
8
|
+
}
|
|
@@ -11,6 +11,7 @@ import ProtectedImage from '@/components/ProtectedImage'
|
|
|
11
11
|
import { trpc } from '@/app/_trpc/client'
|
|
12
12
|
import { useToast } from '@/components/ui/use-toast'
|
|
13
13
|
import { logout, useSession } from 'nextjs-cms/auth/react'
|
|
14
|
+
import { LogOut } from 'lucide-react'
|
|
14
15
|
|
|
15
16
|
const Sidebar = (props: SidebarProps & { logoUrlPath: string; logoText: string; isRTL: boolean }) => {
|
|
16
17
|
const t = useI18n()
|
|
@@ -141,17 +142,19 @@ const Sidebar = (props: SidebarProps & { logoUrlPath: string; logoText: string;
|
|
|
141
142
|
item={{
|
|
142
143
|
path: '/settings',
|
|
143
144
|
title: t('accountSettings'),
|
|
145
|
+
icon: 'cog'
|
|
144
146
|
}}
|
|
145
147
|
/>
|
|
146
148
|
<Link
|
|
147
149
|
href='#'
|
|
148
150
|
onClick={handleLogout}
|
|
149
151
|
className={classNames({
|
|
150
|
-
'rounded-lg text-white hover:bg-indigo-900 dark:hover:bg-emerald-600': true, //colors
|
|
152
|
+
'flex flex-row gap-1 items-center rounded-lg hover:text-white hover:bg-indigo-900 dark:hover:bg-emerald-600': true, //colors
|
|
151
153
|
'transition-colors duration-100': false, //animation
|
|
152
154
|
'gap-4 p-2 text-start': true,
|
|
153
155
|
})}
|
|
154
156
|
>
|
|
157
|
+
<LogOut className='size-4' />
|
|
155
158
|
<span>{t('logout')}</span>
|
|
156
159
|
</Link>
|
|
157
160
|
</div>
|
|
@@ -3,8 +3,9 @@ import classNames from 'classnames'
|
|
|
3
3
|
import { useState } from 'react'
|
|
4
4
|
import { SidebarItemProps } from 'nextjs-cms/core/types'
|
|
5
5
|
import { useAutoAnimate } from '@formkit/auto-animate/react'
|
|
6
|
-
import { ChevronDownIcon, ChevronUpIcon, FolderIcon,
|
|
6
|
+
import { ChevronDownIcon, ChevronUpIcon, FolderIcon, PlusIcon } from 'lucide-react'
|
|
7
7
|
import { useI18n } from 'nextjs-cms/translations/client'
|
|
8
|
+
import SectionIcon from '@/components/SectionIcon'
|
|
8
9
|
|
|
9
10
|
export default function SidebarDropdownItem({ item, closeSideBar }: SidebarItemProps) {
|
|
10
11
|
const t = useI18n()
|
|
@@ -22,8 +23,10 @@ export default function SidebarDropdownItem({ item, closeSideBar }: SidebarItemP
|
|
|
22
23
|
onClick={() => setOpen((prev) => !prev)}
|
|
23
24
|
>
|
|
24
25
|
<li className='relative flex w-full items-center justify-between gap-2'>
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
<span className='flex items-center gap-2 text-start'>
|
|
27
|
+
{item.icon && <SectionIcon name={item.icon} className='size-4' />}
|
|
28
|
+
<span>{item.title}</span>
|
|
29
|
+
</span>
|
|
27
30
|
<span>
|
|
28
31
|
{open ? (
|
|
29
32
|
<ChevronUpIcon className='h-5 w-5' />
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Link from 'next/link'
|
|
2
2
|
import classNames from 'classnames'
|
|
3
3
|
import { SidebarItemProps } from 'nextjs-cms/core/types'
|
|
4
|
+
import SectionIcon from '@/components/SectionIcon'
|
|
4
5
|
|
|
5
6
|
export default function SidebarItem({ item, closeSideBar }: SidebarItemProps) {
|
|
6
7
|
return (
|
|
@@ -14,7 +15,10 @@ export default function SidebarItem({ item, closeSideBar }: SidebarItemProps) {
|
|
|
14
15
|
'text-start': true, // RTL support
|
|
15
16
|
})}
|
|
16
17
|
>
|
|
17
|
-
<span>
|
|
18
|
+
<span className='flex items-center gap-2'>
|
|
19
|
+
{item.icon && <SectionIcon name={item.icon} className='size-4' />}
|
|
20
|
+
<span>{item.title}</span>
|
|
21
|
+
</span>
|
|
18
22
|
</Link>
|
|
19
23
|
)
|
|
20
24
|
}
|