Skip to content

Commit

Permalink
feat: lint formatting [gh-36]
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubfolta committed Jun 21, 2024
1 parent 3c8c959 commit 8c7e1de
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 31 deletions.
37 changes: 19 additions & 18 deletions frontend/src/app/(app)/people/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,39 +209,40 @@ export default function People() {

<table className="text-sm table-auto">
<thead>
<tr className={generateClassNames('h-14 text-xs uppercase text-navy-500 *:px-4 *:py-0 *:font-medium *:text-start', {
'*:w-40': activeTab === TABS[0].title,
'*:w-[200px]': activeTab === TABS[1].title,
'[&&>*]:w-1/4': activeTab === TABS[2].title,
})}
<tr
className={generateClassNames(
'h-14 text-xs uppercase text-navy-500 *:px-4 *:py-0 *:font-medium *:text-start',
{
'*:w-40': activeTab === TABS[0].title,
'*:w-[200px]': activeTab === TABS[1].title,
'[&&>*]:w-1/4': activeTab === TABS[2].title,
},
)}
>
<th className={generateClassNames('[&]:w-auto', {
'flex items-center [&&]:w-[400px] h-14': activeTab === TABS[2].title
<th
className={generateClassNames('[&]:w-auto', {
'flex items-center [&&]:w-[400px] h-14': activeTab === TABS[2].title,
})}
>Employee</th>
>
Employee
</th>
<th>Ladder</th>
<th className="[&]:text-end">Current Band</th>
{activeTab === TABS[0].title &&
{activeTab === TABS[0].title && (
<>
<th className="[&]:text-end">Active Goal</th>
<th className="[&]:w-[248px] [&]:pl-14">Goal Progress</th>
<th className="[&]:text-center">Latest Activity</th>
</>
}
{activeTab === TABS[1].title &&
<th className="[&]:w-[400px] [&]:pl-14">Action</th>
}
)}
{activeTab === TABS[1].title && <th className="[&]:w-[400px] [&]:pl-14">Action</th>}
<th className="[&]:w-12" />
</tr>
</thead>

<tbody>
{filterPeople(selectedTabPeople)?.map((employee: Employee, index) => (
<EmployeeCard
key={index}
employee={employee}
tabSelected={activeTab}
/>
<EmployeeCard key={index} employee={employee} tabSelected={activeTab} />
))}
</tbody>
</table>
Expand Down
27 changes: 16 additions & 11 deletions frontend/src/components/common/EmployeeCard/EmployeeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export const EmployeeCard = ({ employee, tabSelected }: EmployeeCardProps) => {

return (
<>

<tr className="text-navy-700 text-sm w-full h-16 border-t border-navy-200 *:px-4 *:py-0" key={name}>
<td {...(laddersDetails.length > 1 && { className: 'flex h-16' })}>
<div className="flex gap-4">
Expand Down Expand Up @@ -53,7 +52,7 @@ export const EmployeeCard = ({ employee, tabSelected }: EmployeeCardProps) => {
</span>
))}
</td>
{tabSelected === tabs[0] &&
{tabSelected === tabs[0] && (
<>
<td>
{laddersDetails.map((ladder, index) => (
Expand Down Expand Up @@ -103,19 +102,25 @@ export const EmployeeCard = ({ employee, tabSelected }: EmployeeCardProps) => {
)}
</td>
</>
}
{tabSelected === tabs[1] &&
)}
{tabSelected === tabs[1] && (
<td className="flex gap-4 [&]:pr-2 [&]:pl-14">
<button className="h-11 px-5 text-navy-600 font-semibold border border-navy-300 rounded-full">Resume</button>
<button className="h-11 px-5 text-navy-600 font-semibold border border-navy-300 rounded-full">Activate employee</button>
<button className="h-11 px-5 text-navy-600 font-semibold border border-navy-300 rounded-full">
Resume
</button>
<button className="h-11 px-5 text-navy-600 font-semibold border border-navy-300 rounded-full">
Activate employee
</button>
</td>
}
<td className={generateClassNames('[&]:px-0', {
'[&]:px-4': tabSelected === tabs[2]
)}
<td
className={generateClassNames('[&]:px-0', {
'[&]:px-4': tabSelected === tabs[2],
})}
>
<div className={generateClassNames('flex justify-center cursor-pointer', {
'justify-end': tabSelected === tabs[2]
<div
className={generateClassNames('flex justify-center cursor-pointer', {
'justify-end': tabSelected === tabs[2],
})}
>
<DotsIcon className="w-[18px] h-[18px]" />
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/const/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { filters } from './peopleDropdownFilterOptions';
export { tabs } from './peopleTabs';
export { tabs } from './peopleTabs';
2 changes: 1 addition & 1 deletion frontend/src/const/peopleTabs.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const tabs = ['Active', 'Drafts', 'Deactivated'];
export const tabs = ['Active', 'Drafts', 'Deactivated'];

0 comments on commit 8c7e1de

Please sign in to comment.