How to use the @paprika/helpers/lib/types.size.SMALL function in @paprika/helpers

To help you get started, we’ve selected a few @paprika/helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github acl-services / paprika / packages / DataTable / src / components / RowHeight / RowHeight.js View on Github external
export default function RowHeight(props) {
  const dispatch = useDispatch();
  const state = useDataTableState();
  const values = [size.XSMALL, size.SMALL, size.MEDIUM, size.LARGE];
  const heights = {
    [size.XSMALL]: 32,
    [size.SMALL]: 55,
    [size.MEDIUM]: 87,
    [size.LARGE]: 127,
  };

  // just want to fire this the first time
  React.useEffect(() => {
    if (typeof state.rowHeight === "undefined" || state.rowHeight === null) {
      const index = getIndexByValue(props.defaultHeight, values);
      dispatch({ type: "ROW_HEIGHT", payload: { index: 0, value: heights[values[index]] } || 0 });
    }
  }, []); // eslint-disable-line

  const handleClick = () => {