Add buttons for deleting downloaded tracks from playlist or album

This commit is contained in:
Lei Nelissen
2022-01-02 17:46:50 +01:00
parent db1c9d8af9
commit 95a008d8af
7 changed files with 52 additions and 8 deletions

View File

@@ -20,6 +20,10 @@ const BaseButton = styled.Pressable`
align-items: center;
justify-content: center;
flex-grow: 1;
${(props) => props.disabled && css`
opacity: 0.25;
`}
`;
const ButtonText = styled.Text<{ active?: boolean }>`
@@ -32,7 +36,7 @@ const ButtonText = styled.Text<{ active?: boolean }>`
`;
const Button = React.forwardRef<View, ButtonProps>(function Button(props, ref) {
const { icon: Icon, title, ...rest } = props;
const { icon: Icon, title, disabled, ...rest } = props;
const defaultStyles = useDefaultStyles();
const [isPressed, setPressed] = useState(false);
const handlePressIn = useCallback(() => setPressed(true), []);
@@ -41,6 +45,7 @@ const Button = React.forwardRef<View, ButtonProps>(function Button(props, ref) {
return (
<BaseButton
{...rest}
disabled={disabled}
ref={ref}
onPressIn={handlePressIn}
onPressOut={handlePressOut}