Skip to content

Commit

Permalink
style: mapを各デバイスで見やすくできるように
Browse files Browse the repository at this point in the history
  • Loading branch information
LITl-l committed Oct 25, 2023
1 parent 138e9bc commit 8cc408d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/components/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useCheckIsMobile } from "@/features/checkIsMobile";
import { VenueMap } from "./VenueImageMap";

export const Map = () => {
const [isMobile, device] = useCheckIsMobile();
const [isMobile, _] = useCheckIsMobile();
return (
<>
<h1 style={{ marginTop: "1rem" }}>{"会場図案内"}</h1>
Expand All @@ -15,7 +15,6 @@ export const Map = () => {
各露店の詳細に飛びます
</p>
<br />
<p>{device}</p>
<div
style={{
display: "flex",
Expand Down
4 changes: 2 additions & 2 deletions src/components/VenueImageMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export const VenueMap = () => {
style={{
translate: isMobile
? device === "iPad"
? "50vw 5vh"
: "25vh 15vh"
? "40vw 15vh"
: "58vh 30vh"
: "8vw 30vh",
scale: isMobile ? "0.9" : "1",
}}
Expand Down
8 changes: 4 additions & 4 deletions src/features/checkIsMobile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ export function useCheckIsMobile(): [boolean | null, string] {
// isMobile ステートを更新
setIsMobile(mobile);

if (device.includes("Android")) {
if (userAgent.includes("Android")) {
setDevice("Android");
} else if (device.includes("iPhone")) {
} else if (userAgent.includes("iPhone")) {
setDevice("iPhone");
} else if (device.includes("iPad")) {
} else if (userAgent.includes("iPad")) {
setDevice("iPad");
} else {
setDevice("PC");
}
}, [device]);
}, []);

return [isMobile, device];
}

0 comments on commit 8cc408d

Please sign in to comment.