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 { EventCard } from "./EventCard";
|
||||
import { useRequest } from "ahooks";
|
||||
import { CalendarOutlined } from "@ant-design/icons";
|
||||
import { CalendarOutlined, SyncOutlined } from "@ant-design/icons";
|
||||
|
||||
interface Props {
|
||||
clubId: string;
|
||||
@ -69,6 +69,14 @@ export const ClubEvenList = (props: Props) => {
|
||||
<Divider>
|
||||
{paginationControlVisible ? (
|
||||
<Space>
|
||||
<Button
|
||||
loading={requestEvents.loading}
|
||||
type="link"
|
||||
onClick={requestEvents.refreshAsync}
|
||||
icon={<SyncOutlined />}
|
||||
>
|
||||
刷新
|
||||
</Button>
|
||||
<Typography.Text type="secondary">显示已结束的活动</Typography.Text>
|
||||
<Switch checked={showFinishedEvents} onChange={() => setShowFinishedEvents(!showFinishedEvents)} unCheckedChildren="隐藏" checkedChildren="显示" />
|
||||
</Space>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user