From 34f455ded22541146f9645f7ba7f28122fd5d64a Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Thu, 29 Jul 2021 20:02:20 +0300 Subject: [PATCH] set dev credentials --- src/pages/login/Login.js | 53 +-- .../notifications/NotificationsContainer.js | 112 ------ src/pages/notifications/NotificationsView.js | 365 ------------------ 3 files changed, 31 insertions(+), 499 deletions(-) delete mode 100644 src/pages/notifications/NotificationsContainer.js delete mode 100644 src/pages/notifications/NotificationsView.js diff --git a/src/pages/login/Login.js b/src/pages/login/Login.js index 143c02e..532c1d1 100644 --- a/src/pages/login/Login.js +++ b/src/pages/login/Login.js @@ -7,7 +7,7 @@ import { Tabs, Tab, TextField, - Fade, + Fade } from "@material-ui/core"; import { withRouter } from "react-router-dom"; import classnames from "classnames"; @@ -33,8 +33,8 @@ function Login(props) { var [error, setError] = useState(null); var [activeTabId, setActiveTabId] = useState(0); var [nameValue, setNameValue] = useState(""); - var [loginValue, setLoginValue] = useState("admin@flatlogic.com"); - var [passwordValue, setPasswordValue] = useState("password"); + var [loginValue, setLoginValue] = useState(***REMOVED***); + var [passwordValue, setPasswordValue] = useState("***REMOVED***"); return ( @@ -78,11 +78,11 @@ function Login(props) { InputProps={{ classes: { underline: classes.textFieldUnderline, - input: classes.textField, - }, + input: classes.textField + } }} value={loginValue} - onChange={e => setLoginValue(e.target.value)} + onChange={(e) => setLoginValue(e.target.value)} margin="normal" placeholder="Email Adress" type="email" @@ -93,11 +93,11 @@ function Login(props) { InputProps={{ classes: { underline: classes.textFieldUnderline, - input: classes.textField, - }, + input: classes.textField + } }} value={passwordValue} - onChange={e => setPasswordValue(e.target.value)} + onChange={(e) => setPasswordValue(e.target.value)} margin="normal" placeholder="Password" type="password" @@ -118,7 +118,7 @@ function Login(props) { passwordValue, props.history, setIsLoading, - setError, + setError ) } variant="contained" @@ -156,11 +156,11 @@ function Login(props) { InputProps={{ classes: { underline: classes.textFieldUnderline, - input: classes.textField, - }, + input: classes.textField + } }} value={nameValue} - onChange={e => setNameValue(e.target.value)} + onChange={(e) => setNameValue(e.target.value)} margin="normal" placeholder="Full Name" type="text" @@ -171,11 +171,11 @@ function Login(props) { InputProps={{ classes: { underline: classes.textFieldUnderline, - input: classes.textField, - }, + input: classes.textField + } }} value={loginValue} - onChange={e => setLoginValue(e.target.value)} + onChange={(e) => setLoginValue(e.target.value)} margin="normal" placeholder="Email Adress" type="email" @@ -186,11 +186,11 @@ function Login(props) { InputProps={{ classes: { underline: classes.textFieldUnderline, - input: classes.textField, - }, + input: classes.textField + } }} value={passwordValue} - onChange={e => setPasswordValue(e.target.value)} + onChange={(e) => setPasswordValue(e.target.value)} margin="normal" placeholder="Password" type="password" @@ -208,7 +208,7 @@ function Login(props) { passwordValue, props.history, setIsLoading, - setError, + setError ) } disabled={ @@ -235,7 +235,7 @@ function Login(props) { size="large" className={classnames( classes.googleButton, - classes.googleButtonCreating, + classes.googleButtonCreating )} > google @@ -245,7 +245,16 @@ function Login(props) { )} - © 2014-{new Date().getFullYear()} Flatlogic, LLC. All rights reserved. + © 2014-{new Date().getFullYear()}{" "} + + Flatlogic + + , LLC. All rights reserved. diff --git a/src/pages/notifications/NotificationsContainer.js b/src/pages/notifications/NotificationsContainer.js deleted file mode 100644 index 7c666a6..0000000 --- a/src/pages/notifications/NotificationsContainer.js +++ /dev/null @@ -1,112 +0,0 @@ -import React from "react"; -import { withStyles } from "@material-ui/core"; -import { compose, withState, withHandlers } from "recompose"; -import { toast } from "react-toastify"; - -import Notification from "../../components/Notification"; -import NotificationsView from "./NotificationsView"; - -const positions = [ - toast.POSITION.TOP_LEFT, - toast.POSITION.TOP_CENTER, - toast.POSITION.TOP_RIGHT, - toast.POSITION.BOTTOM_LEFT, - toast.POSITION.BOTTOM_CENTER, - toast.POSITION.BOTTOM_RIGHT -]; - -export default compose( - withStyles((theme) => ({ - /*progress: { - visibility: "hidden" - }, - notification: { - display: "flex", - alignItems: "center", - background: "transparent", - boxShadow: "none", - overflow: "visible" - }, - notificationComponent: { - paddingRight: theme.spacing.unit * 4 - }*/ - })), - withState("notificationsPosition", "setNotificationPosition", 2), - withState("errorToastId", "setErrorToastId", null), - withHandlers({ - sendNotification: (props) => (componentProps, options) => { - return toast( - , - options - ); - } - }), - withHandlers({ - retryErrorNotification: (props) => () => { - const componentProps = { - type: "message", - message: "Message was sent successfully!", - variant: "contained", - color: "success" - }; - - toast.update(props.errorToastId, { - render: , - type: "success" - }); - props.setErrorToastId(null); - } - }), - withHandlers({ - handleNotificationCall: (props) => (notificationType) => { - let componentProps; - - if (props.errorToastId && notificationType === "error") return; - - switch (notificationType) { - case "info": - componentProps = { - type: "feedback", - message: "New user feedback received", - variant: "contained", - color: "primary" - }; - break; - case "error": - componentProps = { - type: "message", - message: "Message was not sent!", - variant: "contained", - color: "secondary", - extraButton: "Resend", - extraButtonClick: props.retryErrorNotification - }; - break; - default: - componentProps = { - type: "shipped", - message: "The item was shipped", - variant: "contained", - color: "success" - }; - } - - const toastId = props.sendNotification(componentProps, { - type: notificationType, - position: positions[props.notificationsPosition], - progressClassName: props.classes.progress, - onClose: - notificationType === "error" && (() => props.setErrorToastId(null)), - className: props.classes.notification - }); - - if (notificationType === "error") props.setErrorToastId(toastId); - }, - changeNotificationPosition: (props) => (positionId) => { - props.setNotificationPosition(positionId); - } - }) -)(NotificationsView); diff --git a/src/pages/notifications/NotificationsView.js b/src/pages/notifications/NotificationsView.js deleted file mode 100644 index df844b3..0000000 --- a/src/pages/notifications/NotificationsView.js +++ /dev/null @@ -1,365 +0,0 @@ -import React from "react"; -import { Grid, withStyles } from "@material-ui/core"; -import { Close as CloseIcon } from "@material-ui/icons"; -import classnames from "classnames"; -import { ToastContainer } from "react-toastify"; -import SyntaxHighlighter from "react-syntax-highlighter"; -import { docco } from "react-syntax-highlighter/dist/esm/styles/hljs"; -import tinycolor from "tinycolor2"; -import "react-toastify/dist/ReactToastify.css"; - -import Widget from "../../components/Widget"; -import PageTitle from "../../components/PageTitle"; -import NotificationCustomComponent from "../../components/Notification"; -import { Typography, Button } from "../../components/Wrappers"; - -const CloseButton = ({ closeToast, className }) => ( - -); - -const NotificationsPage = ({ classes, ...props }) => ( - - - - - } - closeOnClick={false} - progressClassName={classes.notificationProgress} - /> - - - - There are few position options available for notifications. You can - click any of them to change notifications position: - -
-
-
- - Click any position - -
-
-
-
-
- - - - Different types of notifications for lost of use cases. Custom - classes are also supported. - -
- - - -
-
-
- - - - Notifications are created with the help of{" "} - - react-toastify - - -
- {` - // import needed components, functions and styles - import { ToastContainer, toast } from 'react-toastify'; - import 'react-toastify/dist/ReactToastify.css'; - - const Page = () => { -
- - -
- }; - `}
- - For more API information refer to the library documentation - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-); - -const styles = (theme) => ({ - layoutContainer: { - height: 200, - display: "flex", - flexDirection: "column", - justifyContent: "space-between", - alignItems: "center", - marginTop: theme.spacing.unit * 2, - border: "1px dashed", - borderColor: theme.palette.primary.main, - position: "relative" - }, - layoutText: { - color: tinycolor(theme.palette.background.light).darken().toHexString() - }, - layoutButtonsRow: { - width: "100%", - display: "flex", - justifyContent: "space-between" - }, - layoutButton: { - backgroundColor: theme.palette.background.light, - width: 125, - height: 50, - outline: "none", - border: "none" - }, - layoutButtonActive: { - backgroundColor: tinycolor(theme.palette.background.light) - .darken() - .toHexString() - }, - buttonsContainer: { - display: "flex", - flexDirection: "column", - alignItems: "flex-start", - marginTop: theme.spacing.unit * 2 - }, - notificationCallButton: { - color: "white", - marginBottom: theme.spacing.unit, - textTransform: "none" - }, - codeContainer: { - display: "flex", - flexDirection: "column", - marginTop: theme.spacing.unit * 2 - }, - codeComponent: { - flexGrow: 1 - }, - notificationItem: { - marginTop: theme.spacing.unit * 2 - }, - notificationCloseButton: { - position: "absolute", - right: theme.spacing.unit * 2 - }, - toastsContainer: { - width: 400, - marginTop: theme.spacing.unit * 6, - right: 0 - } -}); - -export default withStyles(styles, { withTheme: true })(NotificationsPage);