Skip to content

Commit

Permalink
Create Header.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 7, 2024
1 parent 0694cf4 commit 3db5311
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions projects/PiWalletBot/client/components/Header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';
import styled from 'styled-components';
import { useAuth } from '../context/auth';

const HeaderContainer = styled.header`
background-color: #333;
color: #fff;
padding: 20px;
text-align: center;
`;

const Header = () => {
const auth = useAuth();

return (
<HeaderContainer>
<h1>Pi Wallet Bot</h1>
{auth.isLoggedIn ? (
<p>Welcome, {auth.user.username}!</p>
) : (
<p>You are not logged in.</p>
)}
</HeaderContainer>
);
};

export default Header;

0 comments on commit 3db5311

Please sign in to comment.