feishin/src/renderer/features/shared/components/play-button.tsx

46 lines
872 B
TypeScript
Raw Normal View History

2023-03-09 18:10:27 -08:00
import { UnstyledButton } from '@mantine/core';
import { RiPlayFill } from 'react-icons/ri';
import styled from 'styled-components';
2023-03-09 18:10:27 -08:00
const MotionButton = styled(UnstyledButton)`
2022-12-29 19:23:07 -08:00
display: flex;
align-items: center;
justify-content: center;
2023-03-28 16:13:18 -07:00
background-color: var(--btn-filled-bg);
2022-12-29 19:23:07 -08:00
border: none;
border-radius: 50%;
2022-12-29 19:23:07 -08:00
opacity: 0.8;
2023-03-09 18:10:27 -08:00
svg {
2023-03-28 16:13:18 -07:00
fill: var(--btn-filled-fg);
2023-03-09 18:10:27 -08:00
}
&:hover {
2023-03-28 16:13:18 -07:00
background-color: var(--btn-filled-bg-hover);
2023-03-09 18:10:27 -08:00
transform: scale(1.1);
svg {
2023-03-28 16:13:18 -07:00
fill: var(--btn-filled-fg-hover);
2023-03-09 18:10:27 -08:00
}
}
&:active {
transform: scale(0.95);
}
transition: background-color 0.2s ease-in-out;
transition: transform 0.2s ease-in-out;
`;
2023-03-09 18:10:27 -08:00
export const PlayButton = ({ ...props }: any) => {
return (
<MotionButton
2023-03-09 18:10:27 -08:00
{...props}
2023-03-29 00:31:32 -07:00
h="45px"
w="45px"
>
2022-12-29 19:23:07 -08:00
<RiPlayFill size={20} />
</MotionButton>
);
};