feat(club-event-list): add refresh button for event list Introduces a new refresh button located in the pagination control section. This button allows users to manually trigger a reload of the club events. It uses the SyncOutlined icon and is linked to the requestEvents API. The button also displays a loading state while the refresh is in progress.

This commit is contained in:
kyuuseiryuu 2026-03-26 13:54:34 +09:00
parent 5927861af7
commit f16f97b4c8

View File

@ -3,7 +3,7 @@ import type { IEventInfo } from "../types";
import { useCallback, useEffect, useMemo, useState } from "react"; import { useCallback, useEffect, useMemo, useState } from "react";
import { EventCard } from "./EventCard"; import { EventCard } from "./EventCard";
import { useRequest } from "ahooks"; import { useRequest } from "ahooks";
import { CalendarOutlined } from "@ant-design/icons"; import { CalendarOutlined, SyncOutlined } from "@ant-design/icons";
interface Props { interface Props {
clubId: string; clubId: string;
@ -69,6 +69,14 @@ export const ClubEvenList = (props: Props) => {
<Divider> <Divider>
{paginationControlVisible ? ( {paginationControlVisible ? (
<Space> <Space>
<Button
loading={requestEvents.loading}
type="link"
onClick={requestEvents.refreshAsync}
icon={<SyncOutlined />}
>
</Button>
<Typography.Text type="secondary"></Typography.Text> <Typography.Text type="secondary"></Typography.Text>
<Switch checked={showFinishedEvents} onChange={() => setShowFinishedEvents(!showFinishedEvents)} unCheckedChildren="隐藏" checkedChildren="显示" /> <Switch checked={showFinishedEvents} onChange={() => setShowFinishedEvents(!showFinishedEvents)} unCheckedChildren="隐藏" checkedChildren="显示" />
</Space> </Space>