Shift3 / boilerplate-client-react

The Bitwise standard starting point for new React web projects.
7 stars 10 forks source link

Makes the DataTable responsive #694

Closed joshwingreene closed 1 year ago

joshwingreene commented 1 year ago

Changes

  1. The DataTable will now hide specific columns based on the current breakpoint. A useViewport hook and relevant models were added in order to support this functionality. Developers must set the initial column visibility state in the table data hooks, ex. useUserTableData.tsx. A vertical ellipsis dropdown button has been added to the right of the headers of the DataTable. When the "Edit Columns" option is clicked, a modal will appear that allows the user to change which columns should be shown or be hidden based on the current breakpoint.
  2. Adds an initialColumnBreakpointVisibility prop to the DataTable in order to support the above functionality
  3. Adds a CustomToggle component, which is used for the aforementioned vertical ellipsis dropdown button.
  4. Adds an OverrideTableStyling styled component in order to ensure that the background of the Edit Columns' dropdown menu doesn't have a transparent background.
  5. Adds a TableModalStyling styled component for theming purposes
  6. Makes the table actions appear via a dropdown menu instead of that animation that was used in the past

Purpose

Learning

Note

Testing Steps

  1. Pull in the changes to your local copy of this branch and run it alongside the dj_starter_demo repo.
  2. Try changing the column visibility states using the "Edit Columns" option and then see how the DataTable responds when you manipulate the width of the browser

Demo

https://user-images.githubusercontent.com/2876874/211926026-cd325301-2963-4a7c-aeb8-0f3e2f0c6e46.mov

joshwingreene commented 1 year ago

Add responsiveness to Tables

DropsOfSerenity commented 1 year ago

@joshwingreene I'm working on giving this a larger review, it's a bigger PR so it'll take me a bit, I'll let you know when I've got this reviewed for you.

DropsOfSerenity commented 1 year ago

closing in favor of #719