diff --git a/src/components/App/App.jsx b/src/components/App/App.jsx deleted file mode 100644 index f4919e9a23..0000000000 --- a/src/components/App/App.jsx +++ /dev/null @@ -1,248 +0,0 @@ -import darkBaseTheme from 'material-ui/styles/baseThemes/darkBaseTheme'; -import getMuiTheme from 'material-ui/styles/getMuiTheme'; -import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; -import React, { Suspense } from 'react'; -import Helmet from 'react-helmet'; -import { connect } from 'react-redux'; -import { Route, Switch, withRouter } from 'react-router-dom'; -import styled from 'styled-components'; - -import Combos from './../Combos/Combos'; -import Api from '../Api'; -import Subscription from '../Subscription'; -import constants from '../constants'; -import Distributions from '../Distributions'; -import Footer from '../Footer'; -import FourOhFour from '../FourOhFour'; -import Header from '../Header'; -import Home from '../Home'; -import Matches from '../Matches'; -import Player from '../Player'; -// import Predictions from '../Predictions'; -// import Assistant from "../Assistant"; -import Records from '../Records'; -import Request from '../Request'; -import Scenarios from '../Scenarios'; -import Search from '../Search'; -import Teams from '../Teams'; -import GlobalStyle from './GlobalStyle'; -import muiTheme from './muiTheme'; -import config from '../../config'; -import Spinner from '../Spinner'; - -const Status = React.lazy(() => import('../Status')); -const Explorer = React.lazy(() => import('../Explorer')); -const Heroes = React.lazy(() => import('../Heroes')); - -const StyledDiv = styled.div` - transition: ${constants.normalTransition}; - position: relative; - display: flex; - flex-direction: column; - height: 100%; - left: ${(props) => (props.open ? '256px' : '0px')}; - margin-top: 0px; - background-image: ${(props) => - props.location.pathname === '/' - ? 'url("/assets/images/home-background.png")' - : ''}; - background-position: center top -56px; - background-repeat: ${(props) => - props.location.pathname === '/' ? 'no-repeat' : ''}; - - #back2Top { - position: fixed; - left: auto; - right: 0px; - top: auto; - bottom: 20px; - outline: none; - color: rgb(196, 196, 196); - text-align: center; - outline: none; - border: none; - background-color: rgba(0, 0, 0, 0.3); - width: 40px; - font-size: 14px; - border-radius: 2px; - cursor: pointer; - z-index: 999999; - opacity: 0; - display: block; - pointer-events: none; - -webkit-transform: translate3d(0, 0, 0); - padding: 3px; - transition: opacity 0.3s ease-in-out; - - & #back2TopTxt { - font-size: 10px; - line-height: 12px; - text-align: center; - margin-bottom: 3px; - } - } - - #back2Top:hover { - background-color: rgb(26, 108, 239); - } -`; - -const StyledBodyDiv = styled.div` - padding: 0px 25px 25px 25px; - flex-grow: 1; - - @media only screen and (min-width: ${constants.appWidth}px) { - width: ${constants.appWidth}px; - margin: auto; - } -`; - -const AdBannerDiv = styled.div` - text-align: center; - margin-bottom: 5px; - - & img { - margin-top: 10px; - max-width: 100%; - } -`; - -const App = (props) => { - const { strings, location } = props; - - const back2Top = React.useRef(); - - React.useEffect(() => { - const handleScroll = () => { - let wait = false; - const { current } = back2Top; - if (!wait) { - if ( - document.body.scrollTop > 1000 || - document.documentElement.scrollTop > 1000 - ) { - current.style.opacity = 1; - current.style.pointerEvents = 'auto'; - } else { - current.style.opacity = 0; - current.style.pointerEvents = 'none'; - } - } - setTimeout(() => { - wait = !wait; - }, 300); - }; - - window.addEventListener('scroll', handleScroll); - - return () => { - window.removeEventListener('scroll', handleScroll); - }; - }); - - React.useLayoutEffect(() => { - window.scrollTo(0, 0); - }, [location]); - - const includeAds = !['/', '/api-keys', '/status'].includes(location.pathname); - - React.useEffect(() => { - if (includeAds) { - (window.adsbygoogle = window.adsbygoogle || []).push({}); - } - }, []); - - return ( - - }> - - - -
- - - {includeAds && config.VITE_ENABLE_ADSENSE && ( - )} - - - - - - - - - - - - - - - {/* */} - - {/* */} - - - - - - - {includeAds && config.VITE_ENABLE_RIVALRY && ( -
- - Logo for Rivalry.com - -
- {strings.home_sponsored_by}{' '} - Rivalry -
-
- )} - {includeAds && config.VITE_ENABLE_ADSENSE && ( - - )} -
-