1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-20 18:02:44 +01:00

New: Increase clickable area of movie select in poster/overview

This commit is contained in:
Qstick 2023-04-22 16:12:43 -05:00
parent 1bc299fd35
commit 7501fe095e
3 changed files with 39 additions and 33 deletions

View File

@ -1,36 +1,38 @@
.checkButton {
position: absolute;
top: 0;
left: 0;
z-index: 3;
width: 36px;
height: 36px;
}
.checkContainer {
position: absolute;
top: 10px;
left: 10px;
z-index: 3;
width: 18px;
height: 18px;
top: 8px;
left: 8px;
width: 20px;
height: 20px;
border-radius: 50%;
background-color: var(--defaultColor);
}
.icon {
position: absolute;
top: -1px;
left: -1px;
}
.selected {
composes: icon;
color: var(--sonarrBlue);
&:hover {
color: var(--white);
}
color: var(--primaryColor);
}
.unselected {
composes: icon;
color: var(--white);
}
.checkButton {
&:hover {
color: var(--sonarrBlue);
.selected {
color: var(--white);
}
.unselected {
color: var(--primaryColor);
}
}
}

View File

@ -1,8 +1,8 @@
// This file is automatically generated.
// Please do not change this file!
interface CssExports {
'checkButton': string;
'checkContainer': string;
'icon': string;
'selected': string;
'unselected': string;
}

View File

@ -1,6 +1,7 @@
import React, { useCallback } from 'react';
import React, { SyntheticEvent, useCallback } from 'react';
import { SelectActionType, useSelect } from 'App/SelectContext';
import IconButton from 'Components/Link/IconButton';
import Icon from 'Components/Icon';
import Link from 'Components/Link/Link';
import { icons } from 'Helpers/Props';
import styles from './MovieIndexPosterSelect.css';
@ -14,8 +15,9 @@ function MovieIndexPosterSelect(props: MovieIndexPosterSelectProps) {
const isSelected = selectState.selectedState[movieId];
const onSelectPress = useCallback(
(event) => {
const shiftKey = event.nativeEvent.shiftKey;
(event: SyntheticEvent) => {
const nativeEvent = event.nativeEvent as PointerEvent;
const shiftKey = nativeEvent.shiftKey;
selectDispatch({
type: SelectActionType.ToggleSelected,
@ -28,13 +30,15 @@ function MovieIndexPosterSelect(props: MovieIndexPosterSelectProps) {
);
return (
<IconButton
className={styles.checkContainer}
iconClassName={isSelected ? styles.selected : styles.unselected}
<Link className={styles.checkButton} onPress={onSelectPress}>
<span className={styles.checkContainer}>
<Icon
className={isSelected ? styles.selected : styles.unselected}
name={isSelected ? icons.CHECK_CIRCLE : icons.CIRCLE_OUTLINE}
size={20}
onPress={onSelectPress}
/>
</span>
</Link>
);
}