This commit is contained in:
@@ -126,7 +126,7 @@ export function ThemePlaylistStack({
|
||||
);
|
||||
}
|
||||
}, [indexOffset]);
|
||||
|
||||
|
||||
return (
|
||||
<Popover
|
||||
withArrow
|
||||
@@ -136,166 +136,167 @@ export function ThemePlaylistStack({
|
||||
transitionProps={{ duration: 200, timingFunction: 'ease' }}
|
||||
>
|
||||
<Popover.Target>
|
||||
<Reflection reflectionStart={75} reflectionEnd={100} shadowOpacity={0.25}>
|
||||
<Stack
|
||||
gap={0}
|
||||
w={300}
|
||||
pos={'relative'}
|
||||
onMouseEnter={() => setHover(true)}
|
||||
onMouseLeave={() => setHover(false)}
|
||||
style={{
|
||||
background: hover
|
||||
? 'radial-gradient(var(--mantine-color-search-0), transparent)'
|
||||
: undefined,
|
||||
cursor: 'pointer',
|
||||
borderRadius: '100%',
|
||||
}}
|
||||
onClick={() => {
|
||||
setCurrentThemePlaylist(cardPlaylist.name);
|
||||
setThemeName('random');
|
||||
}}
|
||||
>
|
||||
{modalOpened && (
|
||||
<DeleteItemModal
|
||||
modalOpened={modalOpened}
|
||||
handleClose={closeModal}
|
||||
handleDelete={() => handleDelete(cardPlaylist, 'api/themePlaylists')}
|
||||
title='Delete Theme Playlist'
|
||||
body={
|
||||
<Stack gap={0} w={'100%'} h={'150px'} align='center'>
|
||||
<Text>Are you sure you want to delete this Theme Playlist?</Text>
|
||||
<Text
|
||||
className={textClasses.deleteItem}
|
||||
classNames={textClasses}
|
||||
>{`"${cardPlaylist.name}"`}</Text>
|
||||
<Text c='red'>This action cannot be undone!</Text>
|
||||
</Stack>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
<Box>
|
||||
<Reflection reflectionStart={75} reflectionEnd={100} shadowOpacity={0.25}>
|
||||
<Stack
|
||||
w='100%'
|
||||
h='200px'
|
||||
justify='start'
|
||||
pos='relative'
|
||||
gap={0}
|
||||
w={300}
|
||||
pos={'relative'}
|
||||
onMouseEnter={() => setHover(true)}
|
||||
onMouseLeave={() => setHover(false)}
|
||||
style={{
|
||||
overflow: 'hidden',
|
||||
transition: 'all 0.5s ease-in-out',
|
||||
overscrollBehavior: 'contain',
|
||||
background: hover
|
||||
? 'radial-gradient(var(--mantine-color-search-0), transparent)'
|
||||
: undefined,
|
||||
cursor: 'pointer',
|
||||
borderRadius: '100%',
|
||||
}}
|
||||
onClick={() => {
|
||||
setCurrentThemePlaylist(cardPlaylist.name);
|
||||
setThemeName('random');
|
||||
}}
|
||||
onWheel={handleMouseWheel}
|
||||
>
|
||||
{cardPlaylist?.name === 'Time of Day' ? (
|
||||
<>
|
||||
<Parallax
|
||||
{...presentationProps}
|
||||
style={{ position: 'absolute', top: 16 * 1, zIndex: 3 }}
|
||||
>
|
||||
<ThemeCardPreview
|
||||
cardTheme={
|
||||
allThemes.find(
|
||||
(theme: Theme) => theme.id === Number(themeList[0]),
|
||||
) || missingTheme
|
||||
}
|
||||
/>
|
||||
</Parallax>
|
||||
<Parallax
|
||||
{...presentationProps}
|
||||
style={{ position: 'absolute', top: 16 * 2, zIndex: 2 }}
|
||||
>
|
||||
<ThemeCardPreview
|
||||
cardTheme={
|
||||
allThemes.find(
|
||||
(theme: Theme) => theme.id === Number(themeList[1]),
|
||||
) || missingTheme
|
||||
}
|
||||
/>
|
||||
</Parallax>
|
||||
<Parallax
|
||||
{...presentationProps}
|
||||
style={{ position: 'absolute', top: 16 * 3, zIndex: 1 }}
|
||||
>
|
||||
<ThemeCardPreview
|
||||
cardTheme={
|
||||
allThemes.find(
|
||||
(theme: Theme) => theme.id === Number(themeList[2]),
|
||||
) || missingTheme
|
||||
}
|
||||
/>
|
||||
</Parallax>
|
||||
<Parallax
|
||||
{...presentationProps}
|
||||
style={{ position: 'absolute', top: 16 * 4, zIndex: 0 }}
|
||||
>
|
||||
<ThemeCardPreview
|
||||
cardTheme={
|
||||
allThemes.find(
|
||||
(theme: Theme) => theme.id === Number(themeList[3]),
|
||||
) || missingTheme
|
||||
}
|
||||
/>
|
||||
</Parallax>
|
||||
</>
|
||||
) : (
|
||||
items
|
||||
{modalOpened && (
|
||||
<DeleteItemModal
|
||||
modalOpened={modalOpened}
|
||||
handleClose={closeModal}
|
||||
handleDelete={() => handleDelete(cardPlaylist, 'api/themePlaylists')}
|
||||
title='Delete Theme Playlist'
|
||||
body={
|
||||
<Stack gap={0} w={'100%'} h={'150px'} align='center'>
|
||||
<Text>Are you sure you want to delete this Theme Playlist?</Text>
|
||||
<Text
|
||||
className={textClasses.deleteItem}
|
||||
classNames={textClasses}
|
||||
>{`"${cardPlaylist.name}"`}</Text>
|
||||
<Text c='red'>This action cannot be undone!</Text>
|
||||
</Stack>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</Stack>
|
||||
|
||||
<Group
|
||||
w={'100%'}
|
||||
pos={'absolute'}
|
||||
justify='space-between'
|
||||
bottom={0}
|
||||
style={{ zIndex: 1000 }}
|
||||
>
|
||||
<Text
|
||||
<Stack
|
||||
w='100%'
|
||||
h='200px'
|
||||
justify='start'
|
||||
pos='relative'
|
||||
gap={0}
|
||||
style={{
|
||||
paddingRight: '.25rem',
|
||||
paddingLeft: '.25rem',
|
||||
backgroundColor: 'var(--mantine-color-border-0)',
|
||||
borderRadius: '4px',
|
||||
color: 'var(--mantine-color-primary-0)',
|
||||
overflow: 'hidden',
|
||||
transition: 'all 0.5s ease-in-out',
|
||||
overscrollBehavior: 'contain',
|
||||
}}
|
||||
onWheel={handleMouseWheel}
|
||||
>
|
||||
{cardPlaylist.name}
|
||||
</Text>
|
||||
<Group gap={0}>
|
||||
{!defaultLists.includes(cardPlaylist.name) && (
|
||||
<ActionIcon
|
||||
style={{
|
||||
paddingRight: '.25rem',
|
||||
paddingLeft: '.25rem',
|
||||
backgroundColor: 'var(--mantine-color-border-0)',
|
||||
borderRadius: '4px',
|
||||
color: 'var(--mantine-color-background-0)',
|
||||
}}
|
||||
onClick={() => {
|
||||
handleOpen(cardPlaylist);
|
||||
}}
|
||||
>
|
||||
<FiEdit />
|
||||
</ActionIcon>
|
||||
{cardPlaylist?.name === 'Time of Day' ? (
|
||||
<>
|
||||
<Parallax
|
||||
{...presentationProps}
|
||||
style={{ position: 'absolute', top: 16 * 1, zIndex: 3 }}
|
||||
>
|
||||
<ThemeCardPreview
|
||||
cardTheme={
|
||||
allThemes.find(
|
||||
(theme: Theme) => theme.id === Number(themeList[0]),
|
||||
) || missingTheme
|
||||
}
|
||||
/>
|
||||
</Parallax>
|
||||
<Parallax
|
||||
{...presentationProps}
|
||||
style={{ position: 'absolute', top: 16 * 2, zIndex: 2 }}
|
||||
>
|
||||
<ThemeCardPreview
|
||||
cardTheme={
|
||||
allThemes.find(
|
||||
(theme: Theme) => theme.id === Number(themeList[1]),
|
||||
) || missingTheme
|
||||
}
|
||||
/>
|
||||
</Parallax>
|
||||
<Parallax
|
||||
{...presentationProps}
|
||||
style={{ position: 'absolute', top: 16 * 3, zIndex: 1 }}
|
||||
>
|
||||
<ThemeCardPreview
|
||||
cardTheme={
|
||||
allThemes.find(
|
||||
(theme: Theme) => theme.id === Number(themeList[2]),
|
||||
) || missingTheme
|
||||
}
|
||||
/>
|
||||
</Parallax>
|
||||
<Parallax
|
||||
{...presentationProps}
|
||||
style={{ position: 'absolute', top: 16 * 4, zIndex: 0 }}
|
||||
>
|
||||
<ThemeCardPreview
|
||||
cardTheme={
|
||||
allThemes.find(
|
||||
(theme: Theme) => theme.id === Number(themeList[3]),
|
||||
) || missingTheme
|
||||
}
|
||||
/>
|
||||
</Parallax>
|
||||
</>
|
||||
) : (
|
||||
items
|
||||
)}
|
||||
{cardPlaylist.default === 0 && (
|
||||
<ActionIcon
|
||||
color='red'
|
||||
style={{
|
||||
paddingRight: '.25rem',
|
||||
paddingLeft: '.25rem',
|
||||
borderRadius: '4px',
|
||||
}}
|
||||
onClick={() => {
|
||||
openModal();
|
||||
}}
|
||||
>
|
||||
<FiTrash color='black' />
|
||||
</ActionIcon>
|
||||
)}
|
||||
</Group>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Reflection>
|
||||
<Group
|
||||
w={'100%'}
|
||||
pos={'absolute'}
|
||||
justify='space-between'
|
||||
bottom={0}
|
||||
style={{ zIndex: 1000 }}
|
||||
>
|
||||
<Text
|
||||
style={{
|
||||
paddingRight: '.25rem',
|
||||
paddingLeft: '.25rem',
|
||||
backgroundColor: 'var(--mantine-color-border-0)',
|
||||
borderRadius: '4px',
|
||||
color: 'var(--mantine-color-primary-0)',
|
||||
}}
|
||||
>
|
||||
{cardPlaylist.name}
|
||||
</Text>
|
||||
<Group gap={0}>
|
||||
{!defaultLists.includes(cardPlaylist.name) && (
|
||||
<ActionIcon
|
||||
style={{
|
||||
paddingRight: '.25rem',
|
||||
paddingLeft: '.25rem',
|
||||
backgroundColor: 'var(--mantine-color-border-0)',
|
||||
borderRadius: '4px',
|
||||
color: 'var(--mantine-color-background-0)',
|
||||
}}
|
||||
onClick={() => {
|
||||
handleOpen(cardPlaylist);
|
||||
}}
|
||||
>
|
||||
<FiEdit />
|
||||
</ActionIcon>
|
||||
)}
|
||||
{cardPlaylist.default === 0 && (
|
||||
<ActionIcon
|
||||
color='red'
|
||||
style={{
|
||||
paddingRight: '.25rem',
|
||||
paddingLeft: '.25rem',
|
||||
borderRadius: '4px',
|
||||
}}
|
||||
onClick={() => {
|
||||
openModal();
|
||||
}}
|
||||
>
|
||||
<FiTrash color='black' />
|
||||
</ActionIcon>
|
||||
)}
|
||||
</Group>
|
||||
</Stack>
|
||||
</Reflection>
|
||||
</Group>
|
||||
</Box>
|
||||
</Popover.Target>
|
||||
<Popover.Dropdown
|
||||
bg={'var(--mantine-color-primary-0)'}
|
||||
|
||||
Reference in New Issue
Block a user