coreui 소스를 ts 로 전환 : 추가수정
This commit is contained in:
@@ -10,10 +10,26 @@ const AppFooter = () => {
|
|||||||
</a>
|
</a>
|
||||||
<span className="ms-1">© 2025 creativeLabs.</span>
|
<span className="ms-1">© 2025 creativeLabs.</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<span className="m-2">Referrence :</span>
|
||||||
|
<a href="https://coreui.io/demos/react/5.5/free/?theme=light#/dashboard" target="_blank" rel="noopener noreferrer">
|
||||||
|
Demo
|
||||||
|
</a>
|
||||||
|
<span className="m-2">|</span>
|
||||||
|
<a href="https://coreui.io/react/docs/templates/installation/" target="_blank" rel="noopener noreferrer">
|
||||||
|
Docs
|
||||||
|
</a>
|
||||||
|
<span className="m-2">|</span>
|
||||||
|
<a href="https://github.com/coreui/coreui-free-react-admin-template" target="_blank" rel="noopener noreferrer">
|
||||||
|
Git
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="ms-auto">
|
<div className="ms-auto">
|
||||||
<span className="me-1">Powered by</span>
|
<span className="me-1">Powered by</span>
|
||||||
<a href="https://coreui.io/react" target="_blank" rel="noopener noreferrer">
|
<a href="https://coreui.io/react" target="_blank" rel="noopener noreferrer">
|
||||||
CoreUI React Admin & Dashboard Template
|
CoreUI React
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</CFooter>
|
</CFooter>
|
||||||
|
|||||||
@@ -7,17 +7,38 @@ import 'simplebar-react/dist/simplebar.min.css'
|
|||||||
|
|
||||||
import { CBadge, CNavLink, CSidebarNav } from '@coreui/react'
|
import { CBadge, CNavLink, CSidebarNav } from '@coreui/react'
|
||||||
|
|
||||||
export const AppSidebarNav = ({ items }) => {
|
interface Badge {
|
||||||
const navLink = (name, icon, badge, indent = false) => {
|
color: string
|
||||||
|
text: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface NavItem {
|
||||||
|
component: React.ElementType
|
||||||
|
name?: string
|
||||||
|
icon?: React.ReactNode
|
||||||
|
badge?: Badge
|
||||||
|
indent?: boolean
|
||||||
|
to?: string
|
||||||
|
href?: string
|
||||||
|
items?: NavItem[]
|
||||||
|
[key: string]: any
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AppSidebarNavProps {
|
||||||
|
items: NavItem[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export const AppSidebarNav = ({ items }: AppSidebarNavProps) => {
|
||||||
|
const navLink = (name?: string, icon?: React.ReactNode, badge?: Badge, indent = false) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{icon
|
{icon
|
||||||
? icon
|
? icon
|
||||||
: indent && (
|
: indent && (
|
||||||
<span className="nav-icon">
|
<span className="nav-icon">
|
||||||
<span className="nav-icon-bullet"></span>
|
<span className="nav-icon-bullet"></span>
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{name && name}
|
{name && name}
|
||||||
{badge && (
|
{badge && (
|
||||||
<CBadge color={badge.color} className="ms-auto" size="sm">
|
<CBadge color={badge.color} className="ms-auto" size="sm">
|
||||||
@@ -28,7 +49,7 @@ export const AppSidebarNav = ({ items }) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const navItem = (item, index, indent = false) => {
|
const navItem = (item: NavItem, index: number, indent = false) => {
|
||||||
const { component, name, badge, icon, ...rest } = item
|
const { component, name, badge, icon, ...rest } = item
|
||||||
const Component = component
|
const Component = component
|
||||||
return (
|
return (
|
||||||
@@ -48,7 +69,7 @@ export const AppSidebarNav = ({ items }) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const navGroup = (item, index) => {
|
const navGroup = (item: NavItem, index: number) => {
|
||||||
const { component, name, icon, items, to, ...rest } = item
|
const { component, name, icon, items, to, ...rest } = item
|
||||||
const Component = component
|
const Component = component
|
||||||
return (
|
return (
|
||||||
|
|||||||
5
src/styles.d.ts
vendored
5
src/styles.d.ts
vendored
@@ -2,3 +2,8 @@ declare module '*.scss' {
|
|||||||
const content: { [className: string]: string };
|
const content: { [className: string]: string };
|
||||||
export default content;
|
export default content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare module '*.css' {
|
||||||
|
const content: { [className: string]: string };
|
||||||
|
export default content;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user