-
Notifications
You must be signed in to change notification settings - Fork 828
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(flat-components): add remove history room modal to flat-componen…
…ts (#724)
- Loading branch information
Showing
7 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
.../flat-components/src/components/RemoveHistoryRoomModal/RemoveHistoryRoomModal.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<RemoveHistoryRoomModalProps> = args => ( | ||
<div className="vh-75 mw8-ns"> | ||
<RemoveHistoryRoomModal {...args} /> | ||
</div> | ||
); | ||
Overview.args = { | ||
visible: true, | ||
}; |
36 changes: 36 additions & 0 deletions
36
packages/flat-components/src/components/RemoveHistoryRoomModal/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<RemoveHistoryRoomModalProps>( | ||
function RemoveHistoryRoomModal({ visible, onCancel, onConfirm, loading }) { | ||
return ( | ||
<Modal | ||
wrapClassName="remove-history-room-modal-container" | ||
title="删除房间记录" | ||
visible={visible} | ||
onCancel={onCancel} | ||
footer={[ | ||
<Button key="exit-cancel" onClick={onCancel}> | ||
取消 | ||
</Button>, | ||
<Button key="exit-confirm" danger loading={loading} onClick={onConfirm}> | ||
确定 | ||
</Button>, | ||
]} | ||
destroyOnClose | ||
> | ||
确定删除当前房间记录? | ||
</Modal> | ||
); | ||
}, | ||
); |
13 changes: 13 additions & 0 deletions
13
packages/flat-components/src/components/RemoveHistoryRoomModal/style.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/flat-components/src/components/RemoveRoomModal/style.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.remove-room-modal-container { | ||
> .ant-modal { | ||
> .ant-modal-content { | ||
> .ant-modal-header { | ||
border-bottom: none; | ||
} | ||
|
||
> .ant-modal-footer { | ||
border-top: none; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters