All files / src/components/music RollChannelGrid.tsx

0% Statements 0/8
100% Branches 0/0
0% Functions 0/2
0% Lines 0/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54                                                                                                           
import React from "react";
import styled, { css } from "styled-components";
 
interface RollChannelGridProps {
  cellSize: number;
}
 
interface WrapperProps {
  $rows: number;
  $cols: number;
  $size: number;
}
 
const Wrapper = styled.div<WrapperProps>`
  position: absolute;
  top: 0;
 
  ${(props) => css`
    margin: 0 ${3 * props.$size}px ${2 * props.$size}px 10px;
    width: ${props.$cols * props.$size}px;
    height: ${props.$rows * props.$size}px;
    background-image: linear-gradient(
        90deg,
        ${props.theme.colors.tracker.rollCell.border} 1px,
        transparent 1px
      ),
      linear-gradient(
        ${props.theme.colors.tracker.rollCell.border} 1px,
        transparent 1px
      ),
      linear-gradient(
        90deg,
        ${props.theme.colors.tracker.rollCell.border} 2px,
        transparent 1px
      ),
      linear-gradient(
        ${props.theme.colors.tracker.rollCell.border} 2px,
        transparent 1px
      );
    border-bottom: 1px solid ${props.theme.colors.tracker.rollCell.border};
    border-right: 2px solid ${props.theme.colors.tracker.rollCell.border};
    background-size: ${props.$size}px ${props.$size}px,
      ${props.$size}px ${props.$size}px,
      ${props.$size * 8}px ${props.$size * 12}px,
      ${props.$size * 8}px ${props.$size * 12}px;
  `}
`;
 
export const RollChannelGridFwd = ({ cellSize }: RollChannelGridProps) => {
  return <Wrapper $rows={12 * 6} $cols={64} $size={cellSize}></Wrapper>;
};
 
export const RollChannelGrid = React.memo(RollChannelGridFwd);