style: run prettier

This commit is contained in:
Esteban Abaroa
2023-12-16 16:49:26 +00:00
parent 0edc2613c8
commit 9dd2e3ce73
17 changed files with 437 additions and 578 deletions
+23 -25
View File
@@ -1,22 +1,18 @@
import React, {useState, useEffect} from "react";
import React, { useState, useEffect } from 'react';
import { StyledModal } from '../styled/modals/ReplyModal.styled';
import useGeneralStore from "../../hooks/stores/useGeneralStore";
import Modal from "react-modal";
import Draggable from "react-draggable";
import getDate from "../../utils/getDate";
import useGeneralStore from '../../hooks/stores/useGeneralStore';
import Modal from 'react-modal';
import Draggable from 'react-draggable';
import getDate from '../../utils/getDate';
const OriginalCommentModal = ({ isOpen, closeModal, comment }) => {
const {
selectedStyle,
} = useGeneralStore(state => state);
const { selectedStyle } = useGeneralStore((state) => state);
const [isMobile, setIsMobile] = useState(window.innerWidth <= 480);
const nodeRef = React.useRef(null);
const originalCommentContent = comment.original?.content;
const timestamp = getDate(comment.timestamp);
useEffect(() => {
const handleResize = () => setIsMobile(window.innerWidth <= 480);
window.addEventListener('resize', handleResize);
@@ -26,31 +22,33 @@ const OriginalCommentModal = ({ isOpen, closeModal, comment }) => {
};
}, [setIsMobile]);
return (
<StyledModal
isOpen={isOpen}
onRequestClose={closeModal}
contentLabel="Original Comment"
contentLabel='Original Comment'
shouldCloseOnEsc={false}
shouldCloseOnOverlayClick={isMobile}
selectedStyle={selectedStyle}
style={isMobile ? ({ overlay: { backgroundColor: "rgba(0,0,0,.25)" }}) : ({ overlay: { backgroundColor: "rgba(0,0,0,0)" }})}>
<Draggable handle=".modal-header" nodeRef={nodeRef} disabled={isMobile}>
<div className="modal-content" ref={nodeRef}>
<div className="modal-header">
style={isMobile ? { overlay: { backgroundColor: 'rgba(0,0,0,.25)' } } : { overlay: { backgroundColor: 'rgba(0,0,0,0)' } }}
>
<Draggable handle='.modal-header' nodeRef={nodeRef} disabled={isMobile}>
<div className='modal-content' ref={nodeRef}>
<div className='modal-header'>
Original at {timestamp}
<button className="icon" onClick={() => closeModal()} title="close" />
<button className='icon' onClick={() => closeModal()} title='close' />
</div>
<div id="form">
<div className="textarea-wrapper">
<textarea className="textarea"
rows="4"
<div id='form'>
<div className='textarea-wrapper'>
<textarea
className='textarea'
rows='4'
style={{ paddingTop: '0' }}
placeholder="Comment"
placeholder='Comment'
defaultValue={originalCommentContent}
wrap="soft"
readOnly={true} />
wrap='soft'
readOnly={true}
/>
</div>
</div>
</div>
@@ -61,4 +59,4 @@ const OriginalCommentModal = ({ isOpen, closeModal, comment }) => {
Modal.setAppElement('#root');
export default OriginalCommentModal;
export default OriginalCommentModal;