From a9d2b22a6cf1f7a3025b61b81d591dbb65b8f36f Mon Sep 17 00:00:00 2001 From: Reza_ashrafi Date: Mon, 7 Mar 2022 14:21:11 +0330 Subject: [PATCH] reza added contact us --- src/components/Dialog/index.js | 34 +++-- src/components/Textarea/index.js | 5 +- src/redux/actions/comment.js | 32 +++++ src/redux/actions/dialog.js | 8 ++ src/redux/actions/form.js | 8 ++ src/redux/actions/index.js | 5 +- src/redux/actions/userProduct.js | 5 + src/redux/reducers/comment.js | 36 ++++++ src/redux/reducers/dialog.js | 21 ++++ src/redux/reducers/form.js | 26 ++++ src/redux/reducers/index.js | 5 +- src/redux/reducers/userProduct.js | 3 + src/router.js | 50 ++++---- src/views/Address/index.js | 2 - src/views/Contact/index.js | 28 +---- src/views/Contact/layouts/Ticket.js | 180 +++++++++++++++++++++++++++ src/views/Contact/layouts/Upload.js | 68 ++++++++++ src/views/Contact/layouts/index.scss | 28 +++++ 18 files changed, 476 insertions(+), 68 deletions(-) create mode 100644 src/redux/actions/comment.js create mode 100644 src/redux/actions/dialog.js create mode 100644 src/redux/actions/form.js create mode 100644 src/redux/reducers/comment.js create mode 100644 src/redux/reducers/dialog.js create mode 100644 src/redux/reducers/form.js create mode 100644 src/views/Contact/layouts/Ticket.js create mode 100644 src/views/Contact/layouts/Upload.js create mode 100644 src/views/Contact/layouts/index.scss diff --git a/src/components/Dialog/index.js b/src/components/Dialog/index.js index c5b5ce3..e1e0f03 100644 --- a/src/components/Dialog/index.js +++ b/src/components/Dialog/index.js @@ -1,18 +1,26 @@ import React from "react"; import { connect } from "react-redux"; +import { dialog } from "../../redux/actions"; -export const Dialog = ({ dialog }) => { - const { text, type, setOpen, accept, bg, color } = dialog; +export const Dialog = ({ dialog, setDialog }) => { + const { text, type, accept } = dialog; return (
setOpen(false)} + onClick={() => setDialog({ ...dialog, open: !dialog.open })} > -
+
{/* {type === "confirm" && (
exit
)} */} -

{text}

+

+ {text} +

{type === "confirm" && (
@@ -32,8 +40,8 @@ export const Dialog = ({ dialog }) => { {type === "alert" && (
@@ -44,6 +52,12 @@ export const Dialog = ({ dialog }) => { ); }; -const mapStateToProps = (state) => ({}); +const mapStateToProps = (state) => ({ + dialog: state.dialog.dialog, +}); -export default connect(mapStateToProps)(Dialog); +const mapDispatchToProps = { + setDialog: dialog.set, +}; + +export default connect(mapStateToProps, mapDispatchToProps)(Dialog); diff --git a/src/components/Textarea/index.js b/src/components/Textarea/index.js index e7edee4..d31d03a 100644 --- a/src/components/Textarea/index.js +++ b/src/components/Textarea/index.js @@ -1,7 +1,7 @@ import React from "react"; import _ from "lodash"; -export default function Textarea({ placeholder }) { +export default function Textarea({ placeholder, onChange, value, name }) { return ( <>