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:
parent
5927861af7
commit
f16f97b4c8
@ -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>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user