DropdownArrowIcon.tsx 954 B

1234567891011121314151617181920212223242526272829
  1. import React, { CSSProperties } from 'react';
  2. import { useTheme } from 'styled-components';
  3. interface Props {
  4. isOpen: boolean;
  5. style?: CSSProperties;
  6. color?: string;
  7. }
  8. const DropdownArrowIcon: React.FC<Props> = ({ isOpen }) => {
  9. const theme = useTheme();
  10. return (
  11. <svg
  12. width="10"
  13. height="5"
  14. viewBox="0 0 10 5"
  15. fill="currentColor"
  16. stroke="currentColor"
  17. xmlns="http://www.w3.org/2000/svg"
  18. color={theme.icons.dropdownArrowIcon}
  19. transform={isOpen ? 'rotate(180)' : ''}
  20. >
  21. <path d="M0.646447 0.146447C0.841709 -0.0488155 1.15829 -0.0488155 1.35355 0.146447L5 3.79289L8.64645 0.146447C8.84171 -0.0488155 9.15829 -0.0488155 9.35355 0.146447C9.54882 0.341709 9.54882 0.658291 9.35355 0.853553L5.35355 4.85355C5.15829 5.04882 4.84171 5.04882 4.64645 4.85355L0.646447 0.853553C0.451184 0.658291 0.451184 0.341709 0.646447 0.146447Z" />
  22. </svg>
  23. );
  24. };
  25. export default DropdownArrowIcon;