From 2e0ad878a38827f30a1d238790760027cff0e168 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Mon, 17 Jan 2022 12:59:58 +0700 Subject: [PATCH] closing sidebar on click --- src/components/flow/FlowRecentItem/index.tsx | 7 ++++--- src/components/sidebar/TagSidebarList/index.tsx | 7 ++++--- src/containers/sidebars/TagSidebar/index.tsx | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/flow/FlowRecentItem/index.tsx b/src/components/flow/FlowRecentItem/index.tsx index dd78b588..65f7b008 100644 --- a/src/components/flow/FlowRecentItem/index.tsx +++ b/src/components/flow/FlowRecentItem/index.tsx @@ -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; has_new?: boolean; + onClick?: MouseEventHandler; } -const FlowRecentItem: FC = ({ node, has_new }) => { +const FlowRecentItem: FC = ({ node, has_new, onClick }) => { return ( - +
= ({ nodes }) => ( +const TagSidebarList: FC = ({ nodes, onClick }) => (
{nodes.map(node => ( - + ))}
); diff --git a/src/containers/sidebars/TagSidebar/index.tsx b/src/containers/sidebars/TagSidebar/index.tsx index 5eb5ac3e..0340341c 100644 --- a/src/containers/sidebars/TagSidebar/index.tsx +++ b/src/containers/sidebars/TagSidebar/index.tsx @@ -53,7 +53,7 @@ const TagSidebar: VFC = ({ tag, onRequestClose }) => {
) : ( - + )}