diff --git a/Client/actionCreator/actionCreator.js b/Client/actionCreator/actionCreator.js index ba3b919..16ea28e 100644 --- a/Client/actionCreator/actionCreator.js +++ b/Client/actionCreator/actionCreator.js @@ -7,15 +7,14 @@ export const updateExercisesFromAPI = (array) => ({ export const updateUSER_LOG_ON = (userObj) => ({ type: types.USER_LOG_ON, - payload: userObj -}) + payload: userObj, +}); export const updateUSER_LOG_OFF = () => ({ type: types.USER_LOG_OFF, - payload: 'probably none' -}) +}); export const updateDifficultyAndMuscle = ([muscle, difficulty]) => ({ type: types.UPDATE_MUSCLE_DIFFICULTY, - payload: [muscle, difficulty] -}) \ No newline at end of file + payload: [muscle, difficulty], +}); diff --git a/Client/components/login.jsx b/Client/components/login.jsx index 028b740..3080ce0 100644 --- a/Client/components/login.jsx +++ b/Client/components/login.jsx @@ -36,17 +36,17 @@ const login = () => { alert(data.err); } }) - .catch((error) => alert(error)); + .catch((error) => alert('Invalid Username/Password')); }; return (
This is the MainContainer in Client/containers/MainContainer.jsx
- {/* insert search bar here (input textbox and submit button) */} - - - - {/* Stretch are individual search results from query to database/API */} - {stretchComponents} -Already have an account?
- - diff --git a/Client/reducers/stretchReducer.js b/Client/reducers/stretchReducer.js index d9b010d..78e5050 100644 --- a/Client/reducers/stretchReducer.js +++ b/Client/reducers/stretchReducer.js @@ -15,31 +15,40 @@ const initialState = { loggedInUser: '', favorites: [], muscle: '', - difficulty: '' + difficulty: '', }; const stretchReducer = (state = initialState, action) => { switch (action.type) { // Get's a list of exercises from the server and updates the array with objects of exercises case types.UPDATE_FROM_API: { - return {...state, exercisesFromAPI : action.payload}; + return { ...state, exercisesFromAPI: action.payload }; } // Logs user on case types.USER_LOG_ON: { // get authentication status of user - return {...state, loggedInUser: action.payload.username, favorites : action.payload.favorites} - + document.getElementById('usernameLogin').value = ''; + document.getElementById('passwordLogin').value = ''; + document.getElementById('usernameSignup').value = ''; + document.getElementById('passwordSignup').value = ''; + document.getElementById('passwordSignupConfirm').value = ''; + return { + ...state, + loggedInUser: action.payload.username, + favorites: action.payload.favorites, + }; } // Logs user off case types.USER_LOG_OFF: { - return {...state, loggedInUser : ''} + // reset the state including the logged-in user + return { ...initialState }; } case types.UPDATE_MUSCLE_DIFFICULTY: { const [muscle, difficulty] = action.payload; - return {...state, muscle:muscle, difficulty,difficulty} + return { ...state, muscle: muscle, difficulty, difficulty }; } default: return state; diff --git a/Client/stylesheets/_flexios.scss b/Client/stylesheets/_flexios.scss index 6cb5239..631349d 100644 --- a/Client/stylesheets/_flexios.scss +++ b/Client/stylesheets/_flexios.scss @@ -112,5 +112,5 @@ li:last-child { bottom: 0; background-color: black; z-index: 2; - cursor: pointer; + // cursor: pointer; } diff --git a/Client/stylesheets/styles.css b/Client/stylesheets/styles.css deleted file mode 100644 index 75b60f9..0000000 --- a/Client/stylesheets/styles.css +++ /dev/null @@ -1,52 +0,0 @@ -@import url('https://fonts.cdnfonts.com/css/geomanist'); -* { - margin: none; - padding: none; -} - -/* containers */ -.mainApp { - background-image: linear-gradient(to bottom right, #9b5668, #ce95a3); - font-family: 'Geomanist', sans-serif; - padding: 20px; -} -.stretchCont { - border: 2px solid #000; -} -/* dropdown menu */ -.muscle, -.difficulty { - color: #fff; - padding: 10px; - font-size: 16px; - border: none; - cursor: pointer; -} - -.stretchCard { - background-color: #6b68e7; - color: #fff; - border: 2px solid #fff; -} - -#overlay { - position: fixed; - display: block; - width: 100%; - height: 100%; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: black; - z-index: 2; - cursor: pointer; -} -/* -#6b68e7 -#d1b1f9 -#79403a -#c5a992 -#9b5668 -#ce95a3 -*/ diff --git a/package.json b/package.json index 2ebb4d9..3393189 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,6 @@ "mongodb": "^5.6.0", "mongoose": "^6.8.0", "react": "^18.2.0", - "react-countdown-clock": "^2.10.0", "react-dom": "^18.2.0", "react-hot-loader": "^4.6.3", "react-redux": "^8.1.1",