feat: implement login and signup pages with shared authentication styles, including form validation and Redux integration for authentication state management

This commit is contained in:
louiscklaw
2025-06-17 23:47:18 +08:00
parent 1325a361dc
commit 2b09261f0a
6 changed files with 145 additions and 30 deletions

View File

@@ -1,11 +1,21 @@
// REQ0053/profile-page
//
// PURPOSE:
// - Provides functionality view user profile
//
// RULES:
// - T.B.A.
//
/**
* Not Logged In Profile View Component
*
* Displays when user is not authenticated, with:
* - Visual placeholder for profile
* - Login button (regular user)
* - Party member login button
* - Signup encouragement
*
* Features:
* - Pull-to-refresh functionality
* - Responsive design for all screen sizes
* - Clear call-to-action buttons
*
* Connected to:
* - Redux store for speaker data
* - Router for navigation
*/
import React, { useEffect, useRef, useState } from 'react';
import {
IonHeader,
@@ -104,6 +114,18 @@ const MyProfile: React.FC<SpeakerListProps> = ({ speakers, speakerSessions }) =>
}
}
const [disableForwardPartyUserLoginButton, setDisableForwardPartyUserLoginButton] =
useState(false);
function handleForwardPartyUserLoginPage() {
try {
setDisableForwardPartyUserLoginButton(true);
router.push(PATHS.PARTY_USER_SIGN_IN);
setDisableForwardPartyUserLoginButton(false);
} catch (error) {
console.error(error);
}
}
useEffect(() => {
getProfileById('2').then(({ data }) => {
console.log({ data });
@@ -180,6 +202,7 @@ const MyProfile: React.FC<SpeakerListProps> = ({ speakers, speakerSessions }) =>
not login yet, <br />
please login or sign up
</div>
{/* */}
<div
style={{
display: 'flex',
@@ -192,6 +215,24 @@ const MyProfile: React.FC<SpeakerListProps> = ({ speakers, speakerSessions }) =>
Login
</IonButton>
</div>
{/* */}
<div
style={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
}}
>
<IonButton
disabled={disableForwardPartyUserLoginButton}
onClick={handleForwardPartyUserLoginPage}
>
Party Member Login
</IonButton>
</div>
</div>
</div>
</IonContent>