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

View File

@@ -6,6 +6,7 @@ import { useAuth } from '../AuthContext';
export default function Login() {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [showPassword, setShowPassword] = useState(false);
const [loading, setLoading] = useState(false);
const { login } = useAuth();
const navigate = useNavigate();
@@ -42,13 +43,34 @@ export default function Login() {
</div>
<div className="form-group">
<label>Password</label>
<div style={{ position: 'relative' }}>
<input
type="password"
type={showPassword ? 'text' : 'password'}
className="input"
value={password}
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>
<button type="submit" className="btn btn-primary" style={{ width: '100%', marginTop: '1rem' }} disabled={loading}>
{loading ? 'Logging in...' : 'Login'}

View File

@@ -7,6 +7,7 @@ export default function Register() {
const [email, setEmail] = useState('');
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
const [showPassword, setShowPassword] = useState(false);
const [loading, setLoading] = useState(false);
const { register } = useAuth();
const navigate = useNavigate();
@@ -53,14 +54,35 @@ export default function Register() {
</div>
<div className="form-group">
<label>Password</label>
<div style={{ position: 'relative' }}>
<input
type="password"
type={showPassword ? 'text' : 'password'}
className="input"
value={password}
onChange={(e) => setPassword(e.target.value)}
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>
<button type="submit" className="btn btn-primary" style={{ width: '100%', marginTop: '1rem' }} disabled={loading}>
{loading ? 'Creating account...' : 'Register'}