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

Use permissions table to show element #1375

Open
pyphilia opened this issue Jul 24, 2024 · 0 comments
Open

Use permissions table to show element #1375

pyphilia opened this issue Jul 24, 2024 · 0 comments

Comments

@pyphilia
Copy link
Contributor

          Maybe we could simplify a little bit the view by using a wrapper or a utils functions ? I'm not fan of the name I proposed ^^ Also, we could pass the component to display in the case the condition is false (return null by default).
        <ContentFilter condition={canWrite}>
          <HideButton key="hide" type={ActionButton.MENU_ITEM} item={item} />,
          <PinButton key="pin" type={ActionButton.MENU_ITEM} item={item} />,
        </ContentFilter>

        <ContentFilter condition={canWrite && item.type !== ItemType.FOLDER}>
          <CollapseButton
            key="collapse"
            type={ActionButton.MENU_ITEM}
            item={item}
          />
        </ContentFilter>

Originally posted by @ReidyT in #1354 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant