docs: UI improvement ideas #27
Loading…
Reference in a new issue
No description provided.
Delete branch "ui-improvement-ideas"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
docs: UI improvement ideasto WIP: docs: UI improvement ideas@talha if you have an hour or two, take a look at this project and give me any UI improvement ideas. the UI looks how we want it, but I'm sure the code could use a lot of clean up.
Issues:
/App.tsx
i.e
function AppLayout() {return (<Layout><Outlet /></Layout>);}// existing code<Route element={<AppLayout />}><Route path="/reports/job-commissions" element={<JobCommissionsPage />} /><Route path="/reports/sales" element={<SalesReportPage />} />// other routes</Route>/components/CopyableCell.tsx
my suggestion for both:
/components/reports/job-commissions/JobCommissionsPage.tsx
getPreviousMonthDatesandgetMonthDatesshould be outside component definition, as we don't want them to be initialized again and againgetPreviousMonthDatesgets called on every initialization of component, we can call it insideuseStateas callback so it gets called only oncesetSelectedEmployee,setBalanceStatus,setProfitLevel,setCommissionStatusandsetWriteOffStatus, we can simply make a functionupdateFilterwith definition likeconst updateFilter = <K extends keyof InvoiceFilters>(key: K,value: InvoiceFilters[K],) => setFilters((prev) => ({ ...prev, [key]: value }));and then call it like
updateFilter("selectedEmployeeID", value)getMonthOptionsshouldn't be defined inside component too. it can be moved outside component, or it would be better to move it to some util as this file is already too long.setFiltersExpandedit would be i think better to do this likesetFiltersExpanded(prev => !prev)instead ofsetFiltersExpanded(!filtersExpanded)/components/reports/job-commissions/JobCommissionsPrintPage.tsx
getPreviousMonthDatesis static function and is defined here too, it's better to keep these functions in utils file and then use it where required./components/reports/sales/SalesReportPage.tsx
selectedEmployeeIDin 2nd useEffect is redundant, as 1st useeffect has it too and it reinitializesfetchInvoiceswhich runs 2nd useeffect too./components/reports/sales/SalesReportPrintPage.tsx
/components/configuration/employees/EmployeesPage.tsx
Thanks! I will dig into adding some of these to specs 👍
WIP: docs: UI improvement ideasto docs: UI improvement ideasdocs: UI improvement ideasto WIP: docs: UI improvement ideasWIP: docs: UI improvement ideasto docs: UI improvement ideasdocs: UI improvement ideasto WIP: docs: UI improvement ideasWIP: docs: UI improvement ideasto docs: UI improvement ideasdocs: UI improvement ideasto WIP: docs: UI improvement ideasWIP: docs: UI improvement ideasto docs: UI improvement ideas