mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-11 07:55:52 +01:00
💄 Make responsiveness better for mobile
Posters aren't huge on mobile anymore, yay
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
|||||||
ScrollArea,
|
ScrollArea,
|
||||||
createStyles,
|
createStyles,
|
||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
|
import { useMediaQuery } from '@mantine/hooks';
|
||||||
import { IconLink as Link } from '@tabler/icons';
|
import { IconLink as Link } from '@tabler/icons';
|
||||||
import { useConfig } from '../../../tools/state';
|
import { useConfig } from '../../../tools/state';
|
||||||
import { serviceItem } from '../../../tools/types';
|
import { serviceItem } from '../../../tools/types';
|
||||||
@@ -25,14 +26,6 @@ export interface IMedia {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const useStyles = createStyles((theme) => ({
|
const useStyles = createStyles((theme) => ({
|
||||||
poster: {
|
|
||||||
[theme.fn.smallerThan('sm')]: {
|
|
||||||
maxWidth: '20%',
|
|
||||||
},
|
|
||||||
[theme.fn.largerThan('sm')]: {
|
|
||||||
maxWidth: 300,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
overview: {
|
overview: {
|
||||||
[theme.fn.largerThan('sm')]: {
|
[theme.fn.largerThan('sm')]: {
|
||||||
width: 400,
|
width: 400,
|
||||||
@@ -43,12 +36,14 @@ const useStyles = createStyles((theme) => ({
|
|||||||
export function MediaDisplay(props: { media: IMedia }) {
|
export function MediaDisplay(props: { media: IMedia }) {
|
||||||
const { media }: { media: IMedia } = props;
|
const { media }: { media: IMedia } = props;
|
||||||
const { classes, cx } = useStyles();
|
const { classes, cx } = useStyles();
|
||||||
|
const phone = useMediaQuery('(min-width: 800px)');
|
||||||
return (
|
return (
|
||||||
<Group position="apart">
|
<Group position="apart">
|
||||||
<Text>
|
<Text>
|
||||||
{media.poster && (
|
{media.poster && (
|
||||||
<Image
|
<Image
|
||||||
className={classes.poster}
|
width={phone ? 250 : 100}
|
||||||
|
height={phone ? 400 : 160}
|
||||||
style={{
|
style={{
|
||||||
float: 'right',
|
float: 'right',
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user