mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-03 19:04:39 -05:00
fluid manga grid
This commit is contained in:
@@ -5,6 +5,7 @@ import CardActionArea from '@material-ui/core/CardActionArea';
|
|||||||
import CardMedia from '@material-ui/core/CardMedia';
|
import CardMedia from '@material-ui/core/CardMedia';
|
||||||
import Typography from '@material-ui/core/Typography';
|
import Typography from '@material-ui/core/Typography';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
import { Grid } from '@material-ui/core';
|
||||||
|
|
||||||
const useStyles = makeStyles({
|
const useStyles = makeStyles({
|
||||||
root: {
|
root: {
|
||||||
@@ -38,8 +39,6 @@ const useStyles = makeStyles({
|
|||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
manga: IManga
|
manga: IManga
|
||||||
// eslint-disable-next-line react/no-unused-prop-types, react/require-default-props
|
|
||||||
// ref?: false | React.MutableRefObject<HTMLInputElement | undefined>
|
|
||||||
}
|
}
|
||||||
const MangaCard = React.forwardRef((props: IProps, ref) => {
|
const MangaCard = React.forwardRef((props: IProps, ref) => {
|
||||||
const {
|
const {
|
||||||
@@ -50,6 +49,7 @@ const MangaCard = React.forwardRef((props: IProps, ref) => {
|
|||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<Grid item xs={6} sm={4} md={3} lg={2}>
|
||||||
<Link to={`/manga/${id}/`}>
|
<Link to={`/manga/${id}/`}>
|
||||||
<Card className={classes.root} ref={ref}>
|
<Card className={classes.root} ref={ref}>
|
||||||
<CardActionArea>
|
<CardActionArea>
|
||||||
@@ -67,6 +67,7 @@ const MangaCard = React.forwardRef((props: IProps, ref) => {
|
|||||||
</CardActionArea>
|
</CardActionArea>
|
||||||
</Card>
|
</Card>
|
||||||
</Link>
|
</Link>
|
||||||
|
</Grid>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import React, { useEffect, useRef } from 'react';
|
import React, { useEffect, useRef } from 'react';
|
||||||
|
import Grid from '@material-ui/core/Grid';
|
||||||
import MangaCard from './MangaCard';
|
import MangaCard from './MangaCard';
|
||||||
|
|
||||||
interface IProps{
|
interface IProps{
|
||||||
@@ -43,9 +44,9 @@ export default function MangaGrid(props: IProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(5, auto)', gridGap: '1em' }}>
|
<Grid container spacing={1}>
|
||||||
{mapped}
|
{mapped}
|
||||||
</div>
|
</Grid>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user