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

46 lines
972 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)`
2023-07-01 19:10:05 -07:00
display: flex;
align-items: center;
justify-content: center;
background-color: var(--btn-filled-bg);
border: none;
border-radius: 50%;
opacity: 0.8;
2023-03-09 18:10:27 -08:00
2023-07-01 19:10:05 -07:00
svg {
fill: var(--btn-filled-fg);
}
2023-03-09 18:10:27 -08:00
2023-07-01 19:10:05 -07:00
&:hover {
background-color: var(--btn-filled-bg-hover);
transform: scale(1.1);
2023-03-09 18:10:27 -08:00
2023-07-01 19:10:05 -07:00
svg {
fill: var(--btn-filled-fg-hover);
}
2023-03-09 18:10:27 -08:00
}
2023-07-01 19:10:05 -07:00
&:active {
transform: scale(0.95);
}
2023-03-09 18:10:27 -08:00
2023-07-01 19:10:05 -07:00
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) => {
2023-07-01 19:10:05 -07:00
return (
<MotionButton
{...props}
h="45px"
w="45px"
>
<RiPlayFill size={20} />
</MotionButton>
);
};