ssq页面
Change-Id: I11f58d72d9e33eae9ec84f46473fa6144b480501
diff --git a/front/src/GamePage.js b/front/src/GamePage.js
index 2528acd..23383b6 100644
--- a/front/src/GamePage.js
+++ b/front/src/GamePage.js
@@ -21,13 +21,7 @@
{ label: "发布", icon: <AccountCircleIcon />, path: "/publish" }, // Added Publish option
];
-const gameTypesList = [
- ["PC"],
- ["主机"],
- ["移动"],
- ["掌机"],
- ["视频"]
-];
+const gameTypes = ["PC", "主机", "移动", "掌机", "视频"];
const areaTabs = [
{ label: "PC", icon: <MovieIcon fontSize="small" /> },
@@ -37,20 +31,15 @@
{ label: "视频", icon: <PersonIcon fontSize="small" /> },
];
+const exampleTorrents = [
+ { type: "RPG", title: "实例1", id: 1 },
+ { type: "Shooter", title: "实例2", id: 2 },
+ { type: "Adventure", title: "实例3", id: 3 },
+];
+
export default function GamePage() {
const navigate = useNavigate();
const [activeTab, setActiveTab] = useState(0);
- const [gameList, setGameList] = useState([]);
-
- const gameTypes = gameTypesList[activeTab] || [];
-
- React.useEffect(() => {
- const area = areaTabs[activeTab].label;
- fetch(`http://192.168.5.9:8080/api/get-seed-list-by-tag?tag=${encodeURIComponent(area)}`)
- .then(res => res.json())
- .then(data => setGameList(data))
- .catch(() => setGameList([]));
- }, [activeTab]);
return (
<div className="container">
@@ -164,39 +153,27 @@
</tr>
</thead>
<tbody>
- {gameList.length > 0 ? (
- gameList.map((item, idx) => (
- <tr key={item.id || idx}>
- <td>
- <a href={`/torrent/${item.seedid}`} style={{ color: "#1a237e", textDecoration: "none" }}>
- {item.seedtag}
- </a>
- </td>
- <td>
- <a href={`/torrent/${item.seedid}`} style={{ color: "#1a237e", textDecoration: "none" }}>
- {item.title}
- </a>
- </td>
- <td>{item.user.username}</td>
- </tr>
- ))
- ) : (
- gameTypes.map((type, idx) => (
- <tr key={type}>
- <td>
- <a href={`/torrent/${type}`} style={{ color: "#1a237e", textDecoration: "none" }}>
- {type}
- </a>
- </td>
- <td>
- <a href={`/torrent/${type}`} style={{ color: "#1a237e", textDecoration: "none" }}>
- 种子{idx + 1}
- </a>
- </td>
- <td></td>
- </tr>
- ))
- )}
+ {gameTypes.map((type, idx) => (
+ <tr key={type}>
+ <td>
+ <a
+ href={`/torrent/${type}`}
+ style={{ color: "#1a237e", textDecoration: "none" }}
+ >
+ {type}
+ </a>
+ </td>
+ <td>
+ <a
+ href={`/torrent/${type}`}
+ style={{ color: "#1a237e", textDecoration: "none" }}
+ >
+ 种子{idx + 1}
+ </a>
+ </td>
+ <td></td>
+ </tr>
+ ))}
</tbody>
</table>
</div>