Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
fix: home
Browse files Browse the repository at this point in the history
  • Loading branch information
Sea10wood committed Aug 11, 2024
1 parent 880c5b6 commit 75e775c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/components/responsive/homePC/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ li {
}

.go-game-pc {
margin-left: 15%;
z-index: 10;
}

Expand All @@ -129,10 +128,11 @@ li {
position: relative;
justify-content: center;
align-items: center;
width: 70%;
aspect-ratio: 520 / 532;
width: 68%;
aspect-ratio: 520 / 560;
background-color: rgba(255, 255, 255, 0.8);
z-index: 1;
margin-top: 80px;
}

.qr-wrapper svg {
Expand Down
12 changes: 10 additions & 2 deletions src/components/responsive/homePC/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useState } from "react";
import { useNavigate } from "react-router-dom";
import { useRoomIdStore, useSocketRefStore } from "../../../store";
import { copyStringToClipboard } from "../../../utils/copyClipBoard";
Expand All @@ -12,6 +13,13 @@ function HomePC() {
const setRef = useSocketRefStore((state) => state.setRef);
const roomId = useRoomIdStore((state) => state.uuid);
const url = `${window.location.href}?room_id=${roomId}`;
const [buttonText, setButtonText] = useState("共有リンクをコピー");

const handleCopyClick = () => {
copyStringToClipboard(url);
setButtonText("コピーしました");
setTimeout(() => setButtonText("共有リンクをコピー"), 2000);
};

const handleClick = () => {
requestPermission();
Expand Down Expand Up @@ -86,11 +94,11 @@ function HomePC() {
</div>
<div className={styles["link-copy"]}>
<TextButton
text="共有リンクをコピー"
text={buttonText}
color="black"
size="md"
type="button"
onClick={() => copyStringToClipboard(url)}
onClick={handleCopyClick}
underline={true}
/>
</div>
Expand Down

0 comments on commit 75e775c

Please sign in to comment.