diff --git a/package.json b/package.json index a956eb8..3da8828 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "forfansubsfront", - "version": "3.1.0hotfix1", - "private": true, + "version": "3.2.0", + "private": false, "dependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.28", "@fortawesome/free-brands-svg-icons": "^5.13.0", diff --git a/src/components/footer/footer.js b/src/components/footer/footer.js index f5d54b6..b08b243 100644 --- a/src/components/footer/footer.js +++ b/src/components/footer/footer.js @@ -1,14 +1,16 @@ import React from 'react' import { useGlobal } from 'reactn' -import { Box, makeStyles } from '@material-ui/core' +import { makeStyles } from '@material-ui/core' import Typography from '@material-ui/core/Typography' import FooterItems from '../../config/footer_items' const useStyles = makeStyles(theme => ({ FooterInnerDiv: { - padding: `${theme.spacing(2)}px` + padding: `${theme.spacing(2)}px`, + display: "flex", + flexWrap: "wrap" }, FooterAuthor: { color: theme.palette.grey["A200"], @@ -28,20 +30,20 @@ export default function Footer() { return ( <> ) diff --git a/src/components/header/header.js b/src/components/header/header.js index 6d8eb28..e335b5a 100644 --- a/src/components/header/header.js +++ b/src/components/header/header.js @@ -134,7 +134,9 @@ const useStyles = makeStyles(theme => ({ }, '& $iconContainer': { alignItems: "initial", - width: `${theme.spacing(6)}px` + width: `${theme.spacing(6)}px`, + maxWidth: `${theme.spacing(6)}px`, + minWidth: `${theme.spacing(6)}px` }, [theme.breakpoints.up('sm')]: { width: drawerWidth, diff --git a/src/components/index/index.js b/src/components/index/index.js index 833f61d..1747a29 100644 --- a/src/components/index/index.js +++ b/src/components/index/index.js @@ -26,6 +26,44 @@ const useStyles = makeStyles(theme => ({ }, IndexHeader: { marginBottom: theme.spacing(2) + }, + EpisodeContainer: { + display: "grid", + gridTemplateColumns: "repeat(8, 1fr)", + gridTemplateRows: "repeat(2, 1fr)", + gap: `${theme.spacing(2)}px`, + gridTemplateAreas: `"Title Title Title . . . . ." ". . . . . . . ."`, + }, + Title: { + gridArea: "Title" + }, + [theme.breakpoints.down("md")]: { + EpisodeContainer: { + display: "grid", + gridTemplateColumns: "repeat(5, 1fr)", + gridTemplateRows: "repeat(1, 1fr)", + gap: `${theme.spacing(2)}px`, + gridTemplateAreas: `"Title Title . . ." ". . . . ."`, + }, + Title: { + "& h2": { + fontSize: "3em" + } + } + }, + [theme.breakpoints.down("xs")]: { + EpisodeContainer: { + display: "grid", + gridTemplateColumns: "repeat(3, 1fr)", + gridTemplateRows: "repeat(2, 1fr)", + gap: `${theme.spacing(2)}px`, + gridTemplateAreas: `"Title Title ." ". . ."`, + }, + Title: { + "& h2": { + fontSize: "3em" + } + } } })) diff --git a/src/components/index/latest/latestepisode.js b/src/components/index/latest/latestepisode.js index a1c0826..eddc292 100644 --- a/src/components/index/latest/latestepisode.js +++ b/src/components/index/latest/latestepisode.js @@ -55,33 +55,31 @@ export default function LatestEpisode(props) { return ( <> - - - - - { - img.target.onerror = null - if (imageError) return img.target.src = CoverPlaceholder - img.target.src = cover_art - setImageError(true) - }} - alt={`${anime_name} ${episodeInfo.title} Poster Resmi`} /> - - - - - {episodeInfo.title} - - - - {formattedDate} - {created_by} + + + + { + img.target.onerror = null + if (imageError) return img.target.src = CoverPlaceholder + img.target.src = cover_art + setImageError(true) + }} + alt={`${anime_name} ${episodeInfo.title} Poster Resmi`} /> + + + + + {episodeInfo.title} - + + + {formattedDate} - {created_by} + - - + + ) } diff --git a/src/components/index/latest/latestmangaepisode.js b/src/components/index/latest/latestmangaepisode.js index 0bfcd36..84f5273 100644 --- a/src/components/index/latest/latestmangaepisode.js +++ b/src/components/index/latest/latestmangaepisode.js @@ -51,31 +51,29 @@ export default function LatestMangaEpisode(props) { return ( <> - - - - - { - img.target.onerror = null - if (imageError) return img.target.src = CoverPlaceholder - img.target.src = manga_cover - setImageError(true) - }} - alt={`${manga_name} Poster Resmi`} /> - - - - {episode_number}. Bölüm{episode_name ? `: ${episode_name}` : ""} - - - {formattedDate} - {created_by} - - + + + + { + img.target.onerror = null + if (imageError) return img.target.src = CoverPlaceholder + img.target.src = manga_cover + setImageError(true) + }} + alt={`${manga_name} Poster Resmi`} /> - - + + + {episode_number}. Bölüm{episode_name ? `: ${episode_name}` : ""} + + + {formattedDate} - {created_by} + + + + ) } diff --git a/src/pages/episode/index.js b/src/pages/episode/index.js index b9761f5..a242aaa 100644 --- a/src/pages/episode/index.js +++ b/src/pages/episode/index.js @@ -8,7 +8,7 @@ import ReactGA from 'react-ga' import find from 'lodash-es/find' import Loading from '../../components/progress/index' -import { getEpisodePageInfo, getEpisodeInfo } from '../../config/api-routes' +import { getEpisodePageInfo, getEpisodeInfo, contentCover } from '../../config/api-routes' import { episodePage, animePage } from '../../config/front-routes' import { @@ -26,6 +26,7 @@ import { Grid, Box, Button, Typography } from '@material-ui/core' import { format } from 'date-fns' import Dotdotdot from 'react-dotdotdot' import MotdContainer from '../../components/motd' +import { CoverPlaceholder } from '../../config/theming/images' export default function EpisodePage(props) { const classes = useStyles() @@ -52,6 +53,7 @@ export default function EpisodePage(props) { const [loading, setLoading] = useState(true) const [episodeLoading, setEpisodeLoading] = useState(false) const [iframeLoading, setIframeLoading] = useState(false) + const [coverArtError, setCoverArtError] = useState(false) useEffect(() => { const fetchData = async () => { @@ -298,7 +300,20 @@ export default function EpisodePage(props) { - {`${animeData.name} + {`${animeData.name} { + if (coverArtError) { + img.target.src = CoverPlaceholder + return null + } + img.target.src = animeData.cover_art + setCoverArtError(true) + }} + /> diff --git a/src/pages/index/index.js b/src/pages/index/index.js index 72e2b0c..b3870bb 100644 --- a/src/pages/index/index.js +++ b/src/pages/index/index.js @@ -171,21 +171,17 @@ export default function IndexPage(props) { : ""} {latestEpisodesWindow.length ?
- - +
+
En Yeni Bölümler - - - - {latestEpisodesWindow} - - - +
+ {latestEpisodesWindow} +
: ""} {latestMangasWindow.length ? @@ -200,21 +196,17 @@ export default function IndexPage(props) { : ""} {latestMangaEpisodesWindow.length ?
- - +
+
En Yeni - + Bölümler - - - - - {latestMangaEpisodesWindow} - - - + +
+ {latestMangaEpisodesWindow} +
: ""} diff --git a/src/pages/manga-episode/index.js b/src/pages/manga-episode/index.js index 2b41867..40e0b2f 100644 --- a/src/pages/manga-episode/index.js +++ b/src/pages/manga-episode/index.js @@ -38,7 +38,6 @@ export default function MangaEpisodePage(props) { }) const [activePageNumber, setActivePageNumber] = useState(1) const [settings] = useGlobal('settings') - const [mobile] = useGlobal('mobile') const setSettings = useDispatch('setSettings') const NavigatorRef = useRef() @@ -147,7 +146,6 @@ export default function MangaEpisodePage(props) { Okumak istediğiniz bölümü seçin {settings.readingStyle === "pagebypage" ? diff --git a/src/serviceWorker.js b/src/serviceWorker.js index a6032db..4871a79 100644 --- a/src/serviceWorker.js +++ b/src/serviceWorker.js @@ -24,10 +24,6 @@ function isAdminRoute() { return window.location.pathname.startsWith('/admin') } -function isAPIRoute() { - return window.location.pathname.startsWith('/api') -} - export function register(config) { if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { // The URL constructor is available in all browsers that support SW. @@ -40,7 +36,7 @@ export function register(config) { } window.addEventListener('load', () => { - if (isAdminRoute() || isAPIRoute()) { + if (isAdminRoute()) { console.info('unregistering service worker for admin route') unregister() console.info('reloading')