Improvements to playlist stacks
All checks were successful
Deploy to production / build (push) Successful in 18s
All checks were successful
Deploy to production / build (push) Successful in 18s
This commit is contained in:
@@ -116,7 +116,7 @@ sudo pm2 start server.cjs
|
|||||||
### TODO
|
### TODO
|
||||||
|
|
||||||
- Mobile improvements
|
- Mobile improvements
|
||||||
- New Carosel on weather description
|
- New Carousel on weather description
|
||||||
- Updates to weather modal
|
- Updates to weather modal
|
||||||
- Add mantine-led for monitoring status (https://gfazioli.github.io/mantine-led)
|
- Add mantine-led for monitoring status (https://gfazioli.github.io/mantine-led)
|
||||||
- Explore https://gfazioli.github.io/mantine-scene/
|
- Explore https://gfazioli.github.io/mantine-scene/
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ export function ThemePlaylistStack({
|
|||||||
const { setThemeName, setCurrentThemePlaylist, handleDelete, currentUser } =
|
const { setThemeName, setCurrentThemePlaylist, handleDelete, currentUser } =
|
||||||
useCommonHooks();
|
useCommonHooks();
|
||||||
const [indexOffset, setIndexOffset] = useState(0);
|
const [indexOffset, setIndexOffset] = useState(0);
|
||||||
|
const [movingIndex, setMovingIndex] = useState(0);
|
||||||
const missingTheme = {
|
const missingTheme = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
name: 'default',
|
name: 'default',
|
||||||
@@ -95,7 +96,7 @@ export function ThemePlaylistStack({
|
|||||||
zIndex: themeList.length - spot,
|
zIndex: themeList.length - spot,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Parallax {...presentationProps}>
|
<Parallax {...(!(hover && spot === 0) ? presentationProps : { disabled: true })}>
|
||||||
<ThemeCardPreview key={theme.id} cardTheme={theme} />
|
<ThemeCardPreview key={theme.id} cardTheme={theme} />
|
||||||
</Parallax>
|
</Parallax>
|
||||||
</Box>
|
</Box>
|
||||||
@@ -110,17 +111,20 @@ export function ThemePlaylistStack({
|
|||||||
) || missingTheme,
|
) || missingTheme,
|
||||||
);
|
);
|
||||||
} else if (indexOffset > 0 && indexOffset < themeList.length) {
|
} else if (indexOffset > 0 && indexOffset < themeList.length) {
|
||||||
|
setMovingIndex(themeList.length - indexOffset);
|
||||||
setTopTheme(
|
setTopTheme(
|
||||||
allThemes.find(
|
allThemes.find(
|
||||||
(theme: Theme) => theme.id === themeList[themeList.length - indexOffset],
|
(theme: Theme) => theme.id === themeList[themeList.length - indexOffset],
|
||||||
) || missingTheme,
|
) || missingTheme,
|
||||||
);
|
);
|
||||||
} else if (indexOffset < 0 && Math.abs(indexOffset) < themeList.length) {
|
} else if (indexOffset < 0 && Math.abs(indexOffset) < themeList.length) {
|
||||||
|
setMovingIndex(Math.abs(indexOffset));
|
||||||
setTopTheme(
|
setTopTheme(
|
||||||
allThemes.find((theme: Theme) => theme.id === themeList[Math.abs(indexOffset)]) ||
|
allThemes.find((theme: Theme) => theme.id === themeList[Math.abs(indexOffset)]) ||
|
||||||
missingTheme,
|
missingTheme,
|
||||||
);
|
);
|
||||||
} else if (indexOffset === 0) {
|
} else if (indexOffset === 0) {
|
||||||
|
setMovingIndex(0);
|
||||||
setTopTheme(
|
setTopTheme(
|
||||||
allThemes.find((theme: Theme) => theme.id === themeList[0]) || missingTheme,
|
allThemes.find((theme: Theme) => theme.id === themeList[0]) || missingTheme,
|
||||||
);
|
);
|
||||||
@@ -239,7 +243,7 @@ export function ThemePlaylistStack({
|
|||||||
</Parallax>
|
</Parallax>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
items
|
items.slice(movingIndex, movingIndex + 8)
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -251,17 +255,34 @@ export function ThemePlaylistStack({
|
|||||||
bottom={0}
|
bottom={0}
|
||||||
style={{ zIndex: 1000 }}
|
style={{ zIndex: 1000 }}
|
||||||
>
|
>
|
||||||
<Text
|
<Group gap={2}>
|
||||||
style={{
|
<Text
|
||||||
paddingRight: '.25rem',
|
style={{
|
||||||
paddingLeft: '.25rem',
|
paddingRight: '.25rem',
|
||||||
backgroundColor: 'var(--mantine-color-border-0)',
|
paddingLeft: '.25rem',
|
||||||
borderRadius: '4px',
|
backgroundColor: 'var(--mantine-color-border-0)',
|
||||||
color: 'var(--mantine-color-primary-0)',
|
borderRadius: '16px',
|
||||||
}}
|
color: 'var(--mantine-color-background-0)',
|
||||||
>
|
}}
|
||||||
{cardPlaylist.name}
|
>
|
||||||
</Text>
|
{cardPlaylist.name}
|
||||||
|
</Text>
|
||||||
|
{themeList.length > 0 && (
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
paddingRight: '.25rem',
|
||||||
|
paddingLeft: '.25rem',
|
||||||
|
backgroundColor: 'var(--mantine-color-background-0)',
|
||||||
|
borderRadius: '16px',
|
||||||
|
color: 'var(--mantine-color-border-0)',
|
||||||
|
minWidth: '1.5rem',
|
||||||
|
textAlign: 'center',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{themeList.length}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
</Group>
|
||||||
<Group gap={0}>
|
<Group gap={0}>
|
||||||
{!defaultLists.includes(cardPlaylist.name) && (
|
{!defaultLists.includes(cardPlaylist.name) && (
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ export function ThemeModalContent({ selectedTheme }: { selectedTheme: Theme }) {
|
|||||||
}}
|
}}
|
||||||
align='center'
|
align='center'
|
||||||
gap={0}
|
gap={0}
|
||||||
|
miw={600}
|
||||||
>
|
>
|
||||||
<Select
|
<Select
|
||||||
disabled
|
disabled
|
||||||
|
|||||||
Reference in New Issue
Block a user