Prechádzať zdrojové kódy

some comments delete

pocu46 3 rokov pred
rodič
commit
b79aae1947

+ 0 - 1
hipstagram/src/Actions/action_login.js

@@ -41,7 +41,6 @@ export const actionLogin = (login, password) => async (dispatch) => {
             })
         )
     )
-    // console.log(result)
     if(result?.data?.login) {
         console.log(result.data.login)
         dispatch(actionAuthLogin(result.data.login))

+ 0 - 2
hipstagram/src/Actions/action_registration.js

@@ -1,4 +1,3 @@
-import { actionAuthLogin } from '../Redux/auth_reducer';
 import { actionLoginNetworkError, actionLoginNetworkErrorReset } from '../Redux/network_reducer';
 import { actionPromise } from '../Redux/promise_reducer';
 import {actionLogin, gql} from './action_login';
@@ -17,7 +16,6 @@ export const actionRegistrations = (login, password) => async (dispatch) => {
         })
     )
     )
-    // console.log(result)
     if(result?.data?.createUser===null) {
         //  такой пользователь есть
     } else {

+ 0 - 1
hipstagram/src/App.js

@@ -4,7 +4,6 @@ import Header from "./Header/header";
 import Navigation from "./Content/Navigation/navigation";
 import News from "./Content/News/news";
 import { Redirect, Route, BrowserRouter as Router, Switch } from "react-router-dom";
-// import { Redirect, Route, Router, Switch } from "react-router-dom";
 import Music from "./Content/Music/music";
 import Profile from "./Content/Profile/profile";
 import Settings from "./Content/Settings/settings";

+ 8 - 10
hipstagram/src/Content/Registration/Registration.js

@@ -1,5 +1,5 @@
 import React, {useRef, useState} from 'react';
-import { NavLink } from 'react-router-dom';
+import {NavLink} from 'react-router-dom';
 import './Registration.css';
 import ExistingLoginError from "../../Components/RegistrationError/ExistingLoginError";
 import ConfirmPasswordError from "../../Components/RegistrationError/ConfirmPasswordError";
@@ -22,11 +22,11 @@ const Registration = ({onRegistration}) => {
                 ref={loginRef}
                 onChange={(e) => setLogin(e.target.value)}></input>
             <input
-                    value={password}
-                    placeholder="Password"
-                    ref={pasRef}
-                    onChange={(e) => setPassword(e.target.value)}
-                    type="password"
+                value={password}
+                placeholder="Password"
+                ref={pasRef}
+                onChange={(e) => setPassword(e.target.value)}
+                type="password"
             ></input>
             <input placeholder="Confirm Password"></input>
 
@@ -36,14 +36,12 @@ const Registration = ({onRegistration}) => {
                 <NavLink to="/login">Login</NavLink>
             </nav>
 
-            <ExistingLoginError />
-            <ConfirmPasswordError />
+            <ExistingLoginError/>
+            <ConfirmPasswordError/>
         </div>
     )
 }
 
-// export default Registration;
-
 const CRegistration = connect(null, {
     onRegistration: actionRegistrations
 })(Registration)

+ 1 - 3
hipstagram/src/Header/header.js

@@ -26,9 +26,7 @@ function Header({ loginName = "", isLogin = false, onLogout }) {
                     </div>
                 }
 
-                {/* {isLogout && <Logout onClick={onLogout} />} */}
-                {isLogout && <Logout onClick={() => {onLogout(); console.log('it works'); setIsLogout(false)}} />}
-                {/* {isLogout && <button onClick={() => onLogout()}>Logout</button>} */}
+                {isLogout && <Logout onClick={() => {onLogout(); setIsLogout(false)}} />}
             </header>
         </nav>
     );