From 990bd6981e57ad3d0942e8164b4e3ea661d45f25 Mon Sep 17 00:00:00 2001 From: VividTruthKeeper Date: Thu, 22 Sep 2022 00:30:41 +0500 Subject: [PATCH] aside links --- src/assets/styles/_aside.scss | 5 +++++ src/components/Aside.tsx | 20 +++++++++++++++++++- src/pages/Post.tsx | 15 ++++++++------- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/assets/styles/_aside.scss b/src/assets/styles/_aside.scss index 6495fae..e53c9ec 100644 --- a/src/assets/styles/_aside.scss +++ b/src/assets/styles/_aside.scss @@ -67,6 +67,11 @@ cursor: default !important; background: transparent !important; font-size: 1.4rem; + + svg { + width: 3rem; + height: 3rem; + } } } } diff --git a/src/components/Aside.tsx b/src/components/Aside.tsx index 3c7b1eb..9a9442f 100644 --- a/src/components/Aside.tsx +++ b/src/components/Aside.tsx @@ -12,6 +12,8 @@ import { MdOutlineManageAccounts } from "react-icons/md"; import { FaAlignLeft } from "react-icons/fa"; import { FaSignOutAlt } from "react-icons/fa"; import { FaSourcetree } from "react-icons/fa"; +import { FaLink } from "react-icons/fa"; +import { FaRegPlusSquare } from "react-icons/fa"; // Types import { userContextType } from "../types/user"; @@ -44,18 +46,34 @@ const Aside = ({ aside, setAside }: Props) => { Posts +
  • + + + + +

    Source

    +
  • localStorage.setItem("lastLocation", "/source")} > - + Source
  • +
  • + + + + + + Create source + +
  • diff --git a/src/pages/Post.tsx b/src/pages/Post.tsx index ba624ce..c2c9c2e 100644 --- a/src/pages/Post.tsx +++ b/src/pages/Post.tsx @@ -18,18 +18,19 @@ import { capitalizeFirstLetter } from "../helpers/stringMethods"; import { ContextType } from "../types/context"; const Post = () => { - const date = new Date("0.0.0000"); const [postData, setPostData] = useState(); const { posts } = useContext(PostContext).postValue; const { id } = useParams(); useEffect(() => { - if (posts[0].id !== -1) { - posts.map((post: PostType) => { - if (post.id.toString() === id) { - setPostData(post); - } - }); + if (posts) { + if (posts[0].id !== -1) { + posts.map((post: PostType) => { + if (post.id.toString() === id) { + setPostData(post); + } + }); + } } }, [posts]); return (