From cfab31dec28b05cb147f42de83985bbc831be138 Mon Sep 17 00:00:00 2001 From: talksik Date: Wed, 19 Jan 2022 04:04:47 -0800 Subject: [PATCH] more improvements --- components/LinkCard.tsx | 5 ++++- components/LinkIcon.tsx | 5 +++-- components/Modals/CreateOrUpdateLink.tsx | 10 ++++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/components/LinkCard.tsx b/components/LinkCard.tsx index c0d2c53..5a9da01 100644 --- a/components/LinkCard.tsx +++ b/components/LinkCard.tsx @@ -128,7 +128,10 @@ export default function LinkCard(props: ILinkCardProps) { onClick={() => window.open(props.link.link, "_blank")} className="flex flex-row bg-gray-300 bg-opacity-25 py-5 px-3 items-center justify-start hover:cursor-pointer h-full" > - + diff --git a/components/LinkIcon.tsx b/components/LinkIcon.tsx index 486726e..8f350f2 100644 --- a/components/LinkIcon.tsx +++ b/components/LinkIcon.tsx @@ -5,6 +5,7 @@ import { FaFileImage, FaFilePdf, FaGithubSquare, + FaGlobe, FaGoogleDrive, } from "react-icons/fa"; import Link, { LinkType } from "../models/link"; @@ -33,11 +34,11 @@ export default function LinkIcon(props: { switch (linkType) { case LinkType.default: - return ; + return ; case LinkType.atlassian: return ; case LinkType.codePile: - return ; + return ; case LinkType.github: return ( diff --git a/components/Modals/CreateOrUpdateLink.tsx b/components/Modals/CreateOrUpdateLink.tsx index a03ff97..2e444c6 100644 --- a/components/Modals/CreateOrUpdateLink.tsx +++ b/components/Modals/CreateOrUpdateLink.tsx @@ -2,7 +2,7 @@ import { Divider, Select, Switch, Tooltip } from "antd"; const { Option } = Select; import Modal from "antd/lib/modal/Modal"; -import { useState } from "react"; +import { useEffect, useState } from "react"; import toast from "react-hot-toast"; import { useAuth } from "../../contexts/authContext"; import { @@ -18,9 +18,15 @@ const sendService = new SendService(); export default function CreateOrUpdateLink() { const { currUser } = useAuth(); - const { handleModalType, showModalType } = useKeyboardContext(); + const { pastedLink, handleModalType, showModalType } = useKeyboardContext(); const { teamUsers, team } = useTeamDashboardContext(); + useEffect(() => { + if (pastedLink) { + setLink(pastedLink ?? ""); + } + }, [pastedLink]); + function closeModal() { handleModalType(ShowModalType.na); }