Skip to content

Commit

Permalink
20% done with create product page
Browse files Browse the repository at this point in the history
  • Loading branch information
kidtango committed Jun 30, 2020
1 parent 76277be commit a8cf87a
Show file tree
Hide file tree
Showing 5 changed files with 302 additions and 8 deletions.
80 changes: 80 additions & 0 deletions package-lock.json

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

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
"@types/react-query": "^1.1.2",
"@types/react-router-dom": "^5.1.3",
"@types/uuid": "^8.0.0",
"@types/yup": "^0.29.3",
"change-case": "^4.1.1",
"clsx": "^1.1.0",
"formik": "^2.1.4",
"graphql-request": "^2.0.0",
"history": "^4.10.1",
"immer": "^6.0.9",
Expand All @@ -43,7 +45,8 @@
"react-scripts": "3.4.1",
"typescript": "^3.7.5",
"uuid": "^7.0.2",
"validate.js": "^0.13.1"
"validate.js": "^0.13.1",
"yup": "^0.29.1"
},
"scripts": {
"start": "react-scripts start",
Expand Down
86 changes: 86 additions & 0 deletions src/components/QuillEditor.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import React, { ReactNode } from 'react';
import clsx from 'clsx';
import ReactQuill from 'react-quill';
import { makeStyles } from '@material-ui/core';

interface QuillEditorProps {
className: any;
[x: string]: ReactNode;
}

const QuillEditor: React.FC<QuillEditorProps> = ({ className, ...rest }) => {
const classes = useStyles();

return <ReactQuill className={clsx(classes.root, className)} />;
};

export default QuillEditor;

const useStyles = makeStyles((theme) => ({
root: {
'& .ql-toolbar': {
borderLeft: 'none',
borderTop: 'none',
borderRight: 'none',
borderBottom: `1px solid ${theme.palette.divider}`,
'& .ql-picker-label:hover': {
color: theme.palette.secondary.main
},
'& .ql-picker-label.ql-active': {
color: theme.palette.secondary.main
},
'& .ql-picker-item:hover': {
color: theme.palette.secondary.main
},
'& .ql-picker-item.ql-selected': {
color: theme.palette.secondary.main
},
'& button:hover': {
color: theme.palette.secondary.main,
'& .ql-stroke': {
stroke: theme.palette.secondary.main
}
},
'& button:focus': {
color: theme.palette.secondary.main,
'& .ql-stroke': {
stroke: theme.palette.secondary.main
}
},
'& button.ql-active': {
'& .ql-stroke': {
stroke: theme.palette.secondary.main
}
},
'& .ql-stroke': {
stroke: theme.palette.text.primary
},
'& .ql-picker': {
color: theme.palette.text.primary
},
'& .ql-picker-options': {
padding: theme.spacing(2),
backgroundColor: theme.palette.background.default,
border: 'none',
boxShadow: theme.shadows[10],
borderRadius: theme.shape.borderRadius
}
},
'& .ql-container': {
border: 'none',
'& .ql-editor': {
fontFamily: theme.typography.fontFamily,
fontSize: 16,
color: theme.palette.text.primary,
'&.ql-blank::before': {
color: theme.palette.text.secondary
}
}
}
},
stepButton: {
'& + &': {
marginLeft: theme.spacing(2)
}
}
}));
1 change: 1 addition & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import * as serviceWorker from './serviceWorker';
import 'react-quill/dist/quill.snow.css';
import SettingsContextProvider from 'context/SettingsContext';
import { restoreSettings } from 'utils/settings';

Expand Down
Loading

0 comments on commit a8cf87a

Please sign in to comment.