-
Notifications
You must be signed in to change notification settings - Fork 0
Ttonev/hr portal latest #6
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
base: skrastev/sales-tabs
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Could you please remove the routing from the app. We dont need all that boilerplate. Also, delete the files that you dont need.
- When running
npm run build
an error is thrown
return <>{formattedDate}</>; | ||
}; | ||
|
||
const clearSorting = useCallback(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need useCallback
hook here?
setIsSorted(false); | ||
}, []); | ||
|
||
const handleSortingChanged = useCallback(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need useCallback
hook here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is recommended since sorting is passed as a prop to the button and the grid. Using it should avoid unnecessary re-render and improve performance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested this and did u see a boost in performance? useCallback
is needed for:
- If you pass that function as a dependancy to another hook
- The function is passed as a prop (like you do) to a component that uses memoization. Our components don
t use neither
useMemonor
React.memo`.
I don't see any benefit overcomplicating the code, plus that if you don't need it you could cause a minor performance lost
…d-demos-react into ttonev/hr-portal-latest
@@ -1,5 +1,5 @@ | |||
body { | |||
font-family: 'Open Sans', sans-serif; | |||
--ig-font-family: "Open Sans", sans-serif; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need this? Doesnt this font family come from the ig-typography
class?
@@ -3,8 +3,7 @@ | |||
<head> | |||
<meta charset="utf-8" /> | |||
<title>HR Portal</title> | |||
<link href='https://fonts.googleapis.com/icon?family=Material+Icons' rel='stylesheet'> | |||
<link href='https://fonts.googleapis.com/css?family=Titillium+Web:wght@300;400;600;700' rel='stylesheet'> | |||
<link href='https://fonts.googleapis.com/icon?family=Material+Icons' rel='stylesheet'>S |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a S
letter at the end of line 6
setIsSorted(false); | ||
}, []); | ||
|
||
const handleSortingChanged = useCallback(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested this and did u see a boost in performance? useCallback
is needed for:
- If you pass that function as a dependancy to another hook
- The function is passed as a prop (like you do) to a component that uses memoization. Our components don
t use neither
useMemonor
React.memo`.
I don't see any benefit overcomplicating the code, plus that if you don't need it you could cause a minor performance lost
Please inside the project/hr-portal remove the routing since it is not needed. |
@@ -12,14 +12,14 @@ export const routes: RouteObject[] = [ | |||
children: [ | |||
{ index: true, loader: () => redirect('inventory') }, | |||
{ path: 'inventory', element: <ERPHGridView /> }, | |||
{ path: 'hr-portal', element: <HRPortalView /> }, | |||
{ path: 'hr-portal', element: <HRPortal /> }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,19 @@ | |||
body { | |||
background: hsla(var(--ig-surface-500, 0 0% 100%)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need these colors here?
No description provided.