Button.tsx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import React from 'react';
  2. import styled from "styled-components";
  3. interface Props {
  4. disabled?: boolean
  5. children: React.ReactNode
  6. }
  7. const Button = ({children, disabled} : Props) => {
  8. return <ButtonWrapper disabled={disabled}>{children}</ButtonWrapper>
  9. }
  10. export default Button;
  11. const ButtonWrapper = styled.div`
  12. display: flex;
  13. flex-direction: row;
  14. align-items: center;
  15. justify-content: space-between;
  16. font-size: 13px;
  17. cursor: pointer;
  18. font-family: "Work Sans", sans-serif;
  19. color: white;
  20. font-weight: 500;
  21. padding: 10px;
  22. overflow: hidden;
  23. white-space: nowrap;
  24. text-overflow: ellipsis;
  25. box-shadow: 0 5px 8px 0px #00000010;
  26. cursor: ${(props: { disabled?: boolean }) =>
  27. props.disabled ? "not-allowed" : "pointer"};
  28. background: ${(props: { disabled?: boolean }) =>
  29. props.disabled ? "#aaaabbee" : "#616FEEcc"};
  30. :hover {
  31. background: ${(props: { disabled?: boolean }) =>
  32. props.disabled ? "" : "#505edddd"};
  33. }
  34. > i {
  35. color: white;
  36. width: 18px;
  37. height: 18px;
  38. font-weight: 600;
  39. font-size: 12px;
  40. border-radius: 20px;
  41. display: flex;
  42. align-items: center;
  43. margin-right: 5px;
  44. justify-content: center;
  45. }
  46. `;