Skip to content

Commit

Permalink
Merge branch 'tonyhhyip-dynamic-page-loadiing' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
cswbrian committed Nov 11, 2019
2 parents f3a4693 + fbd5977 commit 4020df8
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
script/output/*
.DS_Store
node_modules
node_modules
.idea
19 changes: 19 additions & 0 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"dependencies": {
"@apollo/react-hooks": "^3.1.3",
"@babel/core": "7.2.2",
"@loadable/component": "^5.10.3",
"@material-ui/core": "4.5.2",
"@material-ui/icons": "^3.0.2",
"@material-ui/system": "^4.3.0",
Expand Down
70 changes: 53 additions & 17 deletions web/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,68 @@ import React from 'react'
import { Route, Switch, useRouteMatch } from 'react-router-dom'
import CssBaseline from '@material-ui/core/CssBaseline'
import { ThemeProvider } from '@material-ui/core/styles/'
import IndexPage from 'components/pages/landing'
import ProfilePage from 'components/pages/profile'
import DistrictPage from 'components/pages/district'
import DistrictListPage from 'components/pages/district/list'
import BattleGroundPage from 'components/pages/battleground'
import DisclaimerPage from 'components/pages/disclaimer'
import AboutDCPage from 'components/pages/about/dc'
import NotfoundPage from 'components/pages/notfound'
import SupportUsPage from 'components/pages/support-us'
import loadable from '@loadable/component'
import ApolloClient from 'apollo-boost'
import { ApolloProvider } from 'react-apollo'
import theme from 'ui/theme'
import './App.css'
import Box from '@material-ui/core/Box'
import styled from 'styled-components'
import MobileAppBar from 'components/organisms/MobileAppBar'
import ShareButton from 'components/organisms/ShareButton'
import Footer from 'components/organisms/Footer'
import { ContextStoreProvider } from 'ContextStore'
import withTracker from './WithTracker'
import SearchDrawer from 'components/pages/SearchDrawer'
import DistrictOverviewPage from 'components/pages/district/overview'
import DistrictAllPage from 'components/pages/district/all'
import GlobalDisclaimer from 'components/organisms/GlobalDisclaimer'
import { fireEvent } from 'utils/ga_fireevent'
import i18n from 'i18n'
import { fireEvent } from 'utils/ga_fireevent'

const IndexPage = loadable(() =>
import(/* webpackPrefetch: true */ 'components/pages/landing')
)
const ProfilePage = loadable(() =>
import(/* webpackPrefetch: true */ 'components/pages/profile')
)
const DistrictPage = loadable(() =>
import(/* webpackPrefetch: true */ 'components/pages/district')
)
const DistrictListPage = loadable(() =>
import(/* webpackPrefetch: true */ 'components/pages/district/list')
)
const BattleGroundPage = loadable(() =>
import(/* webpackPrefetch: true */ 'components/pages/battleground')
)
const DisclaimerPage = loadable(() =>
import(/* webpackPrefetch: true */ 'components/pages/disclaimer')
)
const AboutDCPage = loadable(() =>
import(/* webpackPrefetch: true */ 'components/pages/about/dc')
)
const NotfoundPage = loadable(() =>
import(/* webpackPrefetch: true */ 'components/pages/notfound')
)
const SupportUsPage = loadable(() =>
import(/* webpackPrefetch: true */ 'components/pages/support-us')
)
const DistrictOverviewPage = loadable(() =>
import(/* webpackPrefetch: true */ 'components/pages/district/overview')
)
const DistrictAllPage = loadable(() =>
import(/* webpackPrefetch: true */ 'components/pages/district/all')
)

const MobileAppBar = loadable(() =>
import(/* webpackPrefetch: true */ 'components/organisms/MobileAppBar')
)
const Footer = loadable(() =>
import(/* webpackPrefetch: true */ 'components/organisms/Footer')
)
const SearchDrawer = loadable(() =>
import(/* webpackPrefetch: true */ 'components/pages/SearchDrawer')
)
const GlobalDisclaimer = loadable(() =>
import(/* webpackPrefetch: true */ 'components/organisms/GlobalDisclaimer')
)

const ShareButton = loadable(() =>
import(/* webpackPrefetch: true */ 'components/organisms/ShareButton')
)

const client = new ApolloClient({
uri: process.env.REACT_APP_GRAPHQL_URI,
Expand Down
3 changes: 3 additions & 0 deletions web/src/components/organisms/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ const LinkBox = styled(Box)`
function Footer(props) {
const { t } = useTranslation()
const currentLanguage = getCurrentLanguage()
React.useEffect(() => {
window.FB.XFBML.parse()
}, [])
return (
<>
<StyledFooter>
Expand Down

0 comments on commit 4020df8

Please sign in to comment.