-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from WSU-4110/Ragad
Ragad
- Loading branch information
Showing
11 changed files
with
245 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'use client'; | ||
import React from 'react'; | ||
import '../categories.css'; | ||
import Card from '../components/ui/card'; | ||
|
||
export default function BarberShops() { | ||
const businesses: any[] = []; | ||
|
||
return ( | ||
<div className="container"> | ||
<h1 className="title">Barber Shops</h1> | ||
<div className="list"> | ||
{businesses.length > 0 ? ( | ||
businesses.map((business, index) => ( | ||
<Card | ||
key={index} | ||
businessName={business.businessName} | ||
address={business.address} | ||
images={business.images} | ||
about={business.about} | ||
services={business.services} | ||
socialLinks={business.socialLinks} | ||
/> | ||
)) | ||
) : ( | ||
<p>No businesses available. Please check back later!</p> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,59 @@ | ||
'use client' | ||
|
||
import React from 'react'; | ||
import './navbar_artist.css'; | ||
import { useRouter } from 'next/navigation'; | ||
|
||
export default function Nav_bar() { | ||
const router = useRouter(); | ||
|
||
const handlelogout = () => { | ||
localStorage.removeItem('authToken'); | ||
alert('Logging out'); | ||
router.push('/'); | ||
} | ||
|
||
return ( | ||
<nav className="navigation"> | ||
<ul> | ||
<li><button onClick={() => router.push('/homepage')}>Home</button></li> | ||
<li><button onClick={() => router.push('/portfolio')}>Portfolio</button></li> | ||
<li><button onClick={() => router.push('/clients')}>Clients</button></li> | ||
<li><button onClick={() => router.push('/helppage')}>Help</button></li> | ||
<li><button onClick={handlelogout}>Log Out</button></li> | ||
</ul> | ||
</nav> | ||
); | ||
} | ||
//'use client' | ||
|
||
//import React, { useState, useEffect } from 'react'; | ||
//import './navbar_artist.css'; | ||
//import { useRouter } from 'next/navigation'; | ||
//import { auth } from '../firebase'; | ||
|
||
//export default function NavbarArtist() { | ||
// const router = useRouter(); | ||
// const [user, setUser] = useState(null); | ||
// const [role, setRole] = useState(''); | ||
// const [isLoading, setIsLoading] = useState(true); | ||
|
||
// useEffect(() => { | ||
// const userRole = localStorage.getItem('role'); | ||
// setRole(userRole || ''); | ||
|
||
// const unsubscribe = auth.onAuthStateChanged((currentUser) => { | ||
// setUser(currentUser); | ||
// setIsLoading(false); | ||
// }); | ||
|
||
// return () => unsubscribe(); | ||
// }, []); | ||
|
||
// const handleLogout = () => { | ||
// localStorage.removeItem('role'); | ||
// auth.signOut(); | ||
// alert('Logging out'); | ||
// router.push('/'); | ||
// }; | ||
|
||
// if (isLoading) { | ||
// return null; | ||
// } | ||
|
||
// if (role !== 'artist') { | ||
// return null; | ||
// } | ||
|
||
// return ( | ||
// <nav className="navigation"> | ||
// <ul> | ||
// <li><button onClick={() => router.push('/homepage')}>Home</button></li> | ||
// <li><button onClick={() => router.push('/portfolio')}>Portfolio</button></li> | ||
// <li><button onClick={() => router.push('/clients')}>Clients</button></li> | ||
// <li><button onClick={() => router.push('/helppage')}>Help</button></li> | ||
// {user ? ( | ||
// <> | ||
// <li>Welcome, {user.displayName || user.email}</li> | ||
// <li><button onClick={handleLogout}>Log Out</button></li> | ||
// </> | ||
// ) : ( | ||
// <li><button onClick={() => router.push('/artistlogin')}>Log In</button></li> | ||
// )} | ||
// </ul> | ||
// </nav> | ||
// ); | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,6 @@ | |
} | ||
|
||
.navigation button:hover { | ||
color: #f3cf9a; | ||
color: #a7a39e; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,93 @@ | ||
'use client' | ||
'use client'; | ||
|
||
import React from 'react'; | ||
import './navigationbar.css'; | ||
import React, { useState, useEffect } from 'react'; | ||
import { useRouter } from 'next/navigation'; | ||
import { auth } from '../firebase'; | ||
import './navigationbar.css'; | ||
|
||
export default function Navbar() { | ||
const router = useRouter(); | ||
const [user, setUser] = useState<any>(null); | ||
const [role, setRole] = useState<string>(''); | ||
const [isLoading, setIsLoading] = useState(true); | ||
const [isAuthChecked, setIsAuthChecked] = useState(false); | ||
|
||
useEffect(() => { | ||
if (typeof window !== 'undefined') { | ||
const userRole = localStorage.getItem('role'); | ||
setRole(userRole || ''); | ||
} | ||
const unsubscribe = auth.onAuthStateChanged((currentUser) => { | ||
setUser(currentUser); | ||
setIsLoading(false); | ||
setIsAuthChecked(true); | ||
}); | ||
|
||
const handlelogout = () => { | ||
localStorage.removeItem('authToken'); | ||
return () => unsubscribe(); | ||
}, []); | ||
const handleLogout = () => { | ||
localStorage.removeItem('role'); | ||
auth.signOut(); | ||
alert('Logging out'); | ||
router.push('/'); | ||
}; | ||
if (isLoading || !isAuthChecked) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<nav className="navigation"> | ||
<ul> | ||
<li><button onClick={() => router.push('/homepage')}>Home</button></li> | ||
<li><button onClick={() => router.push('/appointments')}>Appointments</button></li> | ||
<li><button onClick={() => router.push('/userprofile')}>Profile</button></li> | ||
<li><button onClick={() => router.push('/helppage')}>Help</button></li> | ||
<li><button onClick={handlelogout}>Log Out</button></li> | ||
<li> | ||
<button onClick={() => router.push('/homepage')}>Home</button> | ||
</li> | ||
|
||
{role === 'artist' && ( | ||
<> | ||
<li> | ||
<button onClick={() => router.push('/portfolio')}>Portfolio</button> | ||
</li> | ||
<li> | ||
<button onClick={() => router.push('/clients')}>Clients</button> | ||
</li> | ||
</> | ||
)} | ||
|
||
{role === 'customer' && ( | ||
<> | ||
<li> | ||
<button onClick={() => router.push('/appointments')}>Appointments</button> | ||
</li> | ||
<li> | ||
<button onClick={() => router.push('/userprofile')}>Profile</button> | ||
</li> | ||
</> | ||
)} | ||
|
||
<li> | ||
<button onClick={() => router.push('/helppage')}>Help</button> | ||
</li> | ||
|
||
{user ? ( | ||
<> | ||
<li> | ||
<button onClick={handleLogout}>Log Out</button> | ||
</li> | ||
</> | ||
) : ( | ||
<li> | ||
<button | ||
onClick={() => { | ||
role === 'artist' | ||
? router.push('/artistlogin') | ||
: router.push('/customerlogin'); | ||
}} | ||
> | ||
Log In | ||
</button> | ||
</li> | ||
)} | ||
</ul> | ||
</nav> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'use client'; | ||
import React from 'react'; | ||
import '../categories.css'; | ||
import Card from '../components/ui/card'; | ||
|
||
export default function HairStylists() { | ||
const businesses: any[] = []; | ||
|
||
return ( | ||
<div className="container"> | ||
<h1 className="title">Hair Stylists</h1> | ||
<div className="list"> | ||
{businesses.length > 0 ? ( | ||
businesses.map((business, index) => ( | ||
<Card | ||
key={index} | ||
businessName={business.businessName} | ||
address={business.address} | ||
images={business.images} | ||
about={business.about} | ||
services={business.services} | ||
socialLinks={business.socialLinks} | ||
/> | ||
)) | ||
) : ( | ||
<p>No businesses available. Please check back later!</p> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'use client'; | ||
import React from 'react'; | ||
import '../categories.css'; | ||
import Card from '../components/ui/card'; | ||
|
||
export default function TattooPage() { | ||
const businesses: any[] = []; | ||
|
||
return ( | ||
<div className="container"> | ||
<h1 className="title">Tattoo Artists</h1> | ||
<div className="list"> | ||
{businesses.length > 0 ? ( | ||
businesses.map((business, index) => ( | ||
<Card | ||
key={index} | ||
businessName={business.businessName} | ||
address={business.address} | ||
images={business.images} | ||
about={business.about} | ||
services={business.services} | ||
socialLinks={business.socialLinks} | ||
/> | ||
)) | ||
) : ( | ||
<p>No businesses available. Please check back later!</p> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
} |