-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from CodeDead/release/2.0.1.0
Release/2.0.1.0
- Loading branch information
Showing
32 changed files
with
1,657 additions
and
1,133 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
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,44 @@ | ||
import React, {useState} from "react"; | ||
import DialogTitle from "@material-ui/core/DialogTitle"; | ||
import DialogContent from "@material-ui/core/DialogContent"; | ||
import DialogContentText from "@material-ui/core/DialogContentText"; | ||
import DialogActions from "@material-ui/core/DialogActions"; | ||
import Button from "@material-ui/core/Button"; | ||
import Dialog from "@material-ui/core/Dialog"; | ||
import {useSelector} from "react-redux"; | ||
|
||
const AlertDialog = ({title, content}) => { | ||
|
||
const language = useSelector(state => state.MainReducer.languages[state.MainReducer.languageIndex]); | ||
const [open, setOpen] = useState(true); | ||
|
||
/** | ||
* Close the AlertDialog instance | ||
*/ | ||
const handleClose = () => { | ||
setOpen(false); | ||
}; | ||
|
||
return ( | ||
<Dialog | ||
open={open} | ||
onClose={handleClose} | ||
aria-labelledby="alert-dialog-title" | ||
aria-describedby="alert-dialog-description" | ||
> | ||
<DialogTitle id="alert-dialog-title">{title}</DialogTitle> | ||
<DialogContent> | ||
<DialogContentText id="alert-dialog-description"> | ||
{content} | ||
</DialogContentText> | ||
</DialogContent> | ||
<DialogActions> | ||
<Button onClick={handleClose} color="primary" autoFocus> | ||
{language.ok} | ||
</Button> | ||
</DialogActions> | ||
</Dialog> | ||
); | ||
}; | ||
|
||
export default AlertDialog; |
This file was deleted.
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,26 @@ | ||
import React from "react"; | ||
|
||
const CsvExport = ({children, data, fileName}) => { | ||
|
||
let href = null; | ||
if (data) { | ||
let csvContent = ""; | ||
data.forEach(element => { | ||
csvContent += element.type + "," + element.hash + "\n"; | ||
}); | ||
|
||
const blob = new Blob([csvContent], {type: 'text/csv;charset=utf-8;'}); | ||
href = URL.createObjectURL(blob); | ||
} | ||
|
||
return ( | ||
data ? ( | ||
<a href={href} download={fileName} target={"_self"} | ||
style={{textDecoration: "none"}}> | ||
{children} | ||
</a> | ||
) : {children} | ||
); | ||
}; | ||
|
||
export default CsvExport; |
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,41 @@ | ||
import React from "react"; | ||
import {useHistory} from "react-router-dom"; | ||
import {useDispatch, useSelector} from "react-redux"; | ||
|
||
const DropZone = ({children}) => { | ||
|
||
const history = useHistory(); | ||
const enabled = useSelector(state => state.MainReducer.canDragDrop); | ||
const dispatch = useDispatch(); | ||
|
||
/** | ||
* Event that is fired when one or more files are dropped | ||
* @param event The event that contains the drop details | ||
*/ | ||
const onDrop = (event) => { | ||
event.preventDefault(); | ||
if (!enabled) return; | ||
|
||
dispatch({type: 'SET_CURRENT_FILE', payload: event.dataTransfer.files[0]}); | ||
history.push("/file"); | ||
}; | ||
|
||
/** | ||
* Event that is fired when a drag over event is detected | ||
* @param event The event that contains the drag over details | ||
*/ | ||
const onDragOver = (event) => { | ||
event.preventDefault(); | ||
}; | ||
|
||
return ( | ||
<div | ||
onDragOver={onDragOver} | ||
onDrop={onDrop}> | ||
{children} | ||
</div> | ||
); | ||
|
||
}; | ||
|
||
export default DropZone; |
Oops, something went wrong.