Skip to content

Commit

Permalink
Merge pull request #155 from Alforoan/username-navbar
Browse files Browse the repository at this point in the history
added username to navbar
  • Loading branch information
Alforoan authored Jul 3, 2024
2 parents 3ffec65 + c2014de commit 99cecd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useAuth } from '../context/AuthContext';

const Navbar: React.FC = () => {
const [isOpen, setIsOpen] = useState(false);
const { user, isAuthenticated } = useAuth0();

return (
<nav className="bg-secondaryElements p-4">
Expand All @@ -16,6 +17,10 @@ const Navbar: React.FC = () => {
<Link to="/home" ><img src={Logo} alt="Logo" className="size-16" /></Link> <div className="text-primaryText font-primary font-bold text-xl ml-8">
StudyFlow
</div>
{isAuthenticated && user &&
<p className="text-flair font-primary font-bold text-xl ml-8 lg:ml-16 xs:text-md hidden xs:block">
Hi, {user.given_name ? user.given_name : user.nickname}
</p>}
</div>

{/* Links */}
Expand Down
3 changes: 3 additions & 0 deletions client/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ export default {
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {
screens: {
'xs': '400px',
},
colors: {
primaryText: "#0F172A",
primaryTextLighter: "#0F172A80",
Expand Down

0 comments on commit 99cecd2

Please sign in to comment.