-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat(#1423): Add table page (code review needed) #27
Conversation
❌ Deploy Preview for abgov-ui-component-docs failed.
|
src/routes/components/Table.tsx
Outdated
]; | ||
setUsers(_users); | ||
}, []); | ||
function sortData(sortBy: string, sortDir: number) { | ||
const _users = [...users]; | ||
_users.sort((a: any, b: any) => { | ||
return (a[sortBy] > b[sortBy] ? 1 : -1) * sortDir; | ||
}); | ||
setUsers(_users); | ||
} | ||
return ( | ||
<GoATable onSort={sortData}> | ||
<thead> | ||
<tr> | ||
<th> | ||
<GoATableSortHeader name="firstName">First name</GoATableSortHeader> |
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.
The code snippets allow for whitespace (storybook didn't). So we should keep things readable by adding whitespace where necessary.
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.
Thank you @chrisolsen I added the space.
d520648
to
5b890f6
Compare
|
Signed-off-by: Vanessa Tran <[email protected]>
5b890f6
to
729279d
Compare
Add table page: