aboutsummaryrefslogtreecommitdiff
path: root/components/navbar.tsx
diff options
context:
space:
mode:
authorlonkaars <l.leblansch@gmail.com>2021-03-27 09:52:07 +0100
committerlonkaars <l.leblansch@gmail.com>2021-03-27 09:52:07 +0100
commitfee0469e1265122eafcdae6cd92c8c9e1b250826 (patch)
treef5db0373444da61c2d9490fdb139e24bc9e80ea7 /components/navbar.tsx
parentf129069cbfcd29f3fd9ba0c8f4ca3b0167489e03 (diff)
foldable chapters :tada:
Diffstat (limited to 'components/navbar.tsx')
-rw-r--r--components/navbar.tsx9
1 files changed, 6 insertions, 3 deletions
diff --git a/components/navbar.tsx b/components/navbar.tsx
index cbbd164..9183b3b 100644
--- a/components/navbar.tsx
+++ b/components/navbar.tsx
@@ -11,14 +11,17 @@ export function NavbarItem(props: {
children?: ReactNode;
classList?: Array<string>;
style?: CSSProperties;
+ outerStyle?: CSSProperties;
+ onIconClick?: () => void;
+ onClick?: () => void;
}) {
var classes = props.classList || [];
classes.push("navbarItem");
props.active && classes.push("active");
- return <a href={props.href} className={classes.join(" ")}>
+ return <a href={props.href} className={classes.join(" ")} style={props.outerStyle}>
<div className="inner" style={props.style}>
- {props.icon}
- <span>{props.title}</span>
+ <div className="icon" onClick={props.onIconClick}>{props.icon}</div>
+ <span className="title" onClick={props.onClick}>{props.title}</span>
</div>
{props.children}
</a>