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

Add the Table Component #48

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

saswatamcode
Copy link
Contributor

@saswatamcode saswatamcode commented Oct 28, 2020

Description

This PR adds the Table component at the core/Table path which includes the Table component along with a storybook file and a unit test file.

Code Structure

Screenshot 2020-10-29 at 6 28 58 PM

Storybook

Screenshot 2020-10-29 at 6 31 54 PM

Screenshot

Screenshot 2020-10-28 at 6 34 09 PM
Screenshot 2020-10-28 at 6 34 26 PM

Signed-off-by: Saswata Mukherjee <[email protected]>
pageCount={pageCount}
paginationData={paginationData}
onChangePage={onChangePage}
/>{' '}
Copy link
Contributor

Choose a reason for hiding this comment

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

some extra brackets {' '} can be removed if not required.

);
};

export { BasicTable };
Copy link
Contributor

Choose a reason for hiding this comment

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

are there other variations coming up for the table component?
if not we can export it just as a table. Let wait for others to reviews this.

rowsPerPage: number;
}

interface BasicTableProps extends TableProps {
Copy link
Contributor

Choose a reason for hiding this comment

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

you can get the TableProps from another file as base.ts, have a look as done in other components.

width: '0.2em',
},
'&::-webkit-scrollbar-track': {
webkitBoxShadow: `inset 0 0 6px ${theme.palette.border.main}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

can we convert px to rem and use where required.

@@ -0,0 +1 @@
export * from './BasicTable';
Copy link
Contributor

Choose a reason for hiding this comment

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

If this has only one table component then we can just use as ./Table

Copy link
Contributor

@AVRahul AVRahul Oct 29, 2020

Choose a reason for hiding this comment

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

Also, I guess you need to export globally the Table component at src/core/index.ts something like export * from './Table'; in order to get the table exported for npm.

Copy link
Contributor

Choose a reason for hiding this comment

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

@S-ayanide @arkajyotiMukherjee should we have this Table as a core or lab component?

@@ -0,0 +1 @@
export * from './BasicTable';
Copy link
Contributor

Choose a reason for hiding this comment

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

as it's only one table component, we can export the Table instead.

@@ -0,0 +1,35 @@
import { TableCell, TableRow, Typography } from '@material-ui/core';
Copy link
Contributor

Choose a reason for hiding this comment

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

can we use the typography which is available in Kubera-UI?

};

const onChangePage = (_: any, page: number) => {
console.log(page);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is console.log() really required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's required, since I need to use page and can't have an empty function. Otherwise linting errors/warnings occurs.

@saswatamcode saswatamcode requested a review from AVRahul October 29, 2020 12:56
@AVRahul AVRahul mentioned this pull request Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants