Skip to content

Instantly share code, notes, and snippets.

@TM818

TM818/navigation example Secret

Last active Jan 21, 2021
Embed
What would you like to do?
function PM_Navigation() {
let location = useLocation();
return (
<div style={styles.fill}>
<ul style={styles.nav}>
<li style={styles.navItem}>
<Link to="/notifications">Notifications</Link>
</li>
<li style={styles.navItem}>
<Link to="/power">Power</Link>
</li>
</ul>
<Switch>
<Route path="/notifications">
<Notifications />
</Route>
<Route path="/power">
<PowerButton />
</Route>
</Switch>
</div>
);
}
function PowerButton(props) {
let w = remote.getCurrentWindow();
w.close();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment