Skip to content

Commit

Permalink
included emoji mart
Browse files Browse the repository at this point in the history
  • Loading branch information
GpGardner committed Jun 28, 2020
1 parent 5c37d94 commit d6414d4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"chroma-js": "^2.1.0",
"emoji-mart": "^3.0.0",
"rc-slider": "^9.3.0",
"react": "^16.13.1",
"react-color": "^2.17.2",
Expand Down
19 changes: 11 additions & 8 deletions src/Components/NewPaletteForm/PaletteDataModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import DialogActions from "@material-ui/core/DialogActions";
import DialogContent from "@material-ui/core/DialogContent";
import DialogContentText from "@material-ui/core/DialogContentText";
import DialogTitle from "@material-ui/core/DialogTitle";
import {Picker} from "emoji-mart";
import 'emoji-mart/css/emoji-mart.css';

class PaletteDataModal extends Component {
constructor(props) {
Expand All @@ -23,11 +25,11 @@ class PaletteDataModal extends Component {
});
};

handleClose = () => {
this.setState({
open: false,
});
};
// handleClose = () => {
// this.setState({
// open: false,
// });
// };

handleTextChange = (evt) => {
this.setState({
Expand All @@ -45,11 +47,11 @@ class PaletteDataModal extends Component {

render() {
const { open, newPaletteName } = this.state;
const { handleSavePalette } = this.props;
const { handleSavePalette, hideForm } = this.props;
return (
<Dialog
open={open}
onClose={this.handleClose}
onClose={hideForm}
aria-labelledby="form-dialog-title"
>
<DialogTitle id="form-dialog-title">Choose a Palette Name</DialogTitle>
Expand All @@ -58,6 +60,7 @@ class PaletteDataModal extends Component {
<DialogContentText>
Please enter a new name for your newly created palette. It must be unique!
</DialogContentText>
<Picker />
<TextValidator
label="Palette Name"
name="newPaletteName"
Expand All @@ -73,7 +76,7 @@ class PaletteDataModal extends Component {
/>
</DialogContent>
<DialogActions>
<Button onClick={this.handleClose} color="primary">
<Button onClick={hideForm} color="primary">
Cancel
</Button>
<Button variant="contained" color="primary" type="submit">
Expand Down
7 changes: 7 additions & 0 deletions src/Components/NewPaletteForm/PaletteFormNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ class PaletteFormNav extends Component {
});
};

hideForm = () => {
this.setState({
formShowing: false,
})
}

render() {
const {
classes,
Expand Down Expand Up @@ -119,6 +125,7 @@ class PaletteFormNav extends Component {
{this.state.formShowing && (
<PaletteDataModal
handleSavePalette={handleSavePalette}
hideForm={this.hideForm}
palettes={palettes}
/>
)}
Expand Down

0 comments on commit d6414d4

Please sign in to comment.