Skip to content

Commit

Permalink
Merge pull request #107 from sayyyho/fix/#98
Browse files Browse the repository at this point in the history
[Fix] #98 - 누구 복사 토스트 변경
  • Loading branch information
sayyyho authored Nov 15, 2024
2 parents 65d72bc + 8aba258 commit ecd8aee
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/pages/nugu/Nugu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ import { Chip } from "@components/chip/Chip";

import { useParams, useNavigate } from "react-router-dom";
import { useNuguInfo } from "./_hooks/useNuguInfo";
import { useToast } from "@hooks/useToast";
import { ToastContainer } from "@components/toast/Toast";

export const Nugu = () => {
const { uuid } = useParams();
const { data, isAdmin } = useNuguInfo(uuid);
const { toast, showToast } = useToast();
const navigate = useNavigate();
const moveOnPatch = () => {
navigate(`/nugu/patch/${uuid}`);
Expand All @@ -18,16 +21,21 @@ export const Nugu = () => {
navigator.clipboard
.writeText(currentUrl)
.then(() => {
alert("공유 링크가 복사되었어요!");
showToast("공유링크 복사완료!", "success");
})
.catch((err) => console.log(err));
.catch((err) => {
console.log(err);
});
};
return (
<Layout
$backgroundColor={"blue200"}
$margin="3rem 0 0 0"
$justifyContent="start"
>
{toast.visible && (
<ToastContainer type={toast.type}>{toast.message}</ToastContainer>
)}
<NavigateBar />
<S.Wrapper>
<S.TitleWrapper>
Expand Down

0 comments on commit ecd8aee

Please sign in to comment.