Commit 3185d22f authored by Rasoul Madani's avatar Rasoul Madani
Browse files

تنظیم اسم در نماد ورودی که فرد وقتی وارد می شود به نماد را نشان دهد وقتی خارج...

تنظیم اسم در نماد ورودی که فرد وقتی وارد می شود به نماد را نشان دهد وقتی خارج می شود اسم را نمایش ندهد
parent a05e49da
......@@ -5,15 +5,16 @@ import CartScreen from "./screens/CartScreen";
import SigninScreen from "./screens/SigninScreen";
import RegisterScreen from "./screens/RegisterScreen";
import ShippingAddressScreen from "./screens/ShippingAddressScreen";
import { signout } from "./actions/userActions";
import { BrowserRouter, Route, Link } from "react-router-dom";
import { useSelector,useDispatch } from "react-redux";
import { useSelector, useDispatch } from "react-redux";
function App() {
const cart = useSelector((state) => state.cart);
const { cartItems } = cart;
const userSignin = useSelector((state) => state.userSignin);
const { userInfo } = userSignin;
const dispatch = useDispatch()
const dispatch = useDispatch();
const signoutHandler = () => {
dispatch(signout());
};
......
import Axios from "axios";
import {
USER_REGISTER_REQUEST,
USER_REGISTER_SUCCESS,
......@@ -6,6 +7,7 @@ import {
USER_SIGNIN_REQUEST,
USER_SIGNIN_SUCCESS,
USER_SIGNIN_FAIL,
USER_SIGNOUT
} from "../constants/userConstants";
export const register = (name, email, password) => async (dispatch) => {
dispatch({
......
......@@ -4,3 +4,5 @@ export const USER_REGISTER_FAIL = "USER_REGISTER_FAIL";
export const USER_SIGNIN_REQUEST = "USER_SIGNIN_REQUEST";
export const USER_SIGNIN_SUCCESS = "USER_SIGNIN_SUCCESS";
export const USER_SIGNIN_FAIL = "USER_SIGNIN_FAIL";
export const USER_SIGNOUT = 'SUER_SIGNOUT'
......@@ -181,11 +181,11 @@ img.small {
}
/* Form */
.form{
.form {
max-width: 60rem;
margin: 0 auto;
}
.form > div{
.form > div {
display: flex;
flex-direction: column;
margin: 1rem;
......@@ -194,16 +194,35 @@ img.small {
margin: 1rem 0;
display: block;
}
/* Dropdown */
.dropdown {
display: inline-block;
position: relative;
}
.dropdown-content {
position: absolute;
display: none;
right: 0;
min-width: 12rem;
padding: 1rem;
z-index: 1;
background-color: #203040;
margin: 0;
margin-top: 0.4rem;
border-radius: 0.5rem;
}
.dropdown:hover .dropdown-content{
display:block;
}
/* Checkout Steps */
.checkout-steps > div{
.checkout-steps > div {
border-top: 0.3rem #c0c0c0 solid;
color: #c0c0c0;
flex:1;
padding:1rem;
font-weight:bold;
flex: 1;
padding: 1rem;
font-weight: bold;
}
.checkout-steps > div.active{
.checkout-steps > div.active {
border-top-color: #f08000;
color: #f08000;
}
\ No newline at end of file
}
......@@ -5,6 +5,7 @@ import {
USER_SIGNIN_REQUEST,
USER_SIGNIN_SUCCESS,
USER_SIGNIN_FAIL,
USER_SIGNOUT,
} from "../constants/userConstants";
export const userRegisterReducer = (state = {}, action) => {
switch (action.type) {
......@@ -27,6 +28,8 @@ export const userSigninReducer = (state = {}, action) => {
return { loading: false, userInfo: action.payload };
case USER_SIGNIN_FAIL:
return { loading: false, error: action.payload };
case USER_SIGNOUT:
return {};
default:
return state;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment