diff --git a/web/src/components/ExploreSidebar/ExploreSidebarDrawer.tsx b/web/src/components/ExploreSidebar/ExploreSidebarDrawer.tsx index 6cc192aa56145..67cc7fce8c847 100644 --- a/web/src/components/ExploreSidebar/ExploreSidebarDrawer.tsx +++ b/web/src/components/ExploreSidebar/ExploreSidebarDrawer.tsx @@ -26,7 +26,7 @@ const ExploreSidebarDrawer = () => { -
+
diff --git a/web/src/components/HomeSidebar/HomeSidebarDrawer.tsx b/web/src/components/HomeSidebar/HomeSidebarDrawer.tsx index faf3c45447cfa..aa21d986f739b 100644 --- a/web/src/components/HomeSidebar/HomeSidebarDrawer.tsx +++ b/web/src/components/HomeSidebar/HomeSidebarDrawer.tsx @@ -26,7 +26,7 @@ const HomeSidebarDrawer = () => { -
+
diff --git a/web/src/components/MemoDetailSidebar/MemoDetailSidebar.tsx b/web/src/components/MemoDetailSidebar/MemoDetailSidebar.tsx new file mode 100644 index 0000000000000..768d37390004f --- /dev/null +++ b/web/src/components/MemoDetailSidebar/MemoDetailSidebar.tsx @@ -0,0 +1,48 @@ +import clsx from "clsx"; +import { Memo } from "@/types/proto/api/v1/memo_service"; +import { useTranslate } from "@/utils/i18n"; +import Icon from "../Icon"; + +interface Props { + memo: Memo; + className?: string; +} + +const MemoDetailSidebar = ({ memo, className }: Props) => { + const t = useTranslate(); + + if (!memo.property) { + return; + } + + return ( + + ); +}; + +export default MemoDetailSidebar; diff --git a/web/src/components/MemoDetailSidebar/MemoDetailSidebarDrawer.tsx b/web/src/components/MemoDetailSidebar/MemoDetailSidebarDrawer.tsx new file mode 100644 index 0000000000000..b3388e2a0085e --- /dev/null +++ b/web/src/components/MemoDetailSidebar/MemoDetailSidebarDrawer.tsx @@ -0,0 +1,41 @@ +import { Drawer, IconButton } from "@mui/joy"; +import { useEffect, useState } from "react"; +import { useLocation } from "react-router-dom"; +import { Memo } from "@/types/proto/api/v1/memo_service"; +import Icon from "../Icon"; +import MemoDetailSidebar from "./MemoDetailSidebar"; + +interface Props { + memo: Memo; +} + +const MemoDetailSidebarDrawer = ({ memo }: Props) => { + const location = useLocation(); + const [open, setOpen] = useState(false); + + useEffect(() => { + setOpen(false); + }, [location.pathname]); + + const toggleDrawer = (inOpen: boolean) => (event: React.KeyboardEvent | React.MouseEvent) => { + if (event.type === "keydown" && ((event as React.KeyboardEvent).key === "Tab" || (event as React.KeyboardEvent).key === "Shift")) { + return; + } + setOpen(inOpen); + }; + + return ( + <> + + + + +
+ +
+
+ + ); +}; + +export default MemoDetailSidebarDrawer; diff --git a/web/src/components/MemoDetailSidebar/index.ts b/web/src/components/MemoDetailSidebar/index.ts new file mode 100644 index 0000000000000..ccf9393edc2e3 --- /dev/null +++ b/web/src/components/MemoDetailSidebar/index.ts @@ -0,0 +1,4 @@ +import MemoDetailSidebar from "./MemoDetailSidebar"; +import MemoDetailSidebarDrawer from "./MemoDetailSidebarDrawer"; + +export { MemoDetailSidebar, MemoDetailSidebarDrawer }; diff --git a/web/src/components/TimelineSidebar/TimelineSidebarDrawer.tsx b/web/src/components/TimelineSidebar/TimelineSidebarDrawer.tsx index 175c102ac67df..3231850076ed1 100644 --- a/web/src/components/TimelineSidebar/TimelineSidebarDrawer.tsx +++ b/web/src/components/TimelineSidebar/TimelineSidebarDrawer.tsx @@ -26,7 +26,7 @@ const TimelineSidebarDrawer = () => { -
+
diff --git a/web/src/components/UserStatisticsView.tsx b/web/src/components/UserStatisticsView.tsx index 2c8be3bc31a90..6435f9a4a2545 100644 --- a/web/src/components/UserStatisticsView.tsx +++ b/web/src/components/UserStatisticsView.tsx @@ -62,10 +62,10 @@ const UserStatisticsView = () => { }; return ( -
+

{t("common.statistics")}

-
+
{ const t = useTranslate(); + const { md } = useResponsiveWidth(); const params = useParams(); const navigateTo = useNavigateTo(); const currentUser = useCurrentUser(); @@ -77,66 +81,77 @@ const MemoDetail = () => { return (
- -
- {parentMemo && ( -
- - - {parentMemo.content} - -
- )} - -
-

- {t("memo.comment.self")} -

-
- {comments.length === 0 ? ( - currentUser && ( -
- -
- ) - ) : ( - <> -
-
- - {t("memo.comment.self")} - ({comments.length}) + {!md && ( + + + + )} +
+
+ {parentMemo && ( +
+ + + {parentMemo.content} + +
+ )} + +
+

+ {t("memo.comment.self")} +

+
+ {comments.length === 0 ? ( + currentUser && ( +
+ +
+ ) + ) : ( + <> +
+
+ + {t("memo.comment.self")} + ({comments.length}) +
+
- -
- {comments.map((comment) => ( - - ))} - - )} + {comments.map((comment) => ( + + ))} + + )} +
+ {md && ( +
+ +
+ )}
);