From 4b6ebf1cda133908bce8116119144ca0900df02f Mon Sep 17 00:00:00 2001 From: rohit3171999 Date: Thu, 25 Dec 2025 16:45:19 +0530 Subject: [PATCH 1/8] feat: add initial LoginPage component --- src/pages/LoginPage/LoginPage.tsx | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/pages/LoginPage/LoginPage.tsx diff --git a/src/pages/LoginPage/LoginPage.tsx b/src/pages/LoginPage/LoginPage.tsx new file mode 100644 index 0000000..e3ca87b --- /dev/null +++ b/src/pages/LoginPage/LoginPage.tsx @@ -0,0 +1,5 @@ +export function LoginPage() { + return ( + <> + ); +} \ No newline at end of file From 4f668fa5edc7e93c1a9ad8ca3e5330a0498a45f4 Mon Sep 17 00:00:00 2001 From: rohit3171999 Date: Thu, 25 Dec 2025 16:53:14 +0530 Subject: [PATCH 2/8] feat: add LoginForm to LoginPage - Import and render LoginForm component - Wrap form in a centered container layout --- src/pages/LoginPage/LoginPage.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/pages/LoginPage/LoginPage.tsx b/src/pages/LoginPage/LoginPage.tsx index e3ca87b..993a188 100644 --- a/src/pages/LoginPage/LoginPage.tsx +++ b/src/pages/LoginPage/LoginPage.tsx @@ -1,5 +1,16 @@ +import {LoginForm} from "../../components/features/auth/LoginForm/LoginForm.tsx"; + export function LoginPage() { return ( - <> +
+ {}} + onError={()=>{}} + /> +
); } \ No newline at end of file From 76b2cf349e8b627a7840735fda0b01717d1fd5b0 Mon Sep 17 00:00:00 2001 From: rohit3171999 Date: Thu, 25 Dec 2025 17:00:47 +0530 Subject: [PATCH 3/8] docs(LoginPage): add component documentation and storybook stories - Added detailed TSDoc comments to LoginPage.tsx explaining component responsibilities. - Created LoginPage.stories.tsx to enable Storybook support. --- src/pages/LoginPage/LoginPage.tsx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/pages/LoginPage/LoginPage.tsx b/src/pages/LoginPage/LoginPage.tsx index 993a188..9c3d231 100644 --- a/src/pages/LoginPage/LoginPage.tsx +++ b/src/pages/LoginPage/LoginPage.tsx @@ -1,5 +1,30 @@ import {LoginForm} from "../../components/features/auth/LoginForm/LoginForm.tsx"; +/** + * LoginPage + * + * This page component is responsible for rendering the user login screen. + * It provides a centered layout for the LoginForm component and serves as + * the entry point for user authentication. + * + * The LoginPage itself does not manage authentication logic directly. + * Instead, it delegates user interaction handling to the LoginForm component + * via callback props. Authentication state management and redirection + * are handled in higher-level contexts or routing logic. + * + * Responsibilities: + * - Display the login form in a centered layout + * - Pass required props to the LoginForm component + * - Serve as a container for future authentication flow integration + * + * Notes: + * - This component does not accept any props. + * - Routing, authentication context, and redirection are intentionally + * excluded at this stage and will be added in later phases. + * + * @returns {JSX.Element} The rendered LoginPage component. + */ + export function LoginPage() { return (
From c095f144bfe7cebc249d49edebf09ae4680f15a3 Mon Sep 17 00:00:00 2001 From: rohit3171999 Date: Thu, 25 Dec 2025 17:07:16 +0530 Subject: [PATCH 4/8] =?UTF-8?q?Refactor=20LoginPage=20component=20document?= =?UTF-8?q?ation=20and=20formatting=20=E2=80=A2=20Simplify=20Javadoc=20des?= =?UTF-8?q?cription=20for=20LoginPage=20=E2=80=A2=20Adjust=20code=20format?= =?UTF-8?q?ting=20for=20better=20readability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/LoginPage/LoginPage.tsx | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/src/pages/LoginPage/LoginPage.tsx b/src/pages/LoginPage/LoginPage.tsx index 9c3d231..c9ff6a5 100644 --- a/src/pages/LoginPage/LoginPage.tsx +++ b/src/pages/LoginPage/LoginPage.tsx @@ -3,39 +3,29 @@ import {LoginForm} from "../../components/features/auth/LoginForm/LoginForm.tsx" /** * LoginPage * - * This page component is responsible for rendering the user login screen. - * It provides a centered layout for the LoginForm component and serves as - * the entry point for user authentication. - * - * The LoginPage itself does not manage authentication logic directly. - * Instead, it delegates user interaction handling to the LoginForm component - * via callback props. Authentication state management and redirection - * are handled in higher-level contexts or routing logic. + * This page component renders the login screen of the application. + * It provides a centered layout and hosts the LoginForm component. * * Responsibilities: * - Display the login form in a centered layout - * - Pass required props to the LoginForm component - * - Serve as a container for future authentication flow integration + * - Act as a container for authentication-related UI * * Notes: * - This component does not accept any props. - * - Routing, authentication context, and redirection are intentionally - * excluded at this stage and will be added in later phases. - * - * @returns {JSX.Element} The rendered LoginPage component. + * - Authentication logic and routing are intentionally excluded. */ export function LoginPage() { - return ( -
+ return (
{}} - onError={()=>{}} + onLogin={() => { + }} + onError={() => { + }} /> -
- ); +
); } \ No newline at end of file From 052e4c2ab090a0537c72eb83a66a795a89ffb95d Mon Sep 17 00:00:00 2001 From: rohit3171999 Date: Thu, 25 Dec 2025 17:18:44 +0530 Subject: [PATCH 5/8] feat(login): add interaction handlers and storybook story for LoginPage - Implement `handleLogin` and `handleError` in `LoginPage` - Connect handlers to `LoginForm` - Add `LoginPage.stories.tsx` for visual testing --- src/pages/LoginPage/LoginPage.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/pages/LoginPage/LoginPage.tsx b/src/pages/LoginPage/LoginPage.tsx index c9ff6a5..3577b87 100644 --- a/src/pages/LoginPage/LoginPage.tsx +++ b/src/pages/LoginPage/LoginPage.tsx @@ -16,16 +16,22 @@ import {LoginForm} from "../../components/features/auth/LoginForm/LoginForm.tsx" */ export function LoginPage() { + + const handleLogin=()=>{ + // TODO: integrate auth flow later + console.log("Login Clicked"); + } + const handleError=()=>{ + console.error("Login Failed"); + } return (
{ - }} - onError={() => { - }} + onLogin={handleLogin} + onError={handleError} />
); } \ No newline at end of file From b7a8b6b92c5bc27a39c4e2961aa71d05dc1438df Mon Sep 17 00:00:00 2001 From: rohit3171999 Date: Thu, 25 Dec 2025 17:37:06 +0530 Subject: [PATCH 6/8] feat: add initial effect and comments to LoginPage - Add useEffect to log mount event and trigger dummy login handler - Update comments for handleLogin and handleError functions - Import useEffect from react --- src/pages/LoginPage/LoginPage.stories.tsx | 15 +++++++++++++++ src/pages/LoginPage/LoginPage.tsx | 9 ++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 src/pages/LoginPage/LoginPage.stories.tsx diff --git a/src/pages/LoginPage/LoginPage.stories.tsx b/src/pages/LoginPage/LoginPage.stories.tsx new file mode 100644 index 0000000..84f6202 --- /dev/null +++ b/src/pages/LoginPage/LoginPage.stories.tsx @@ -0,0 +1,15 @@ +import type { Meta, StoryObj } from '@storybook/react-vite'; + +import { LoginPage } from './LoginPage'; + +const meta = { + component: LoginPage, +} satisfies Meta; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = { + args: {} +}; \ No newline at end of file diff --git a/src/pages/LoginPage/LoginPage.tsx b/src/pages/LoginPage/LoginPage.tsx index 3577b87..7742196 100644 --- a/src/pages/LoginPage/LoginPage.tsx +++ b/src/pages/LoginPage/LoginPage.tsx @@ -1,3 +1,4 @@ +import {useEffect} from "react"; import {LoginForm} from "../../components/features/auth/LoginForm/LoginForm.tsx"; /** @@ -17,13 +18,19 @@ import {LoginForm} from "../../components/features/auth/LoginForm/LoginForm.tsx" export function LoginPage() { + // Step 1: Dummy login handler const handleLogin=()=>{ - // TODO: integrate auth flow later + // later: API call, auth context, redirect console.log("Login Clicked"); } + // Step 2: Dummy error handler const handleError=()=>{ console.error("Login Failed"); } + useEffect(() => { + console.log("LoginPage Mounted"); + handleLogin(); + }, []); return (
Date: Thu, 25 Dec 2025 17:47:52 +0530 Subject: [PATCH 7/8] feat: add initial effect and comments to LoginPage - Add useEffect to log mount event and trigger dummy login handler - Update comments for handleLogin and handleError functions - Import useEffect from react --- src/pages/LoginPage/LoginPage.tsx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/pages/LoginPage/LoginPage.tsx b/src/pages/LoginPage/LoginPage.tsx index 7742196..85ef741 100644 --- a/src/pages/LoginPage/LoginPage.tsx +++ b/src/pages/LoginPage/LoginPage.tsx @@ -19,12 +19,12 @@ import {LoginForm} from "../../components/features/auth/LoginForm/LoginForm.tsx" export function LoginPage() { // Step 1: Dummy login handler - const handleLogin=()=>{ + const handleLogin = () => { // later: API call, auth context, redirect console.log("Login Clicked"); } // Step 2: Dummy error handler - const handleError=()=>{ + const handleError = () => { console.error("Login Failed"); } useEffect(() => { @@ -32,13 +32,13 @@ export function LoginPage() { handleLogin(); }, []); return (
- -
); + +
); } \ No newline at end of file From 4a8cfd33a802e48bed62d1dedb8ef99c6ccc09a7 Mon Sep 17 00:00:00 2001 From: rohit3171999 Date: Thu, 25 Dec 2025 17:56:57 +0530 Subject: [PATCH 8/8] refactor: remove automatic login call on mount - Removed `handleLogin()` call from `useEffect` in `LoginPage.tsx` to prevent automatic login attempt on component mount. --- src/pages/LoginPage/LoginPage.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/LoginPage/LoginPage.tsx b/src/pages/LoginPage/LoginPage.tsx index 85ef741..17aab3e 100644 --- a/src/pages/LoginPage/LoginPage.tsx +++ b/src/pages/LoginPage/LoginPage.tsx @@ -29,7 +29,6 @@ export function LoginPage() { } useEffect(() => { console.log("LoginPage Mounted"); - handleLogin(); }, []); return (