mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
closing sidebar on click
This commit is contained in:
parent
237f978cbd
commit
2e0ad878a3
3 changed files with 9 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
|||
import React, { FC } from 'react';
|
||||
import React, { FC, MouseEventHandler } from 'react';
|
||||
import { INode } from '~/types';
|
||||
import styles from './styles.module.scss';
|
||||
import { URLS } from '~/constants/urls';
|
||||
|
@ -11,11 +11,12 @@ import { Anchor } from '~/components/common/Anchor';
|
|||
interface IProps {
|
||||
node: Partial<INode>;
|
||||
has_new?: boolean;
|
||||
onClick?: MouseEventHandler;
|
||||
}
|
||||
|
||||
const FlowRecentItem: FC<IProps> = ({ node, has_new }) => {
|
||||
const FlowRecentItem: FC<IProps> = ({ node, has_new, onClick }) => {
|
||||
return (
|
||||
<Anchor key={node.id} className={styles.item} href={URLS.NODE_URL(node.id)}>
|
||||
<Anchor key={node.id} className={styles.item} href={URLS.NODE_URL(node.id)} onClick={onClick}>
|
||||
<div
|
||||
className={classNames(styles.thumb, {
|
||||
[styles.new]: has_new,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue