diff --git a/src/components/Icons/BladeIcon/BladeIcon.interface.tsx b/src/components/Icons/BladeIcon/BladeIcon.interface.tsx index 4f4b857f..7c835817 100644 --- a/src/components/Icons/BladeIcon/BladeIcon.interface.tsx +++ b/src/components/Icons/BladeIcon/BladeIcon.interface.tsx @@ -15,6 +15,11 @@ export interface BladeIconProps { * Icon is rendered in Intro */ intro?: boolean + /** + * Icon is rendered in SceneList + * examples: `true`, `false` + */ + list?: boolean /** * examples: `wled`, `Light`, `mdi:led-strip` */ diff --git a/src/components/Icons/BladeIcon/BladeIcon.tsx b/src/components/Icons/BladeIcon/BladeIcon.tsx index ee4b20f2..bf49c3be 100644 --- a/src/components/Icons/BladeIcon/BladeIcon.tsx +++ b/src/components/Icons/BladeIcon/BladeIcon.tsx @@ -40,7 +40,8 @@ function BladeIcon({ style, scene = false, card = false, - intro = false + intro = false, + list = false }: BladeIconProps): JSX.Element { return ( ) : name.startsWith(' @@ -70,28 +73,32 @@ function BladeIcon({ alt="icon" style={{ transform: card ? 'unset' : scene ? 'scale(1)' : 'scale(0.012)', - marginTop: '3px' + marginTop: '3px', + height: list ? '100%' : 'unset' }} /> ) : name.startsWith('yz:logo2z') ? ( ) : name.startsWith('yz:logo2top') ? ( ) : name.startsWith('yz:logo2bot') ? ( ) : name.startsWith('yz:logo2') ? ( @@ -99,49 +106,56 @@ function BladeIcon({ style={{ // eslint-disable-next-line transform: card ? 'unset' : scene ? 'scale(1)' : intro ? 'scale(0.05)' : 'scale(0.012)', - marginTop: '3px' + marginTop: '3px', + height: list ? '100%' : 'unset' }} /> ) : name.startsWith('yz:logo3y') ? ( ) : name.startsWith('yz:logo3z') ? ( ) : name.startsWith('yz:logo3top') ? ( ) : name.startsWith('yz:logo3left') ? ( ) : name.startsWith('yz:logo3right') ? ( ) : name.startsWith('yz:logo3') ? ( ) : name.startsWith('wled') ? ( @@ -167,6 +181,7 @@ function BladeIcon({ style={{ transform: card ? 'unset' : scene ? 'scale(1)' : 'scale(0.012)', marginTop: '3px', + height: list ? '100%' : 'unset', }} /> ) : name.startsWith('yz:logo2z') ? ( @@ -174,6 +189,7 @@ function BladeIcon({ style={{ transform: card ? 'unset' : scene ? 'scale(1)' : 'scale(0.012)', marginTop: '3px', + height: list ? '100%' : 'unset', }} /> ) : name.startsWith('yz:logo2top') ? ( @@ -181,6 +197,7 @@ function BladeIcon({ style={{ transform: card ? 'unset' : scene ? 'scale(1)' : 'scale(0.012)', marginTop: '3px', + height: list ? '100%' : 'unset', }} /> ) : name.startsWith('yz:logo2bot') ? ( @@ -188,6 +205,7 @@ function BladeIcon({ style={{ transform: card ? 'unset' : scene ? 'scale(1)' : 'scale(0.012)', marginTop: '3px', + height: list ? '100%' : 'unset', }} /> ) : name.startsWith('yz:logo2') ? ( @@ -195,6 +213,7 @@ function BladeIcon({ style={{ transform: card ? 'unset' : scene ? 'scale(1)' : 'scale(0.012)', marginTop: '3px', + height: list ? '100%' : 'unset', }} /> ) : name.startsWith('wled') ? ( diff --git a/src/pages/Device/Presets.tsx b/src/pages/Device/Presets.tsx index 7735fbc6..ae2ddd76 100644 --- a/src/pages/Device/Presets.tsx +++ b/src/pages/Device/Presets.tsx @@ -239,7 +239,7 @@ const PresetsCard = ({ virtual, effectType, presets, style }: any) => { useEffect(() => { if (isLogged && features.cloud) getCloudConfigs() - }, [isLogged]) + }, [isLogged, features.cloud]) return ( diff --git a/src/pages/Scenes/Scenes.styles.tsx b/src/pages/Scenes/Scenes.styles.tsx index 2c1b2b99..0e73b51b 100644 --- a/src/pages/Scenes/Scenes.styles.tsx +++ b/src/pages/Scenes/Scenes.styles.tsx @@ -31,6 +31,16 @@ const useStyles = makeStyles({ '& > span:before': { position: 'relative' } + }, + iconMediaList: { + height: '100%', + display: 'flex', + alignItems: 'center', + margin: '0 auto', + fontSize: 50, + '& > span:before': { + position: 'relative' + } } }) diff --git a/src/pages/Scenes/ScenesImage.tsx b/src/pages/Scenes/ScenesImage.tsx index cdc6f997..33a52a66 100644 --- a/src/pages/Scenes/ScenesImage.tsx +++ b/src/pages/Scenes/ScenesImage.tsx @@ -5,7 +5,7 @@ import useStore from '../../store/useStore' import useStyles from './Scenes.styles' import BladeIcon from '../../components/Icons/BladeIcon/BladeIcon' -const SceneImage = ({ iconName }: { iconName: string }) => { +const SceneImage = ({ iconName, list }: { iconName: string, list?: boolean }) => { const classes = useStyles() const [imageData, setImageData] = useState(null) const getImage = useStore((state) => state.getImage) @@ -44,7 +44,7 @@ const SceneImage = ({ iconName }: { iconName: string }) => { /> ) ) : ( - + ) } diff --git a/src/pages/Scenes/ScenesMostUsed.tsx b/src/pages/Scenes/ScenesMostUsed.tsx index d2dbe51a..2de4d4d4 100644 --- a/src/pages/Scenes/ScenesMostUsed.tsx +++ b/src/pages/Scenes/ScenesMostUsed.tsx @@ -39,7 +39,7 @@ export default function ScenesMostUsed({ headerName: 'Image', width: db ? 100 : 150, renderCell: (params: GridRenderCellParams) => ( - + ) }, { diff --git a/src/pages/Scenes/ScenesPlaylist.tsx b/src/pages/Scenes/ScenesPlaylist.tsx index 212fc6f3..e7cf5ab0 100644 --- a/src/pages/Scenes/ScenesPlaylist.tsx +++ b/src/pages/Scenes/ScenesPlaylist.tsx @@ -83,7 +83,7 @@ export default function ScenesPlaylist({ headerName: 'Image', width: db ? 100 : 150, renderCell: (params: GridRenderCellParams) => ( - + ) }, { @@ -96,7 +96,10 @@ export default function ScenesPlaylist({ sx={{ whiteSpace: 'nowrap', overflow: 'hidden', - textOverflow: 'ellipsis' + textOverflow: 'ellipsis', + display: 'flex', + alignItems: 'center', + height: '100%' }} > {params.value}