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

feat(table): add option to control display count of avatars (#416) #417

Merged
merged 3 commits into from
Dec 19, 2023

Conversation

kiaking
Copy link
Member

@kiaking kiaking commented Dec 19, 2023

Now we can control how many avatars do we wanna show on table cell. We can also set count to 0 to hide avatars or names.

const table = useTable({
  columns: {
    authors: {
      label: 'Authors',
      cell: (authors) => ({
        type: 'avatars',
        avatars: authors,
        avatarCount: 5,
        nameCount: 3
      })
    }
  }
})
Screenshot 2023-12-19 at 16 35 43

@kiaking kiaking added the enhancement New feature or request label Dec 19, 2023
@kiaking kiaking self-assigned this Dec 19, 2023
Copy link

netlify bot commented Dec 19, 2023

Deploy Preview for sefirot-docs ready!

Name Link
🔨 Latest commit b8fb9a1
🔍 Latest deploy log https://app.netlify.com/sites/sefirot-docs/deploys/6581569b034eeb00089d33f4
😎 Deploy Preview https://deploy-preview-417--sefirot-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Dec 19, 2023

Deploy Preview for sefirot-story ready!

Name Link
🔨 Latest commit b8fb9a1
🔍 Latest deploy log https://app.netlify.com/sites/sefirot-story/deploys/6581569b2f5e7b0008f69757
😎 Deploy Preview https://deploy-preview-417--sefirot-story.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@brc-dd
Copy link
Member

brc-dd commented Dec 19, 2023

LGTM. The empty box is looking weird though 👀 Can we do something like this instead?

image

(change that margin-left to right and z-index thing? and add count there in box?)

Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
Copy link
Contributor

@NozomuIkuta NozomuIkuta left a comment

Choose a reason for hiding this comment

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

LGTM.

By the way, I agree with @brc-dd's suggestion.

@kiaking
Copy link
Member Author

kiaking commented Dec 19, 2023

Yeah this might work. Font size have to be quite small but I guess it's readable 🤔

Screenshot 2023-12-19 at 17 20 30

In this case, maybe we should change the name suffix to John, and more instead of John, +2? Or Jonh ...

@kiaking
Copy link
Member Author

kiaking commented Dec 19, 2023

I think this would work. Looks a bit like it got trimmed... but 🤔 What do you think,

Screenshot 2023-12-19 at 17 32 29

@brc-dd
Copy link
Member

brc-dd commented Dec 19, 2023

yeah looks better I guess

@brc-dd
Copy link
Member

brc-dd commented Dec 19, 2023

We can play around with margins if you want it more compact. For example, this is what github's look like (-11px margin for 20px img):

image

It hides almost whole avatar though 😅

@kiaking
Copy link
Member Author

kiaking commented Dec 19, 2023

Haha, yeah this is tough one. Also GitHub avatars keep squashing as numbers grow. Somewhat interesting way to handle the "+1" part I think 👀

I guess we can keep it as-is. I think it is more important to show the full avatars so that we can recognize who those are 😳

@brc-dd
Copy link
Member

brc-dd commented Dec 19, 2023

sounds good.

@kiaking kiaking merged commit 303f377 into main Dec 19, 2023
9 checks passed
@kiaking kiaking deleted the 416-table-avatar-count-control branch December 19, 2023 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Table] Add feature to control how many avatars should be shown in STableCellAvatars
3 participants