diff --git a/packages/flat-components/src/components/RemoveHistoryRoomModal/RemoveHistoryRoomModal.stories.tsx b/packages/flat-components/src/components/RemoveHistoryRoomModal/RemoveHistoryRoomModal.stories.tsx new file mode 100644 index 00000000000..dc311915000 --- /dev/null +++ b/packages/flat-components/src/components/RemoveHistoryRoomModal/RemoveHistoryRoomModal.stories.tsx @@ -0,0 +1,19 @@ +import React from "react"; +import { Meta, Story } from "@storybook/react"; +import { RemoveHistoryRoomModal, RemoveHistoryRoomModalProps } from "."; + +const storyMeta: Meta = { + title: "Components/RemoveHistoryRoomModal", + component: RemoveHistoryRoomModal, +}; + +export default storyMeta; + +export const Overview: Story = args => ( +
+ +
+); +Overview.args = { + visible: true, +}; diff --git a/packages/flat-components/src/components/RemoveHistoryRoomModal/index.tsx b/packages/flat-components/src/components/RemoveHistoryRoomModal/index.tsx new file mode 100644 index 00000000000..3a4a327b13b --- /dev/null +++ b/packages/flat-components/src/components/RemoveHistoryRoomModal/index.tsx @@ -0,0 +1,36 @@ +import "./style.less"; + +import React from "react"; +import { observer } from "mobx-react-lite"; +import { Button, Modal } from "antd"; + +export interface RemoveHistoryRoomModalProps { + visible: boolean; + onCancel: () => void; + onConfirm: () => void; + loading: boolean; +} + +export const RemoveHistoryRoomModal = observer( + function RemoveHistoryRoomModal({ visible, onCancel, onConfirm, loading }) { + return ( + + 取消 + , + , + ]} + destroyOnClose + > + 确定删除当前房间记录? + + ); + }, +); diff --git a/packages/flat-components/src/components/RemoveHistoryRoomModal/style.less b/packages/flat-components/src/components/RemoveHistoryRoomModal/style.less new file mode 100644 index 00000000000..ce979b34531 --- /dev/null +++ b/packages/flat-components/src/components/RemoveHistoryRoomModal/style.less @@ -0,0 +1,13 @@ +.remove-history-room-modal-container { + > .ant-modal { + > .ant-modal-content { + > .ant-modal-header { + border-bottom: none; + } + + > .ant-modal-footer { + border-top: none; + } + } + } +} diff --git a/packages/flat-components/src/components/RemoveRoomModal/index.tsx b/packages/flat-components/src/components/RemoveRoomModal/index.tsx index b18c36b3a21..60becb2d9d6 100644 --- a/packages/flat-components/src/components/RemoveRoomModal/index.tsx +++ b/packages/flat-components/src/components/RemoveRoomModal/index.tsx @@ -1,3 +1,5 @@ +import "./style.less"; + import { Button, Checkbox, Modal } from "antd"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; @@ -76,6 +78,7 @@ export const RemoveRoomModal: React.FC = ({ return ( .ant-modal { + > .ant-modal-content { + > .ant-modal-header { + border-bottom: none; + } + + > .ant-modal-footer { + border-top: none; + } + } + } +} diff --git a/packages/flat-components/src/index.ts b/packages/flat-components/src/index.ts index 19d66bc1885..910b814fd5d 100644 --- a/packages/flat-components/src/index.ts +++ b/packages/flat-components/src/index.ts @@ -15,6 +15,7 @@ export * from "./components/LoginPage"; export * from "./components/MainPageLayout"; export * from "./components/MainPageLayoutHorizontal"; export * from "./components/PeriodicRoomPage"; +export * from "./components/RemoveHistoryRoomModal"; export * from "./components/RemoveRoomModal"; export * from "./components/RoomDetailPage"; export * from "./components/RoomStatusElement"; diff --git a/web/flat-web/src/pages/HomePage/MainRoomListPanel/MainRoomList.tsx b/web/flat-web/src/pages/HomePage/MainRoomListPanel/MainRoomList.tsx index 1122e092779..3fa72b9b821 100644 --- a/web/flat-web/src/pages/HomePage/MainRoomListPanel/MainRoomList.tsx +++ b/web/flat-web/src/pages/HomePage/MainRoomListPanel/MainRoomList.tsx @@ -4,6 +4,7 @@ import { observer } from "mobx-react-lite"; import { isSameDay } from "date-fns"; import { InviteModal, + RemoveHistoryRoomModal, RemoveRoomModal, RoomListAlreadyLoaded, RoomListDate, @@ -15,7 +16,6 @@ import { } from "flat-components"; import { ListRoomsType } from "../../../apiMiddleware/flatServer"; import { RoomStatus, RoomType } from "../../../apiMiddleware/flatServer/constants"; -// import { RemoveHistoryRoomModal } from "../../../components/Modal/RemoveHistoryRoomModal"; import { GlobalStoreContext, RoomStoreContext } from "../../../components/StoreProvider"; import { errorTips } from "../../../components/Tips/ErrorTips"; import { RoomItem } from "../../../stores/RoomStore"; @@ -191,14 +191,14 @@ export const MainRoomList = observer(function MainRoomList({ /> )} {/* TODO: add removeHistoryLoading to flat-component */} - {/* {currentRoom && ( + {currentRoom && ( - )} */} + )} );