Skip to content

Commit

Permalink
use custom pfp otherwise use MUI generated pfp
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackson-Williams-15 committed Jan 19, 2024
1 parent e759cdb commit ccae365
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion FU.SPA/src/components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ export default function Navbar() {

const renderTabContent = () => {
if (user) {
// if user has a custom pfp then use that, if not then use MUI instead of default pfp
const defaultPFP = user.pfpUrl.includes('https://tr.rbxcdn.com/38c6edcb50633730ff4cf39ac8859840/420/420/Hat/Png');
const pfpComponent = !defaultPFP
? <Avatar src={user.pfpUrl} sx={{ width: 33, height: 33 }} />
: <Avatar {...stringAvatar(user.username)} sx={{ width: 33, height: 33, bgcolor: stringToColor(user.username) }} />;
return (
<>
<li style={{ display: 'flex', alignItems: 'center' }}>
<Avatar {...stringAvatar(user.username)} sx={{ width: 33, height: 33, bgcolor: stringToColor(user.username) }}/>
{pfpComponent}
</li>
<li style={{ display: 'flex', alignItems: 'center' }}>
<button onClick={logout}>Logout</button>
Expand Down

0 comments on commit ccae365

Please sign in to comment.