|
|
@ -1,8 +1,9 @@ |
|
|
|
import { Icon, IconName } from "@blueprintjs/core" |
|
|
|
import route, {useRoute} from "@render/route" |
|
|
|
import React from "react" |
|
|
|
import route, { useRoute } from "@render/route" |
|
|
|
import React, { Fragment } from "react" |
|
|
|
import { NavLink, useLocation } from "react-router-dom" |
|
|
|
import style from "./index.module.scss" |
|
|
|
import { TitleBar, Toolbar, Text } from "react-desktop/macOs" |
|
|
|
|
|
|
|
// interface IProps {
|
|
|
|
// render(): ReactElement
|
|
|
@ -16,50 +17,49 @@ export default function Layout(props: any) { |
|
|
|
} |
|
|
|
|
|
|
|
interface TList { |
|
|
|
icon: IconName; |
|
|
|
path: string; |
|
|
|
title: string; |
|
|
|
text: string; |
|
|
|
icon: IconName |
|
|
|
path: string |
|
|
|
title: string |
|
|
|
text: string |
|
|
|
} |
|
|
|
const list: TList[]= [ |
|
|
|
const list: TList[] = [ |
|
|
|
{ |
|
|
|
path: "/home", |
|
|
|
icon: "time", |
|
|
|
title: "添加闹钟", |
|
|
|
text: "闹钟" |
|
|
|
text: "闹钟", |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: "/about", |
|
|
|
icon: "mugshot", |
|
|
|
title: "添加闹钟", |
|
|
|
text: "关于" |
|
|
|
text: "关于", |
|
|
|
}, |
|
|
|
{ |
|
|
|
path: "/float", |
|
|
|
icon: "mugshot", |
|
|
|
title: "浮动框测试", |
|
|
|
text: "浮动" |
|
|
|
text: "浮动", |
|
|
|
}, |
|
|
|
] |
|
|
|
|
|
|
|
return ( |
|
|
|
isLayout ? ( |
|
|
|
return isLayout ? ( |
|
|
|
<div className={style.Layout}> |
|
|
|
<div className={style.left}> |
|
|
|
<div className={style.leftList}> |
|
|
|
{list.map((v,i)=>( |
|
|
|
<NavLink key={i} replace to={v.path} style={{display: 'block'}}> |
|
|
|
<div className={style.leftItem} title={v.title}> |
|
|
|
<Icon icon={v.icon} size={20}/> |
|
|
|
<div>{v.text}</div> |
|
|
|
{v.path==curRoute.path&&(<div className={style.activeLine}></div>)} |
|
|
|
</div> |
|
|
|
</NavLink> |
|
|
|
{list.map((v, i) => ( |
|
|
|
<NavLink key={i} replace to={v.path} style={{ display: "block" }}> |
|
|
|
<div className={style.leftItem} title={v.title}> |
|
|
|
<Icon icon={v.icon} size={20} /> |
|
|
|
<div>{v.text}</div> |
|
|
|
{v.path == curRoute.path && <div className={style.activeLine}></div>} |
|
|
|
</div> |
|
|
|
</NavLink> |
|
|
|
))} |
|
|
|
</div> |
|
|
|
<div className={style.leftListBottom}> |
|
|
|
<div className={style.leftItem} title={"设置"}> |
|
|
|
<Icon icon="settings" size={20}/> |
|
|
|
<Icon icon="settings" size={20} /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -67,6 +67,7 @@ export default function Layout(props: any) { |
|
|
|
<props.render></props.render> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) : (<props.render></props.render>) |
|
|
|
) : ( |
|
|
|
<props.render></props.render> |
|
|
|
) |
|
|
|
} |
|
|
|