coreui 소스를 ts 로 전환 : 추가수정

This commit is contained in:
2025-12-31 13:18:30 +09:00
parent 7fb0cf6fba
commit fd40ce5e75
3 changed files with 51 additions and 9 deletions

View File

@@ -10,10 +10,26 @@ const AppFooter = () => {
</a>
<span className="ms-1">&copy; 2025 creativeLabs.</span>
</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">
<span className="me-1">Powered by</span>
<a href="https://coreui.io/react" target="_blank" rel="noopener noreferrer">
CoreUI React Admin &amp; Dashboard Template
CoreUI React
</a>
</div>
</CFooter>

View File

@@ -7,17 +7,38 @@ import 'simplebar-react/dist/simplebar.min.css'
import { CBadge, CNavLink, CSidebarNav } from '@coreui/react'
export const AppSidebarNav = ({ items }) => {
const navLink = (name, icon, badge, indent = false) => {
interface Badge {
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 (
<>
{icon
? icon
: indent && (
<span className="nav-icon">
<span className="nav-icon-bullet"></span>
</span>
)}
<span className="nav-icon">
<span className="nav-icon-bullet"></span>
</span>
)}
{name && name}
{badge && (
<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 = component
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 = component
return (

5
src/styles.d.ts vendored
View File

@@ -2,3 +2,8 @@ declare module '*.scss' {
const content: { [className: string]: string };
export default content;
}
declare module '*.css' {
const content: { [className: string]: string };
export default content;
}