Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FE][CPF-65] Add employee - personal details #77

Merged
merged 15 commits into from
Jul 5, 2024

Conversation

r1skz3ro
Copy link
Collaborator

@r1skz3ro r1skz3ro commented Jul 2, 2024

#65

@@ -0,0 +1,71 @@
'use client';
Copy link
Collaborator Author

@r1skz3ro r1skz3ro Jul 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when we set the convention of file and component structure/architecture I will get rid of that line of shame 😄

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned on the channel. Let's go for the interface files, hooks (logic), index and component that takes data from the hook

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left that there because the whole page is a form and needs JS interactivity

@r1skz3ro r1skz3ro force-pushed the feat/cpf-65-add-employee-layout branch from cc6fcd0 to 1b26b45 Compare July 2, 2024 13:00
@r1skz3ro r1skz3ro force-pushed the feat/cpf-65-add-employee-layout branch from ed22ef0 to e6fdf0d Compare July 4, 2024 08:32
<div className="w-full">
<WorkflowTopbar />
<main className="p-8">
<div className="grid grid-cols-[minmax(200px,1fr),minmax(400px,1100px),1fr]">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming it's not a one-time use, perhaps it would be worth adding this grid cold to the theme?

import { useEffect, useState } from 'react';
import { useForm } from 'react-hook-form';

enum PersonalDetailsFormNames {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have established to use consts instead of enums

@@ -0,0 +1,8 @@
import { FieldValues, RegisterOptions } from 'react-hook-form';

export interface InputProps {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add some props for the icon at the beginning/end of the field?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add input styles from Figma styleguide in the next PR. I didn't want to make this PR too big with all the extras.

[PersonalDetailsFormNames.email]: string;
}

export default function PersonalDetails() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to our agreements about components structure, this should be moved to src/components/pages/PersonalDetails/. Then you can extract the logic to PersonalDetails.hooks.ts.

import { Fragment } from 'react';
import { Typography } from '@app/components/common/Typography';

const Completed = () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about moving it to the utils file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean utils but in the context of sideStepper, so inside src/components/modules/SideStepper/utils?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, exactly!

@@ -0,0 +1,27 @@
import { AddNewPersonRouteKeys } from '@app/components/modules/EmployeeSideStepper';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with this approach for now, though I believe as this file grows, we should split it into interfaces, utils, store and actions (potentially)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totally agree, ive just changed that

@skorekm skorekm merged commit 702bda8 into develop Jul 5, 2024
4 checks passed
@r1skz3ro r1skz3ro deleted the feat/cpf-65-add-employee-layout branch July 5, 2024 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants