New less heavy component for previews
All checks were successful
Deploy to production / build (push) Successful in 17s
All checks were successful
Deploy to production / build (push) Successful in 17s
This commit is contained in:
@@ -8,7 +8,7 @@ import { useState } from 'react';
|
|||||||
import { FiEdit, FiTrash } from 'react-icons/fi';
|
import { FiEdit, FiTrash } from 'react-icons/fi';
|
||||||
import { textClasses } from 'styles';
|
import { textClasses } from 'styles';
|
||||||
import type { Theme, ThemePlaylist } from 'types';
|
import type { Theme, ThemePlaylist } from 'types';
|
||||||
import { ThemeCard } from '../../Themes';
|
import { ThemeCardPreview } from '../../Themes/ThemeCard';
|
||||||
|
|
||||||
export function ThemePlaylistStack({
|
export function ThemePlaylistStack({
|
||||||
cardPlaylist,
|
cardPlaylist,
|
||||||
@@ -113,68 +113,44 @@ export function ThemePlaylistStack({
|
|||||||
{...presentationProps}
|
{...presentationProps}
|
||||||
style={{ position: 'absolute', top: -60, zIndex: 3 }}
|
style={{ position: 'absolute', top: -60, zIndex: 3 }}
|
||||||
>
|
>
|
||||||
<ThemeCard
|
<ThemeCardPreview
|
||||||
cardTheme={
|
cardTheme={
|
||||||
allThemes.find((theme: Theme) => theme.id === Number(themeList[0])) ||
|
allThemes.find((theme: Theme) => theme.id === Number(themeList[0])) ||
|
||||||
missingTheme
|
missingTheme
|
||||||
}
|
}
|
||||||
allThemes={allThemes}
|
|
||||||
themePlaylists={[]}
|
|
||||||
setSelectedTheme={() => {}}
|
|
||||||
openThemeModal={() => {}}
|
|
||||||
enabled={false}
|
|
||||||
management={false}
|
|
||||||
/>
|
/>
|
||||||
</Parallax>
|
</Parallax>
|
||||||
<Parallax
|
<Parallax
|
||||||
{...presentationProps}
|
{...presentationProps}
|
||||||
style={{ position: 'absolute', top: -60, zIndex: 2 }}
|
style={{ position: 'absolute', top: -60, zIndex: 2 }}
|
||||||
>
|
>
|
||||||
<ThemeCard
|
<ThemeCardPreview
|
||||||
cardTheme={
|
cardTheme={
|
||||||
allThemes.find((theme: Theme) => theme.id === Number(themeList[1])) ||
|
allThemes.find((theme: Theme) => theme.id === Number(themeList[1])) ||
|
||||||
missingTheme
|
missingTheme
|
||||||
}
|
}
|
||||||
allThemes={allThemes}
|
|
||||||
themePlaylists={[]}
|
|
||||||
setSelectedTheme={() => {}}
|
|
||||||
openThemeModal={() => {}}
|
|
||||||
enabled={false}
|
|
||||||
management={false}
|
|
||||||
/>
|
/>
|
||||||
</Parallax>
|
</Parallax>
|
||||||
<Parallax
|
<Parallax
|
||||||
{...presentationProps}
|
{...presentationProps}
|
||||||
style={{ position: 'absolute', top: -60, zIndex: 1 }}
|
style={{ position: 'absolute', top: -60, zIndex: 1 }}
|
||||||
>
|
>
|
||||||
<ThemeCard
|
<ThemeCardPreview
|
||||||
cardTheme={
|
cardTheme={
|
||||||
allThemes.find((theme: Theme) => theme.id === Number(themeList[2])) ||
|
allThemes.find((theme: Theme) => theme.id === Number(themeList[2])) ||
|
||||||
missingTheme
|
missingTheme
|
||||||
}
|
}
|
||||||
allThemes={allThemes}
|
|
||||||
themePlaylists={[]}
|
|
||||||
setSelectedTheme={() => {}}
|
|
||||||
openThemeModal={() => {}}
|
|
||||||
enabled={false}
|
|
||||||
management={false}
|
|
||||||
/>
|
/>
|
||||||
</Parallax>
|
</Parallax>
|
||||||
<Parallax
|
<Parallax
|
||||||
{...presentationProps}
|
{...presentationProps}
|
||||||
style={{ position: 'absolute', top: -60, zIndex: 0 }}
|
style={{ position: 'absolute', top: -60, zIndex: 0 }}
|
||||||
>
|
>
|
||||||
<ThemeCard
|
<ThemeCardPreview
|
||||||
cardTheme={
|
cardTheme={
|
||||||
allThemes.find((theme: Theme) => theme.id === Number(themeList[3])) ||
|
allThemes.find((theme: Theme) => theme.id === Number(themeList[3])) ||
|
||||||
missingTheme
|
missingTheme
|
||||||
}
|
}
|
||||||
allThemes={allThemes}
|
|
||||||
themePlaylists={[]}
|
|
||||||
setSelectedTheme={() => {}}
|
|
||||||
openThemeModal={() => {}}
|
|
||||||
enabled={false}
|
|
||||||
management={false}
|
|
||||||
/>
|
/>
|
||||||
</Parallax>
|
</Parallax>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -215,16 +191,7 @@ export function ThemePlaylistStack({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Parallax {...presentationProps}>
|
<Parallax {...presentationProps}>
|
||||||
<ThemeCard
|
<ThemeCardPreview key={theme.id} cardTheme={theme} />
|
||||||
key={theme.id}
|
|
||||||
cardTheme={theme}
|
|
||||||
allThemes={allThemes}
|
|
||||||
themePlaylists={[]}
|
|
||||||
setSelectedTheme={() => {}}
|
|
||||||
openThemeModal={() => {}}
|
|
||||||
enabled={false}
|
|
||||||
management={false}
|
|
||||||
/>
|
|
||||||
</Parallax>
|
</Parallax>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
@@ -232,7 +199,13 @@ export function ThemePlaylistStack({
|
|||||||
</Stack>
|
</Stack>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Group w={'100%'} pos={'absolute'} justify='space-between' bottom={0}>
|
<Group
|
||||||
|
w={'100%'}
|
||||||
|
pos={'absolute'}
|
||||||
|
justify='space-between'
|
||||||
|
bottom={0}
|
||||||
|
style={{ zIndex: 1000 }}
|
||||||
|
>
|
||||||
<Text
|
<Text
|
||||||
style={{
|
style={{
|
||||||
paddingRight: '.25rem',
|
paddingRight: '.25rem',
|
||||||
@@ -244,7 +217,7 @@ export function ThemePlaylistStack({
|
|||||||
>
|
>
|
||||||
{cardPlaylist.name}
|
{cardPlaylist.name}
|
||||||
</Text>
|
</Text>
|
||||||
<Group gap={0} style={{ zIndex: 1000 }}>
|
<Group gap={0}>
|
||||||
{!defaultLists.includes(cardPlaylist.name) && (
|
{!defaultLists.includes(cardPlaylist.name) && (
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
@@ -0,0 +1,119 @@
|
|||||||
|
import { Box, Button, Group, Stack, Text } from '@mantine/core';
|
||||||
|
import type { Theme } from 'types';
|
||||||
|
import { MiniAppItem } from './components/MiniAppItem';
|
||||||
|
import { MiniGroupItem } from './components/MiniGroupItem';
|
||||||
|
|
||||||
|
export function ThemeCardPreview({ cardTheme }: { cardTheme: Theme }) {
|
||||||
|
return (
|
||||||
|
<Group gap={0} align='center' justify='center' display={'grid'} pos={'relative'}>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
top: -10,
|
||||||
|
left: 6,
|
||||||
|
paddingRight: '.25rem',
|
||||||
|
paddingLeft: '.25rem',
|
||||||
|
backgroundColor: cardTheme.backgroundColor,
|
||||||
|
borderRadius: '4px',
|
||||||
|
color:
|
||||||
|
cardTheme.borderColor === cardTheme.primaryColor
|
||||||
|
? cardTheme.accentColor
|
||||||
|
: cardTheme.primaryColor,
|
||||||
|
zIndex: 3,
|
||||||
|
boxShadow: `2px -2px ${cardTheme.borderColor}`,
|
||||||
|
textOverflow: 'ellipsis',
|
||||||
|
overflow: 'hidden',
|
||||||
|
whiteSpace: 'nowrap',
|
||||||
|
maxWidth: 275,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{cardTheme.name}
|
||||||
|
</Text>
|
||||||
|
<Button
|
||||||
|
w={'275px'}
|
||||||
|
h={'115px'}
|
||||||
|
style={{
|
||||||
|
backgroundImage:
|
||||||
|
cardTheme?.backgroundImage?.toLocaleLowerCase() === 'none'
|
||||||
|
? undefined
|
||||||
|
: `linear-gradient(${cardTheme?.backgroundColor}33, ${cardTheme?.backgroundColor}33), url(../../trigger/api/backgroundImages/thumbs/${cardTheme?.backgroundImage})`,
|
||||||
|
backgroundSize:
|
||||||
|
cardTheme?.backgroundImage?.toLocaleLowerCase() === 'none'
|
||||||
|
? undefined
|
||||||
|
: 'cover',
|
||||||
|
backgroundColor:
|
||||||
|
cardTheme?.backgroundImage?.toLocaleLowerCase() === 'none'
|
||||||
|
? cardTheme?.backgroundColor
|
||||||
|
: undefined,
|
||||||
|
backgroundPosition: 'center',
|
||||||
|
border: `solid ${cardTheme.borderColor}`,
|
||||||
|
transition: 'all .25s ease',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Group w={'100%'} gap={0} display={'flex'} align='center' justify='center'>
|
||||||
|
<Stack align='center' gap={12}>
|
||||||
|
<Box
|
||||||
|
style={{
|
||||||
|
height: '8px',
|
||||||
|
width: '100px',
|
||||||
|
backgroundColor: cardTheme.searchColor,
|
||||||
|
borderRadius: '4px',
|
||||||
|
borderBottom: `solid 1px ${cardTheme.borderColor}`,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Group justify='space-between'>
|
||||||
|
<Box
|
||||||
|
style={{
|
||||||
|
height: '.5rem',
|
||||||
|
width: '100px',
|
||||||
|
backgroundColor: cardTheme.accentColor,
|
||||||
|
borderRadius: '4px',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Box
|
||||||
|
style={{
|
||||||
|
height: '.5rem',
|
||||||
|
width: '50px',
|
||||||
|
backgroundColor: cardTheme.primaryColor,
|
||||||
|
borderRadius: '4px',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Group>
|
||||||
|
<Group w={'100%'} mb={-4}>
|
||||||
|
<Box
|
||||||
|
style={{
|
||||||
|
height: '2px',
|
||||||
|
width: '40px',
|
||||||
|
backgroundColor: cardTheme.primaryColor,
|
||||||
|
borderRadius: '4px',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Group>
|
||||||
|
<Group w={'100%'} gap={10} justify='space-between'>
|
||||||
|
<MiniAppItem cardTheme={cardTheme} />
|
||||||
|
<MiniAppItem cardTheme={cardTheme} />
|
||||||
|
<MiniAppItem cardTheme={cardTheme} />
|
||||||
|
<MiniAppItem cardTheme={cardTheme} />
|
||||||
|
</Group>
|
||||||
|
<Group w={'100%'} mb={-4}>
|
||||||
|
<Box
|
||||||
|
style={{
|
||||||
|
height: '2px',
|
||||||
|
width: '32px',
|
||||||
|
backgroundColor: cardTheme.primaryColor,
|
||||||
|
borderRadius: '4px',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Group>
|
||||||
|
<Group w={'100%'} gap={10} justify='space-between'>
|
||||||
|
<MiniGroupItem cardTheme={cardTheme} />
|
||||||
|
<MiniGroupItem cardTheme={cardTheme} />
|
||||||
|
<MiniGroupItem cardTheme={cardTheme} />
|
||||||
|
<MiniGroupItem cardTheme={cardTheme} />
|
||||||
|
</Group>
|
||||||
|
</Stack>
|
||||||
|
</Group>
|
||||||
|
</Button>
|
||||||
|
</Group>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1 +1,2 @@
|
|||||||
export { ThemeCard } from './ThemeCard';
|
export { ThemeCard } from './ThemeCard';
|
||||||
|
export { ThemeCardPreview } from './ThemeCardPreview';
|
||||||
|
|||||||
Reference in New Issue
Block a user