rum-goggles/frontend/src/screens/SignIn.jsx

52 lines
1.9 KiB
React
Raw Normal View History

2023-12-13 21:07:40 +00:00
import { useEffect, useState } from 'react';
import { Navigate, useNavigate } from 'react-router-dom';
import { NavDashboard } from './Navigation';
2023-12-14 21:18:36 +00:00
import { Eye, EyeSlash } from '../assets/icons';
2023-12-13 21:07:40 +00:00
import './SignIn.css';
function SignIn() {
const navigate = useNavigate();
const [streamKey, setStreamKey] = useState('');
const updateStreamKey = (event) => setStreamKey(event.target.value);
2023-12-14 21:18:36 +00:00
const [showStreamKey, setShowStreamKey] = useState(false);
const updateShowStreamKey = () => setShowStreamKey(!showStreamKey);
2023-12-13 21:07:40 +00:00
const saveStreamKey = () => {
navigate(NavDashboard, { state: { streamKey: streamKey } });
};
return (
<div id='SignIn'>
<div className='signin-title'>
<span className='signin-title-text'>Rum Goggles</span>
<span className='signin-title-subtext'>Rumble Stream Dashboard</span>
</div>
<div className='signin-input-box'>
<label className='signin-label'>Stream Key:</label>
<div className='signin-input-button'>
<input
id='StreamKey'
className='signin-input'
onChange={updateStreamKey}
placeholder='Stream Key'
2023-12-14 21:18:36 +00:00
type={showStreamKey ? 'text' : 'password'}
2023-12-13 21:07:40 +00:00
value={streamKey}
/>
2023-12-14 21:18:36 +00:00
<button className='signin-show' onClick={updateShowStreamKey}>
<img
className='signin-show-icon'
src={showStreamKey ? EyeSlash : Eye}
></img>
</button>
2023-12-13 21:07:40 +00:00
<button className='signin-button' onClick={saveStreamKey}>
Save
</button>
</div>
</div>
<div className='signin-title'></div>
</div>
);
}
export default SignIn;