Skip to content
This repository has been archived by the owner on Mar 26, 2023. It is now read-only.

Commit

Permalink
Merge pull request #84 from ForFansubs/dev
Browse files Browse the repository at this point in the history
V4
  • Loading branch information
ayberktandogan authored May 16, 2021
2 parents 388025a + ea16b6d commit 87ca058
Show file tree
Hide file tree
Showing 79 changed files with 8,926 additions and 6,567 deletions.
7 changes: 6 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
PORT=
REACT_APP_SITENAME=
REACT_APP_SITEURL=
REACT_APP_INDEX_TITLE_TEXT=
REACT_APP_DISQUS_SHORTNAME=
REACT_APP_HEADER_LOGO_TYPE=
REACT_APP_DISQUS_SHORTNAME=
REACT_APP_DEV_API_URL=
REACT_APP_DEV_ADMIN_URL=
REACT_APP_JIKAN_INSTANCE_URL=
REACT_APP_GA_USER_ID=
REACT_APP_SSS_PAGE=
REACT_APP_USE_SERVICE_WORKER=
REACT_APP_DEFAULT_LANG=

REACT_APP_META_DESCRIPTION=
REACT_APP_META_AUTHOR=
Expand Down
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INLINE_RUNTIME_CHUNK=false
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ src/static/fullLogo.gif
/src/static/logo.png
/src/static/fullLogo.png
/src/static/fullLogo-dark.png

.eslintcache
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</p>


[React](https://github.com/facebook/react), [ReactN](https://github.com/CharlesStover/reactn) ve [Material-UI](https://github.com/mui-org/material-ui) kullanarak hazırlandı.
[React](https://github.com/facebook/react) ve [Material-UI](https://github.com/mui-org/material-ui) kullanarak hazırlandı.

## Yükleme Talimatları

Expand Down
143 changes: 73 additions & 70 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,73 +1,76 @@
{
"name": "forfansubsfront",
"version": "3.2.1",
"private": false,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.28",
"@fortawesome/free-brands-svg-icons": "^5.13.0",
"@fortawesome/free-regular-svg-icons": "^5.13.0",
"@fortawesome/free-solid-svg-icons": "^5.13.0",
"@fortawesome/react-fontawesome": "^0.1.10",
"@material-ui/core": "^4.10.1",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.55",
"awesome-debounce-promise": "^2.1.0",
"axios": "^0.21.1",
"core-js": "^3.6.5",
"cron": "^1.8.2",
"date-fns": "^2.14.0",
"disqus-react": "^1.0.8",
"lodash": "^4.17.19",
"lodash-es": "^4.17.15",
"markdown-to-jsx": "^6.11.4",
"node-sass": "^4.14.1",
"notistack": "^0.9.16",
"react": "^16.13.1",
"react-app-polyfill": "^1.0.6",
"react-async-hook": "^3.6.1",
"react-dom": "^16.13.1",
"react-dotdotdot": "^1.3.1",
"react-ga": "^2.7.0",
"react-helmet-async": "^1.0.6",
"react-infinite-scroll-component": "^5.0.5",
"react-interval": "^2.1.1",
"react-lazyload": "^2.6.7",
"react-parallax": "^3.0.3",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1",
"react-swipeable": "^5.5.1",
"react-toastify": "^6.0.5",
"reactn": "^2.2.7",
"reactn-devtools": "^1.1.0",
"redux": "^4.0.5",
"rellax": "^1.12.1",
"remarkable": "^2.0.1",
"source-map-explorer": "^2.4.2"
},
"resolutions": {
"minimist": "^1.2.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"analyze": "source-map-explorer build/static/js/*"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"proxy": "http://localhost:5000"
"version": "4.0.0",
"private": false,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.32",
"@fortawesome/free-brands-svg-icons": "^5.15.1",
"@fortawesome/free-regular-svg-icons": "^5.15.1",
"@fortawesome/free-solid-svg-icons": "^5.15.1",
"@fortawesome/react-fontawesome": "^0.1.13",
"@material-ui/core": "^4.11.1",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.56",
"@nivo/bar": "^0.65.1",
"@nivo/core": "^0.66.0",
"awesome-debounce-promise": "^2.1.0",
"axios": "^0.21.0",
"core-js": "^3.7.0",
"date-fns": "^2.16.1",
"disqus-react": "^1.0.10",
"flag-icon-css": "^3.5.0",
"i18next": "^19.8.4",
"i18next-browser-languagedetector": "^6.0.1",
"i18next-http-backend": "^1.0.21",
"lodash-es": "^4.17.15",
"markdown-to-jsx": "^7.1.0",
"notistack": "^1.0.2",
"react": "^17.0.1",
"react-app-polyfill": "^2.0.0",
"react-device-detect": "^1.17.0",
"react-dom": "^17.0.1",
"react-dotdotdot": "^1.3.1",
"react-ga": "^3.3.0",
"react-helmet-async": "^1.0.7",
"react-i18next": "^11.7.3",
"react-icons": "^4.1.0",
"react-infinite-scroll-component": "^5.1.0",
"react-interval": "^2.1.1",
"react-lazyload": "^3.1.0",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.1",
"react-swipeable": "^6.0.0",
"sass": "^1.32.8",
"web-vitals": "^1.0.1"
},
"resolutions": {
"minimist": "^1.2.3"
},
"devDependencies": {
"source-map-explorer": "^2.5.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"analyze": "source-map-explorer build/static/js/*"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version",
"not dead"
]
},
"proxy": "http://localhost:5000"
}
68 changes: 36 additions & 32 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useEffect, lazy, Suspense } from 'react';
import { useDispatch, useGlobal } from 'reactn'
import React, { useEffect, lazy, Suspense, useContext } from 'react';
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import { HelmetProvider } from 'react-helmet-async'
import Wrapper from './components/hoc/wrapper'
Expand All @@ -12,6 +11,9 @@ import SSSPage from './pages/sss/index'
import FourOhFourPage from './components/404/404'
import EkipAlimlariPage from './pages/ekip-alimlari/index'
import ExtraPagesList from './pages/extra-pages/index'
import SiteStatusContext from './contexts/site_status.context';
import LoginPage from './pages/user/logIn'
import RegisterPage from './pages/user/register'

const IndexPage = lazy(() => import('./pages/index/index'))
const SearchPage = lazy(() => import('./pages/ara/index'))
Expand All @@ -20,48 +22,50 @@ const MangaPage = lazy(() => import('./pages/ceviriler/manga/index'))
const EpisodePage = lazy(() => import('./pages/episode/index'))
const MangaEpisodePage = lazy(() => import('./pages/manga-episode/index'))
const CompleteRegistrationPage = lazy(() => import('./pages/kayit-tamamla/index'))
const TakvimPage = lazy(() => import('./pages/calendar/index'))

export default function App() {
const getOnline = useDispatch('getOnline')
const checkMobile = useDispatch('checkMobile')
const [online] = useGlobal('online')
const [siteStatus] = useContext(SiteStatusContext)

ReactGA.initialize(process.env.REACT_APP_GA_USER_ID);
useEffect(() => {
getOnline()
checkMobile(navigator.userAgent || navigator.vendor || window.opera)

}, [getOnline, checkMobile])
}, [])

if (online === true)
if (siteStatus.status === true)
return (
<>
<Router>
<Wrapper>
<HelmetProvider>
<Suspense fallback={<Loading />}>
<Switch>
<Route path="/" exact component={IndexPage} />
<Route path="/ceviriler/anime/:slug/izle/:episodeInfo?" exact component={EpisodePage} />
<Route path="/ceviriler/anime/:slug" exact component={AnimePage} />
<Route path="/ceviriler/manga/:slug/oku/:episode_number?/:page_number?" exact component={MangaEpisodePage} />
<Route path="/ceviriler/manga/:slug" exact component={MangaPage} />
<Route path="/ara/:type?/:offset?" component={SearchPage} />
<Route path="/sss" exact component={SSSPage} />
<Route path="/ekip-alimlari" exact component={EkipAlimlariPage} />
<Route path="/kullanici/kayit-tamamla/:hash" exact component={CompleteRegistrationPage} />
{ExtraPagesList.length ? ExtraPagesList.map(({ PageUrl, PageComponent }) => (
<Route path={PageUrl} exact component={PageComponent} />
)) : ""}
<Route component={FourOhFourPage} />
</Switch>
</Suspense>
</HelmetProvider>
</Wrapper>
<HelmetProvider>
<Suspense fallback={<Loading />}>
<Switch>
<Route exact path="/giris-yap" component={LoginPage} />
<Route exact path="/kayit-ol" component={RegisterPage} />
<Wrapper>
<Switch>
<Route path="/" exact component={IndexPage} />
<Route path="/ceviriler/anime/:slug/izle/:episodeInfo?" exact component={EpisodePage} />
<Route path="/ceviriler/anime/:slug" exact component={AnimePage} />
<Route path="/ceviriler/manga/:slug/oku/:episode_number?/:page_number?" exact component={MangaEpisodePage} />
<Route path="/ceviriler/manga/:slug" exact component={MangaPage} />
<Route path="/ara/:type?/:offset?" component={SearchPage} />
<Route path="/sss" exact component={SSSPage} />
<Route path="/ekip-alimlari" exact component={EkipAlimlariPage} />
<Route path="/kullanici/kayit-tamamla/:hash" exact component={CompleteRegistrationPage} />
<Route path="/takvim" exact component={TakvimPage} />
{ExtraPagesList.length ? ExtraPagesList.map(({ PageUrl, PageComponent }) => (
<Route path={PageUrl} exact component={PageComponent} />
)) : ""}
<Route component={FourOhFourPage} />
</Switch>
</Wrapper>
</Switch>
</Suspense>
</HelmetProvider>
</Router>
</>
);

else if (online === false) return (
else if (!siteStatus.loading && !siteStatus.status) return (
<InitialLoading error={true} />
)

Expand Down
12 changes: 7 additions & 5 deletions src/components/404/404.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React, { useState } from 'react'
import { useState } from 'react'
import { Redirect } from 'react-router-dom'

import { Typography, makeStyles } from '@material-ui/core'

import { fourOhFourGif } from '../../config/theming/images'
import { useTranslation } from 'react-i18next'

const useStyles = makeStyles(theme => ({
Container: {
Expand All @@ -22,6 +23,7 @@ const useStyles = makeStyles(theme => ({
}))

export default function FourOhFourPage() {
const { t } = useTranslation('components')
const classes = useStyles()

const [redirect, setRedirect] = useState(false)
Expand All @@ -36,11 +38,11 @@ export default function FourOhFourPage() {
<div className={classes.Container}>
<img src={fourOhFourGif} className={classes.Image} alt="404gif" />
<Typography variant="h4">
Aradığınız sayfayı bulamadık, kaldırılmış olabilir.
</Typography>
{t('404.header_text')}
</Typography>
<Typography variant="body1">
10 saniye içerisinde ana sayfaya yönlendirileceksiniz.
</Typography>
{t('404.subtitle_text')}
</Typography>
</div>
</>
)
Expand Down
15 changes: 8 additions & 7 deletions src/components/app/pre-screens.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react'
import { useGlobal } from 'reactn'

import Box from '@material-ui/core/Box'
import Typography from '@material-ui/core/Typography'
import CircularProgress from '@material-ui/core/CircularProgress'

import { fullLogo, fullLogoDark } from '../../config/theming/images'

import { makeStyles } from '@material-ui/core'
import { useTranslation } from 'react-i18next'
import { useContext } from 'react'
import SettingsContext from '../../contexts/settings.context'

const useStyles = makeStyles(theme => ({
LogoContainer: {
Expand All @@ -21,20 +21,21 @@ const useStyles = makeStyles(theme => ({
}))

export default function InitialLoading(props) {
const { t } = useTranslation('components')
const [settings] = useContext(SettingsContext)
const { error } = props
const [usertheme] = useGlobal('theme')
const theme = useStyles()

return (
<Box position="absolute" left="50%" top="50%" textAlign="center" style={{ transform: "translate(-50%, -50%)" }}>
<img className={theme.LogoContainer} src={usertheme === "dark" ? fullLogo : fullLogoDark} alt="Site loading logo" />
<img className={theme.LogoContainer} src={settings.theme === "dark" ? fullLogo : fullLogoDark} alt="Site loading logo" />
{error ?
<>
<Typography variant="h4">
Sunucuyla bağlantı kuramadık :(
{t('pre_screens.connection_error.header_text')}
</Typography>
<Typography variant="body1">
Lütfen daha sonra tekrar deneyin...
{t('pre_screens.connection_error.subtitle_text')}
</Typography>

</>
Expand Down
Loading

0 comments on commit 87ca058

Please sign in to comment.