canonical / canonical/react-components

[ModularTable] Add prop for plugin passthrough

Open
#440 5 comments 0 reactions 0 assignees View on GitHub
P3 Needs decision
Dominant language
TypeScript
Stars
151
Forks
74
Avg merge
1d 2h
Merged PRs (30d)
11

Description

React Table `useTable` takes `n` arguments after the first for plugins.

```js
const instance = useTable(
{
data: [...],
columns: [...],
},
useGroupBy,
useFilters,
useSortBy,
useExpanded,
usePagination
)
```

In order to implement the grouping in the [Juju Dashboards](https://github.com/canonical-web-and-design/jaas-dashboard) Action Logs UI it looks like using `useExpanded` with the default be expanded might be the best way to implement this functionality. To this end I'd like to expand [ModularTable](https://github.com/canonical-web-and-design/react-components/blob/master/src/components/ModularTable/ModularTable.tsx#L31) to take a `plugins` prop to be expanded out when calling `useTable`.

![III Action logs - Default view](https://user-images.githubusercontent.com/532033/114790235-a3b64a80-9d41-11eb-9c6d-1a18c4ae92b1.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.