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

Table #31

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

Table #31

wants to merge 9 commits into from

Conversation

a-saran
Copy link

@a-saran a-saran commented May 4, 2020

No description provided.

docs/src/theme.js Outdated Show resolved Hide resolved
docs/src/theme.js Outdated Show resolved Hide resolved
Copy link
Author

@a-saran a-saran left a comment

Choose a reason for hiding this comment

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

  1. there is no icon prop to change the icon (sort)
  2. please use constant spacing and lint everywhere
  3. add some style props like
    hoverable
    stripped
    bordered
    borderless
  4. additional(in future):
    Scorable table
    searching
    pagination

docs/src/theme.js Outdated Show resolved Hide resolved
src/components/table/index.js Outdated Show resolved Hide resolved
@ashwinKumar0505 ashwinKumar0505 added the ready-for-review PR that is ready for review label May 5, 2020
src/components/table/index.js Outdated Show resolved Hide resolved
src/components/table/index.js Outdated Show resolved Hide resolved
src/components/table/index.js Outdated Show resolved Hide resolved
src/components/table/index.js Outdated Show resolved Hide resolved
src/components/table/index.js Outdated Show resolved Hide resolved
src/components/table/index.js Outdated Show resolved Hide resolved
src/components/table/index.js Outdated Show resolved Hide resolved
src/components/table/index.js Outdated Show resolved Hide resolved
src/components/table/index.js Outdated Show resolved Hide resolved
@rishichawda
Copy link

In essence, the sort function can be something like this :

const sort = (key, index, desc=false) => {
    const newObtainedDataSource = [...obtainedDataSource];
    newObtainedDataSource.sort((a, b) => {
        const value1 = String(a[key]).toLowerCase();
        const value2 = String(b[key]).toLowerCase();
        if (value1 > value2) return desc ? 1 : -1;
        if (value1 < value2) return desc ? -1 : 1;
        return 0;
      });
    setObtainedDataSource(newObtainedDataSource);
    const newSortIndex = [...ascendingOrder];
    newSortIndex[index] = !newSortIndex[index];
    setAscendingOrder(newSortIndex);
  };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-review PR that is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants