Skip to content

Commit 6a0d032

Browse files
committed
Refactor: Replace inline styles with Tailwind CSS classes in Play components
1 parent ae4164f commit 6a0d032

File tree

6 files changed

+13
-37
lines changed

6 files changed

+13
-37
lines changed

src/pages/Play/components/DiscardArea.tsx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,8 @@ function DiscardArea(props: DiscardAreaProps) {
1313
};
1414
});
1515
return (
16-
<div
17-
style={{
18-
height: "90%",
19-
borderRadius: "1rem",
20-
boxShadow: "1px 1px 2px rgba(0, 0, 0, 0.2)",
21-
}}
22-
>
23-
<div
24-
style={{
25-
paddingTop: "1rem",
26-
justifyContent: "center",
27-
display: "grid",
28-
gridTemplateColumns: "repeat(6, 50px)",
29-
listStyle: "none",
30-
}}
31-
>
16+
<div className="h-[90%] rounded-[1rem] shadow-md">
17+
<div className="pt-4 justify-center grid grid-cols-[repeat(6,50px)] list-none">
3218
{sutehaiWithID.map((hai) => (
3319
<li key={hai.id}>
3420
<img

src/pages/Play/components/DisplaySwitch.tsx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,7 @@ export default function DisplaySwitch(props: DisplaySwitchProps) {
88
return (
99
<div style={{ height: "10%" }}>
1010
{props.display === "sutehai" ? (
11-
<div
12-
style={{
13-
display: "flex",
14-
justifyContent: "center",
15-
gap: "40px",
16-
}}
17-
>
11+
<div className="flex justify-center gap-10">
1812
<Button
1913
variant="contained"
2014
onClick={() => props.setDisplay("sutehai")}
@@ -29,13 +23,7 @@ export default function DisplaySwitch(props: DisplaySwitchProps) {
2923
</Button>
3024
</div>
3125
) : (
32-
<div
33-
style={{
34-
display: "flex",
35-
justifyContent: "center",
36-
gap: "40px",
37-
}}
38-
>
26+
<div className="flex justify-center gap-10">
3927
<Button
4028
variant="outlined"
4129
onClick={() => props.setDisplay("sutehai")}

src/pages/Play/components/HandStatus.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ type HandStatusProps = {
55

66
function HandStatus(props: HandStatusProps) {
77
return (
8-
<div className="h-full flex flex-col gap-4 rounded-[1rem] shadow-md">
8+
<div className="h-full flex flex-col rounded-[1rem] shadow-md">
99
<div className="pt-4 font-medium pl-4 text-2xl text-left">向聴数</div>
10-
<div className="font-medium pl-6 text-left text-xl leading-normal">
10+
<div className="font-medium pt-4 pl-6 text-left text-xl leading-normal">
1111
{props.mentsuSyanten === 0 ? (
1212
<>メンツ手: テンパイ</>
1313
) : (

src/pages/Play/components/ValidTiles.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ export default function ValidTiles(props: ValidTilesProps) {
1111
const shortenedInfo = extractValidTile(validTileInfo);
1212
const keys = [...shortenedInfo.keys()];
1313
return (
14-
<div className="rounded-[1rem] shadow-md h-[90%] overflow-hidden">
14+
<div className="rounded-[1rem] shadow-md h-[90%]">
1515
{keys.map((key) => (
1616
<div key={key}>
1717
<p className="text-xl font-medium pt-4">{key} </p>
18-
<ul className="flex list-none">
18+
<ul className="flex justify-center list-none">
1919
{shortenedInfo.get(key)?.map((hai) => (
2020
<li key={`${hai.kind} - ${hai.value}`}>
2121
<img

src/pages/Play/components/WaitingTiles.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ function WaitingTiles(props: WaitingTilesProps) {
1616
});
1717
return (
1818
<div className="h-full rounded-[1rem] shadow-md">
19-
<div className="pt-2 pl-4 text-2xl text-left font-medium">待ち</div>
19+
<div className="pt-4 pl-4 text-2xl text-left font-medium">待ち</div>
2020
{machihai.length === 0 ? (
21-
<div className="pl-6 text-xl font-medium">なし</div>
21+
<div className="font-medium pt-4 pl-6 text-left text-xl leading-normal">
22+
なし
23+
</div>
2224
) : (
2325
<div className="list-none flex pl-5 pt-2">
2426
{machihaiWithId.map((hai) => (

src/pages/Play/components/WaitingTilesSkeleton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Skeleton } from "@mui/material";
33
export default function WaitingTilesSkeleton() {
44
return (
55
<div className="h-full rounded-[1rem] shadow-md">
6-
<div className="pt-2 pl-4 text-2xl text-left font-medium">待ち</div>
6+
<div className="pt-4 pl-4 text-2xl text-left font-medium">待ち</div>
77
<div className="pt-4 font-medium pl-6 text-left text-xl leading-normal w-[80%]">
88
<Skeleton variant="text" />
99
</div>

0 commit comments

Comments
 (0)