ingred-ui icon indicating copy to clipboard operation
ingred-ui copied to clipboard

内包しているコンポーネントにもPropsを当てられるように

Open youchann opened this issue 4 years ago • 1 comments

例えばこんな感じ

const FloatingTip: React.FunctionComponent<FloatingTipProps> = ({
  baseElement,
  positionPriority = ["right-start"],
  offset = [0, 10],
  isOpen,
  onClose,
+ popoverProps,
  children,
}) => {
  const theme = useTheme();
  return (
    <Popover
      isOpen={isOpen}
      baseElement={baseElement}
      positionPriority={positionPriority}
      offset={offset}
+    {...popoverProps}
    >
      <ClickAwayListener onClickAway={onClose}>
        <Styled.Container>
          <Styled.ContentWrapper>{children}</Styled.ContentWrapper>
          <Styled.IconWrapper onClick={onClose}>
            <Icon name="close" color={theme.palette.black} />
          </Styled.IconWrapper>
        </Styled.Container>
      </ClickAwayListener>
    </Popover>
  );
};

これができればデザイン側の細かい要望に対して、ライブラリの修正なしにカバーできるケースが増える。

youchann avatar Sep 28 '20 12:09 youchann

全体を通してPropsの設計に統一がない(内包しているコンポーネントのpropsいじれるところもあればいじれないところもある)ので、いい感じにしたい

youchann avatar Sep 28 '20 12:09 youchann

ref: #1090

penicillin0 avatar Jan 09 '23 13:01 penicillin0

TODO

  • [x] FloatingTip以外に内包コンポーネントのためのPropsを露出させたいものがないか洗い出す
  • [x] それぞれ対応する

penicillin0 avatar Feb 20 '23 16:02 penicillin0

  • Popover>Modal
  • ContextMenu>ActionButton
  • FloatingTip>Popover
  • Menu>Popover

penicillin0 avatar Mar 07 '23 00:03 penicillin0