How to use the @airbnb/lunar/src/components/DataTable/helpers.getRowColor function in @airbnb/lunar

To help you get started, we’ve selected a few @airbnb/lunar 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 airbnb / lunar / .storybook / components / DataTable / DataTableRenderers / ColSpanRenderer.jsx View on Github external
export default function ColspanRenderer({ row, zebra, theme }) {
  const { rowData, rowIndex } = row;
  const { data, metadata } = rowData;
  const color = getRowColor(rowData, rowIndex, zebra, theme);
  const colSpanStyle = {
    width: '100%',
    background: color,
    zIndex: 100,
    position: 'absolute',
    height: '100%',
    left: 0,
    top: 0,
    alignItems: 'center',
    display: 'flex',
  };

  return (
    metadata.colSpanKey && (
      <div style="{colSpanStyle}">
        </div>