このリポジトリは2023-09-09にアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュ、イシューの作成、プルリクエストはできません。
kikikan/backend/resources/js/component/modal_edit_memo.jsx

43 行
1.3 KiB
React
Raw 通常表示 履歴

2021-12-16 04:58:59 +09:00
import React, {useState} from 'react';
2021-12-15 17:59:00 +09:00
import {
Box,
Dialog,
DialogTitle,
2021-12-16 04:58:59 +09:00
Slide
2021-12-15 17:59:00 +09:00
} from '@mui/material';
const Transition = React.forwardRef(function Transition(props, ref) {
return <Slide direction="up" ref={ref} {...props} />;
});
2021-12-16 04:58:59 +09:00
export default function ModalEditMemo({ show, content, handleClose, handleUpdateMemo}){
2021-12-15 17:59:00 +09:00
2021-12-16 10:49:09 +09:00
const [memo, setMemo] = useState(content ? content : '');
2021-12-15 17:59:00 +09:00
2021-12-16 04:58:59 +09:00
const handleChange = (memo) => {
setMemo(memo);
handleUpdateMemo(memo);
2021-12-15 17:59:00 +09:00
}
return (
<Dialog
open={show}
TransitionComponent={Transition}
keepMounted
aria-describedby="alert-dialog-slide-description"
2021-12-16 04:58:59 +09:00
onClose={handleClose}
2021-12-15 17:59:00 +09:00
>
<DialogTitle sx={{padding:'20px 10px',textAlign:'center', borderBottom:'1px solid rgb(239 236 236)'}}>
<span className="ft-18 text-center font-weight-bold">メモ</span>
</DialogTitle>
<Box sx={{ p:'15px', pb:'15px'}}>
<Box id="alert-dialog-slide-description">
2021-12-16 04:58:59 +09:00
<textarea value={ memo } onChange={e=>handleChange(e.target.value)} style={{ height: '300px', borderRadius:5, background:'#F0F0F0', padding:'12px' }} />
2021-12-15 17:59:00 +09:00
</Box>
</Box>
</Dialog>
)
}