mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-02 19:01:40 +00:00
fix set rating click on context menu (#900)
- star rating icon overriddes the pointer click event
This commit is contained in:
parent
262203b62d
commit
ec0e7256cb
1 changed files with 18 additions and 36 deletions
|
|
@ -97,6 +97,18 @@ const JELLYFIN_IGNORED_MENU_ITEMS: ContextMenuItemType[] = ['setRating', 'shareI
|
||||||
|
|
||||||
const utils = isElectron() ? window.electron.utils : null;
|
const utils = isElectron() ? window.electron.utils : null;
|
||||||
|
|
||||||
|
function RatingIcon({ rating }: { rating: number }) {
|
||||||
|
return (
|
||||||
|
<Rating
|
||||||
|
readOnly
|
||||||
|
style={{
|
||||||
|
pointerEvents: 'none',
|
||||||
|
}}
|
||||||
|
value={rating}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export interface ContextMenuProviderProps {
|
export interface ContextMenuProviderProps {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
}
|
}
|
||||||
|
|
@ -835,62 +847,32 @@ export const ContextMenuProvider = ({ children }: ContextMenuProviderProps) => {
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
id: 'zeroStar',
|
id: 'zeroStar',
|
||||||
label: (
|
label: <RatingIcon rating={0} />,
|
||||||
<Rating
|
|
||||||
readOnly
|
|
||||||
value={0}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
onClick: () => handleUpdateRating(0),
|
onClick: () => handleUpdateRating(0),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'oneStar',
|
id: 'oneStar',
|
||||||
label: (
|
label: <RatingIcon rating={1} />,
|
||||||
<Rating
|
|
||||||
readOnly
|
|
||||||
value={1}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
onClick: () => handleUpdateRating(1),
|
onClick: () => handleUpdateRating(1),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'twoStar',
|
id: 'twoStar',
|
||||||
label: (
|
label: <RatingIcon rating={2} />,
|
||||||
<Rating
|
|
||||||
readOnly
|
|
||||||
value={2}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
onClick: () => handleUpdateRating(2),
|
onClick: () => handleUpdateRating(2),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'threeStar',
|
id: 'threeStar',
|
||||||
label: (
|
label: <RatingIcon rating={3} />,
|
||||||
<Rating
|
|
||||||
readOnly
|
|
||||||
value={3}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
onClick: () => handleUpdateRating(3),
|
onClick: () => handleUpdateRating(3),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'fourStar',
|
id: 'fourStar',
|
||||||
label: (
|
label: <RatingIcon rating={4} />,
|
||||||
<Rating
|
|
||||||
readOnly
|
|
||||||
value={4}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
onClick: () => handleUpdateRating(4),
|
onClick: () => handleUpdateRating(4),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'fiveStar',
|
id: 'fiveStar',
|
||||||
label: (
|
label: <RatingIcon rating={5} />,
|
||||||
<Rating
|
|
||||||
readOnly
|
|
||||||
value={5}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
onClick: () => handleUpdateRating(5),
|
onClick: () => handleUpdateRating(5),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue