Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rayan code #42

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
40fe51c
Delete tests directory
retr0717 Nov 7, 2023
6893188
initial setup done
retr0717 Nov 7, 2023
235eb3f
Update README.md
retr0717 Nov 7, 2023
5efbda1
Update README.md
retr0717 Nov 7, 2023
8e9b3c9
Update README.md
retr0717 Nov 7, 2023
61d348a
initial server settings
retr0717 Nov 7, 2023
2536ef4
routes,helpers,model
retr0717 Nov 7, 2023
02ec193
Merge branch 'master' of https://github.com/AKA717/retr0-stackup
retr0717 Nov 7, 2023
01d4846
server.js update
retr0717 Nov 7, 2023
ec79ea1
added server.js updated
retr0717 Nov 7, 2023
1695483
add contact route done
retr0717 Nov 8, 2023
03480d7
add-contact route done
retr0717 Nov 8, 2023
cb195b2
model.js
retr0717 Nov 8, 2023
826fbd4
get-contacts route done
retr0717 Nov 8, 2023
0259c36
delete route done
retr0717 Nov 8, 2023
520bfe3
contact update route done
retr0717 Nov 8, 2023
f8504ab
route
retr0717 Nov 8, 2023
728060a
branch 'back-end'
retr0717 Nov 8, 2023
992b127
merge mistake in user-route
retr0717 Nov 8, 2023
8b0c172
model.js merge mistake
retr0717 Nov 8, 2023
c2d8fd2
user router js merge mistake
retr0717 Nov 8, 2023
90b3964
server.js merge mistake
retr0717 Nov 8, 2023
f9beb24
back-end branch merge mistakes resolved
retr0717 Nov 8, 2023
5357886
initial redux store setup done
retr0717 Nov 8, 2023
ba8bd9c
Merge branch 'front-end'
retr0717 Nov 8, 2023
ef5d4c5
user router merge mistake
retr0717 Nov 8, 2023
95762f8
login component created
melo-maniac-29 Nov 8, 2023
f14c4e1
login component created
melo-maniac-29 Nov 8, 2023
224d670
Update README.md
melo-maniac-29 Nov 8, 2023
169f0f4
register component
melo-maniac-29 Nov 8, 2023
9935104
login register functionality works
retr0717 Nov 8, 2023
6c6e9fe
Merge branch 'master' of https://github.com/AKA717/retr0-stackup
retr0717 Nov 8, 2023
6739950
saga middlwares and actions
retr0717 Nov 8, 2023
486942a
login ,register, home view,add contact features added
retr0717 Nov 9, 2023
be07b53
added route to user view after add contact
retr0717 Nov 9, 2023
8b02153
delete feature added
retr0717 Nov 9, 2023
3193eb0
edit feature added
retr0717 Nov 10, 2023
129bde0
changed to mdn style
retr0717 Nov 10, 2023
3c025b2
Navbar Logo changed and Contact Manage font change
MhdRayanBinSN Nov 10, 2023
4c651e4
User icon changed and Some edits in card.css and card.jsx
MhdRayanBinSN Nov 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added route to user view after add contact
  • Loading branch information
retr0717 committed Nov 9, 2023
commit be07b53dfaffb6c2107bc0318974d0f94b5be02f
7 changes: 6 additions & 1 deletion front-end/src/components/addContact/add-contact.jsx
Original file line number Diff line number Diff line change
@@ -29,7 +29,12 @@ const AddContactComponent = ({addContact,user}) => {
navigate('/', { replace: true });

}
}, [user.login, navigate]);

if(user.contact_add)
{
navigate('/', { replace: true });
}
}, [user.login, navigate,user,user.contact_add]);

return (
<section className="view vh-100">
7 changes: 6 additions & 1 deletion front-end/src/components/view/view.jsx
Original file line number Diff line number Diff line change
@@ -14,8 +14,13 @@ const UserView = ({ user ,fetchContacts}) => {
// User is logged in, navigate to another route
navigate("/", { replace: true });
}

if(user.contact_add)
{
user.contact_add = false;
}
fetchContacts(user.user.id)
}, [user.login, navigate]);
}, [user.login, navigate,user.contact_add]);

return (
<div className="container">
10 changes: 10 additions & 0 deletions front-end/src/redux/reducers/user/user-reducer.js
Original file line number Diff line number Diff line change
@@ -8,6 +8,16 @@ const userReducer = (state=initState,action) =>
{
switch(action.type)
{
case actions.ADD_CONTACT_SUCCESS:
return{
...state,
contact_add : true
}
case actions.ADD_CONTACT_FAILED:
return{
...state,
contact_add: false
}
case actions.LOGIN_SUCCESS:
return {
...state,