Last active
February 3, 2020 10:21
-
-
Save u88803494/c411fd52487c2b13857a9042bcced62d to your computer and use it in GitHub Desktop.
彈出視窗的按鈕跟內建的方法
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
import React from 'react'; | |
import './editingWindow.css'; | |
import { Button, Modal } from 'react-bootstrap'; | |
const EditingWindow = ({ onHide, show, state }) => ( | |
<Modal | |
size="lg" | |
aria-labelledby="contained-modal-title-vcenter" | |
centered | |
{...{ onHide, show }} | |
> | |
<Modal.Header closeButton> | |
<Modal.Title id="contained-modal-title-vcenter"> | |
{state === "editing" ? "你正在編輯文章" : "你正在新增文章"} | |
</Modal.Title> | |
</Modal.Header> | |
<Modal.Body> | |
<h4>Centered Modal</h4> | |
<p> | |
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, | |
dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac | |
consectetur ac, vestibulum at eros. | |
</p> | |
</Modal.Body> | |
<Modal.Footer> | |
<Button variant="outline-secondary" onClick={onHide}>Close</Button> | |
<Button variant="outline-primary" onClick={() => console.log('送出')} > Save changes</Button> | |
</Modal.Footer> | |
</Modal> | |
); | |
export default EditingWindow; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment