forked from vaibhav45sktech/crypto
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeader.jsx
More file actions
23 lines (22 loc) · 1.01 KB
/
Copy pathHeader.jsx
File metadata and controls
23 lines (22 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import React from 'react'
import { Sun, Moon } from 'lucide-react'
import { firebaseEnabled } from '../services/firebase.js'
export default function Header({ user, onSignIn, onSignOut, dark, toggle }) {
return (
<header className="flex" style={{ justifyContent: 'space-between', marginBottom: 24 }}>
<h1 style={{ fontSize: 28, fontWeight: 700 }}>Crypto & Stock Market Tracker</h1>
<div className="flex">
<button onClick={toggle} className="flex" style={{ background: 'transparent', color: 'var(--text)', padding: 4, marginRight: 12 }}>
{dark ? <Sun size={18} /> : <Moon size={18} />}
</button>
{user ? (
<button onClick={onSignOut}>Sign out</button>
) : (
<button onClick={onSignIn} disabled={!firebaseEnabled} style={!firebaseEnabled ? { opacity: .6, cursor: 'not-allowed' } : undefined}>
{firebaseEnabled ? 'Sign in with Google' : 'Configure Firebase'}
</button>
)}
</div>
</header>
)
}