forked from smaranjitghose/doc2pen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
453 additions
and
122 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,6 +1,12 @@ | ||
FROM node:latest | ||
# Create a NODE image | ||
FROM node:alpine | ||
# Make a working directory | ||
WORKDIR /app | ||
# Move the package.json to the root folder | ||
COPY package*.json . | ||
# Get all our dependencies | ||
RUN npm install | ||
# Copy all the content to our working directory | ||
COPY . /app | ||
CMD [ "npm" , "start"] | ||
# Start our application | ||
CMD [ "npm" , "start"] |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,74 @@ | ||
import React from 'react'; | ||
import { Button, Modal, ModalBody, ModalFooter } from 'reactstrap'; | ||
import { EditContext } from "../../containers/editContext"; | ||
import styles from "./Settings.module.css"; | ||
const DownloadFileModal = (props) => { | ||
const { modal, setModal } = props; | ||
|
||
const editContext = React.useContext(EditContext); | ||
const [fileType, setFileType] = React.useState('PNG'); | ||
const [value, setValue] = React.useState(''); | ||
const [valueError, setValueError] = React.useState(null); | ||
|
||
const handleDownloadFile = (e) => { | ||
if (!value) | ||
setValueError("please provide file name") | ||
else { | ||
editContext.downloadAction(value, fileType); | ||
setModal(false) | ||
setValue(''); | ||
setValueError(null); | ||
} | ||
|
||
} | ||
const toggle = () => { | ||
setModal(!modal); | ||
setValue(''); | ||
setValueError(null); | ||
} | ||
const files = ['PNG', 'PDF']; | ||
return ( | ||
|
||
<Modal style={{ marginTop: "200px" }} isOpen={modal} toggle={toggle} > | ||
|
||
<ModalBody> | ||
<input | ||
placeholder="What would you like to call the file?" | ||
className={styles.modalInput} | ||
type="text" | ||
id="name" | ||
value={value} | ||
onChange={(e) => setValue(e.target.value)} /> | ||
<br /> | ||
{ | ||
valueError ? ( | ||
<p style={{ color: "red" }}>{valueError}</p> | ||
) : null | ||
} | ||
|
||
<label className={styles.modalLabel} > Export as : </label> | ||
<br /> | ||
{ | ||
files.map((file) => { | ||
return ( | ||
<button | ||
onClick={() => setFileType(file)} | ||
style={{ backgroundColor: fileType === file ? "#103f5f" : "#add8e6", color: fileType === file ? "white" : "black" }} | ||
className={styles.downloadLabelButton} | ||
key={Math.random()}>{file} {fileType === file ? '*' : null}</button> | ||
) | ||
}) | ||
} | ||
</ModalBody> | ||
<ModalFooter> | ||
<Button className={styles.downloadButton} onClick={handleDownloadFile}>Download</Button>{' '} | ||
<Button className={styles.closeModal} color="secondary" onClick={toggle}>X</Button> | ||
</ModalFooter> | ||
</Modal> | ||
|
||
|
||
) | ||
|
||
} | ||
|
||
export default DownloadFileModal; |
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
Oops, something went wrong.