generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* New branch * Ready for review --------- Co-authored-by: John Darragh <[email protected]>
- Loading branch information
1 parent
4c16478
commit 8346c1b
Showing
7 changed files
with
132 additions
and
7 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
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,83 @@ | ||
import React, { useState } from "react"; | ||
import PropTypes from "prop-types"; | ||
import { createUseStyles, useTheme } from "react-jss"; | ||
|
||
import Button from "../Button/Button"; | ||
import { faCopy } from "@fortawesome/free-solid-svg-icons"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
|
||
import ModalDialog from "../UI/AriaModal/ModalDialog"; | ||
|
||
const useStyles = createUseStyles(theme => ({ | ||
buttonFlexBox: { | ||
display: "flex", | ||
flexDirection: "row", | ||
justifyContent: "center", | ||
margin: 0 | ||
}, | ||
heading1: theme.typography.heading1, | ||
buttonColor: { | ||
backgroundColor: "#eaeff2" | ||
} | ||
})); | ||
|
||
export default function SnapshotProjectModal({ | ||
mounted, | ||
onClose, | ||
selectedProjectName | ||
}) { | ||
const theme = useTheme(); | ||
const classes = useStyles({ theme }); | ||
const [snapshotProjectName, setSnapshotProjectName] = useState( | ||
`${selectedProjectName}` | ||
); | ||
|
||
return ( | ||
<ModalDialog | ||
mounted={mounted} | ||
onClose={onClose} | ||
initialFocus="#duplicateName" | ||
> | ||
<div className={classes.heading1} style={{ marginBottom: "1.5rem" }}> | ||
<FontAwesomeIcon icon={faCopy} /> Convert " | ||
{`${selectedProjectName}`}" Into a Snapshot? | ||
</div> | ||
<div style={theme.typography.subHeading}> | ||
Once converted, this project draft will no longer be in an editable | ||
state. | ||
</div> | ||
<div style={{ margin: "1.5rem 2.5rem 1.5rem 0.75rem" }}> | ||
<input | ||
placeholder="Name of Duplicated Project" | ||
type="text" | ||
id="duplicateName" | ||
name="duplicateName" | ||
value={snapshotProjectName} | ||
onChange={e => setSnapshotProjectName(e.target.value)} | ||
/> | ||
</div> | ||
<div className={classes.buttonFlexBox}> | ||
<Button | ||
className={classes.buttonColor} | ||
onClick={onClose} | ||
variant="contained" | ||
> | ||
Cancel | ||
</Button> | ||
<Button | ||
className={classes.buttonColor} | ||
onClick={() => onClose("ok", snapshotProjectName)} | ||
variant="contained" | ||
> | ||
Done | ||
</Button> | ||
</div> | ||
</ModalDialog> | ||
); | ||
} | ||
|
||
SnapshotProjectModal.propTypes = { | ||
mounted: PropTypes.bool, | ||
onClose: PropTypes.func, | ||
selectedProjectName: PropTypes.string | ||
}; |
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