Merge pull request 'stage' (#3) from stage into main
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 34s

Reviewed-on: #3
This commit was merged in pull request #3.
This commit is contained in:
2026-01-31 03:11:04 +00:00
3 changed files with 62 additions and 18 deletions

View File

@@ -198,7 +198,7 @@ export default function Friends() {
className="btn btn-primary btn-sm" className="btn btn-primary btn-sm"
onClick={() => handleSendRequest(user.id)} onClick={() => handleSendRequest(user.id)}
disabled={sending === user.id} disabled={sending === user.id}
style={{ flexShrink: 0 }} style={{ flexShrink: 0, width: 'auto' }}
> >
{sending === user.id ? 'Sending...' : 'Add Friend'} {sending === user.id ? 'Sending...' : 'Add Friend'}
</button> </button>
@@ -263,8 +263,8 @@ export default function Friends() {
> >
{removing === friend.id ? 'Removing...' : 'Remove'} {removing === friend.id ? 'Removing...' : 'Remove'}
</button> </button>
<div style={{ color: 'var(--primary)', whiteSpace: 'nowrap' }}>{friend.total_points} points</div>
</div> </div>
<div style={{ color: 'var(--primary)', whiteSpace: 'nowrap' }}>{friend.total_points} points</div>
</div> </div>
))} ))}
{challengeFriends.length > 0 && ( {challengeFriends.length > 0 && (
@@ -296,8 +296,8 @@ export default function Friends() {
> >
{sending === friend.id ? 'Sending...' : friend.friendship_status === 'pending' ? 'Pending' : 'Add Friend'} {sending === friend.id ? 'Sending...' : friend.friendship_status === 'pending' ? 'Pending' : 'Add Friend'}
</button> </button>
<div style={{ color: 'var(--primary)', whiteSpace: 'nowrap' }}>{friend.total_points} points</div>
</div> </div>
<div style={{ color: 'var(--primary)', whiteSpace: 'nowrap' }}>{friend.total_points} points</div>
</div> </div>
))} ))}
</> </>

View File

@@ -6,6 +6,7 @@ import { useAuth } from '../AuthContext';
export default function Login() { export default function Login() {
const [email, setEmail] = useState(''); const [email, setEmail] = useState('');
const [password, setPassword] = useState(''); const [password, setPassword] = useState('');
const [showPassword, setShowPassword] = useState(false);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const { login } = useAuth(); const { login } = useAuth();
const navigate = useNavigate(); const navigate = useNavigate();
@@ -42,13 +43,34 @@ export default function Login() {
</div> </div>
<div className="form-group"> <div className="form-group">
<label>Password</label> <label>Password</label>
<input <div style={{ position: 'relative' }}>
type="password" <input
className="input" type={showPassword ? 'text' : 'password'}
value={password} className="input"
onChange={(e) => setPassword(e.target.value)} value={password}
required onChange={(e) => setPassword(e.target.value)}
/> required
style={{ paddingRight: '2.5rem' }}
/>
<button
type="button"
onClick={() => setShowPassword(!showPassword)}
style={{
position: 'absolute',
right: '0.5rem',
top: '50%',
transform: 'translateY(-50%)',
background: 'none',
border: 'none',
cursor: 'pointer',
padding: '0.25rem',
color: 'var(--text-muted)',
fontSize: '0.875rem'
}}
>
{showPassword ? '👁' : '👁🗨'}
</button>
</div>
</div> </div>
<button type="submit" className="btn btn-primary" style={{ width: '100%', marginTop: '1rem' }} disabled={loading}> <button type="submit" className="btn btn-primary" style={{ width: '100%', marginTop: '1rem' }} disabled={loading}>
{loading ? 'Logging in...' : 'Login'} {loading ? 'Logging in...' : 'Login'}

View File

@@ -7,6 +7,7 @@ export default function Register() {
const [email, setEmail] = useState(''); const [email, setEmail] = useState('');
const [username, setUsername] = useState(''); const [username, setUsername] = useState('');
const [password, setPassword] = useState(''); const [password, setPassword] = useState('');
const [showPassword, setShowPassword] = useState(false);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const { register } = useAuth(); const { register } = useAuth();
const navigate = useNavigate(); const navigate = useNavigate();
@@ -53,14 +54,35 @@ export default function Register() {
</div> </div>
<div className="form-group"> <div className="form-group">
<label>Password</label> <label>Password</label>
<input <div style={{ position: 'relative' }}>
type="password" <input
className="input" type={showPassword ? 'text' : 'password'}
value={password} className="input"
onChange={(e) => setPassword(e.target.value)} value={password}
required onChange={(e) => setPassword(e.target.value)}
minLength={6} required
/> minLength={6}
style={{ paddingRight: '2.5rem' }}
/>
<button
type="button"
onClick={() => setShowPassword(!showPassword)}
style={{
position: 'absolute',
right: '0.5rem',
top: '50%',
transform: 'translateY(-50%)',
background: 'none',
border: 'none',
cursor: 'pointer',
padding: '0.25rem',
color: 'var(--text-muted)',
fontSize: '0.875rem'
}}
>
{showPassword ? '👁️' : '👁️‍🗨️'}
</button>
</div>
</div> </div>
<button type="submit" className="btn btn-primary" style={{ width: '100%', marginTop: '1rem' }} disabled={loading}> <button type="submit" className="btn btn-primary" style={{ width: '100%', marginTop: '1rem' }} disabled={loading}>
{loading ? 'Creating account...' : 'Register'} {loading ? 'Creating account...' : 'Register'}