Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mernStack
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Venkaiah Naidu Singamchetty
mernStack
Commits
1c59899a
Commit
1c59899a
authored
Mar 01, 2024
by
Venkaiah Naidu Singamchetty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added errorpage
parent
6a038d9b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
26 deletions
+28
-26
App.tsx
src/App.tsx
+23
-21
Footer.js
src/components/Footer/Footer.js
+2
-2
Home.tsx
src/components/Home.tsx
+1
-1
Login.css
src/components/Login/Login.css
+1
-1
Register.tsx
src/components/Register/Register.tsx
+1
-1
No files found.
src/App.tsx
View file @
1c59899a
import
React
from
'react'
;
import
React
from
'react'
;
import
{
BrowserRouter
,
Route
,
Routes
}
from
'react-router-dom'
;
import
{
BrowserRouter
,
Route
,
Routes
}
from
'react-router-dom'
;
import
Home
from
'./components/Home'
;
import
Home
from
'./components/Home'
;
import
Login
from
'./components/Login/Login'
;
import
Login
from
'./components/Login/Login'
;
import
Register
from
'./components/Register/Register'
;
import
Register
from
'./components/Register/Register'
;
...
@@ -9,32 +9,34 @@ import Products from './components/catelog/Products';
...
@@ -9,32 +9,34 @@ import Products from './components/catelog/Products';
import
Product
from
'./components/catelog/Product'
;
import
Product
from
'./components/catelog/Product'
;
import
ForgetPasswordForm
from
'./components/ForgetPasswordForm/ForgetPasswordForm'
;
import
ForgetPasswordForm
from
'./components/ForgetPasswordForm/ForgetPasswordForm'
;
import
{
Provider
}
from
'react-redux'
;
import
{
Provider
}
from
'react-redux'
;
import
store
,
{
persistor
}
from
'./reduxstore/store'
;
import
store
,
{
persistor
}
from
'./reduxstore/store'
;
import
Navbar
from
'./components/Navbar/Navbar'
;
import
Navbar
from
'./components/Navbar/Navbar'
;
import
Footer
from
'./components/Footer/Footer'
;
import
Footer
from
'./components/Footer/Footer'
;
import
Error
from
'./components/404page/error'
;
import
{
PersistGate
}
from
'redux-persist/integration/react'
;
import
{
PersistGate
}
from
'redux-persist/integration/react'
;
function
App
()
{
function
App
()
{
return
(
return
(
<
Provider
store=
{
store
}
>
<
Provider
store=
{
store
}
>
<
PersistGate
loading=
{
null
}
persistor=
{
persistor
}
>
<
PersistGate
loading=
{
null
}
persistor=
{
persistor
}
>
<
BrowserRouter
>
<
BrowserRouter
>
<
Navbar
/>
<
Navbar
/>
<
Routes
>
<
Routes
>
<
Route
path=
"/"
Component=
{
Home
}
/>
<
Route
path=
"/"
Component=
{
Home
}
/>
<
Route
path=
"/login"
Component=
{
Login
}
/>
<
Route
path=
"/home"
Component=
{
Home
}
/>
<
Route
path=
"/register"
Component=
{
Register
}
/>
<
Route
path=
"/login"
Component=
{
Login
}
/>
<
Route
path=
"/cart"
Component=
{
Cart
}
/>
<
Route
path=
"/register"
Component=
{
Register
}
/>
<
Route
path=
"/profile"
Component=
{
Profile
}
/>
<
Route
path=
"/cart"
Component=
{
Cart
}
/>
<
Route
path=
"/products"
Component=
{
Products
}
/>
<
Route
path=
"/profile"
Component=
{
Profile
}
/>
<
Route
path=
"/forgot-password"
Component=
{
ForgetPasswordForm
}
/>
<
Route
path=
"/products"
Component=
{
Products
}
/>
<
Route
path=
"/forgot-password"
Component=
{
ForgetPasswordForm
}
/>
</
Routes
>
<
Route
path=
"*"
Component=
{
Error
}
/>
<
Footer
/>
</
Routes
>
</
BrowserRouter
>
<
Footer
/>
</
BrowserRouter
>
</
PersistGate
>
</
PersistGate
>
</
Provider
>
</
Provider
>
);
);
}
}
export
default
App
export
default
App
\ No newline at end of file
src/components/Footer/Footer.js
View file @
1c59899a
...
@@ -11,11 +11,11 @@ const Footer = () => {
...
@@ -11,11 +11,11 @@ const Footer = () => {
<
div
className
=
'footer-logo'
>
<
div
className
=
'footer-logo'
>
<
/div>
<
/div>
<
ul
className
=
'footer-link'
>
{
/*
<ul className='footer-link'>
<li>Products</li>
<li>Products</li>
<li>About</li>
<li>About</li>
<li>Contact</li>
<li>Contact</li>
<
/ul>
</ul>
*/
}
<
div
className
=
'footer-social-icon'
>
<
div
className
=
'footer-social-icon'
>
<
div
className
=
'footer-icons-container'
>
<
div
className
=
'footer-icons-container'
>
<
img
src
=
{
instagram_icon
}
alt
=
""
/>
<
img
src
=
{
instagram_icon
}
alt
=
""
/>
...
...
src/components/Home.tsx
View file @
1c59899a
...
@@ -18,7 +18,7 @@ const Home = memo(() => {
...
@@ -18,7 +18,7 @@ const Home = memo(() => {
if
(
user
)
{
if
(
user
)
{
navigate
(
'/products'
)
navigate
(
'/products'
)
}
else
{
}
else
{
navigate
(
'/
login
'
)
navigate
(
'/'
)
}
}
},
[
user
])
},
[
user
])
...
...
src/components/Login/Login.css
View file @
1c59899a
.loginsignup
{
.loginsignup
{
width
:
100%
;
width
:
100%
;
height
:
100vh
;
height
:
fit-content
;
background
:
#fce3fe
;
background
:
#fce3fe
;
padding-top
:
100px
;
padding-top
:
100px
;
display
:
flex
;
display
:
flex
;
...
...
src/components/Register/Register.tsx
View file @
1c59899a
...
@@ -114,7 +114,7 @@ const Register = () => {
...
@@ -114,7 +114,7 @@ const Register = () => {
await
axios
.
post
(
'http://localhost:4000/registeruser'
,
values
)
await
axios
.
post
(
'http://localhost:4000/registeruser'
,
values
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
navigate
(
"/login"
)
navigate
(
"/login"
)
console
.
log
(
res
.
data
)
//
console.log(res.data)
})
})
.
catch
((
err
)
=>
console
.
log
(
err
))
.
catch
((
err
)
=>
console
.
log
(
err
))
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment