Skip to content

Commit c37e8db

Browse files
committed
bug fix, remove discus and ads.
1 parent d884c97 commit c37e8db

8 files changed

Lines changed: 1024 additions & 1039 deletions

File tree

app/containers/ModalCritterDetail/index.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,26 @@ import DetailInsect from './components/detail-insect';
2727
import DetailSea from './components/detail-sea';
2828
import { trackCategoryEvent } from '../../configureGA';
2929

30+
const dispatchResize = () => {
31+
if (typeof Event === 'function') {
32+
window.dispatchEvent(new Event('resize'));
33+
return;
34+
}
35+
36+
const event = document.createEvent('Event');
37+
event.initEvent('resize', true, true);
38+
window.dispatchEvent(event);
39+
};
40+
41+
const notifyLayoutAfterModalClose = () => {
42+
if (typeof window.requestAnimationFrame === 'function') {
43+
window.requestAnimationFrame(dispatchResize);
44+
return;
45+
}
46+
47+
setTimeout(dispatchResize, 0);
48+
};
49+
3050
function ModalCritterDetail() {
3151
useInjectReducer({ key, reducer });
3252
const {
@@ -88,6 +108,7 @@ function ModalCritterDetail() {
88108
document.body.style.position = '';
89109
document.body.style.top = '';
90110
window.scrollTo(0, parseInt(scrollY || '0', 10) * -1);
111+
notifyLayoutAfterModalClose();
91112
}}
92113
onRequestClose={() => {
93114
dispatch(closeCritterDetail());

app/pages/Critterpedia/index.js

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { Helmet } from 'react-helmet-async';
77
import Container from 'containers/Container';
88
import ModalCritterDetail from 'containers/ModalCritterDetail';
99
import { HemisphereContext } from 'utils/contexts';
10-
import { DiscussionEmbed } from 'disqus-react';
1110
import { changeHemisphere, changeLanguage } from 'containers/App/slice';
1211
import {
1312
CATEGORY_FISH,
@@ -27,7 +26,6 @@ import {
2726
updateFilterHour,
2827
} from 'pages/Critterpedia/slice';
2928
import SvgIcon from 'components/svg-icon';
30-
import { Bling as GPT } from 'react-gpt';
3129
import MonthPicker from './components/month-picker';
3230
import HourPicker from './components/hour-picker';
3331
import Statistic from './components/statistic';
@@ -65,20 +63,6 @@ const CritterpediaPage = () => {
6563
const dispatch = useDispatch();
6664
const history = useHistory();
6765
const [view /* , setView */] = useState('Grid');
68-
const disqus = useMemo(
69-
() => (
70-
<DiscussionEmbed
71-
key="critterpedia-plus-disqus"
72-
shortname="critterpedia-plus"
73-
config={{
74-
url: 'https://critterpedia-plus.mutoo.im',
75-
identifier: 'critterpedia-plus-guestbook',
76-
title: 'Critterpedia Plus',
77-
}}
78-
/>
79-
),
80-
[],
81-
);
8266
return (
8367
<HemisphereContext.Provider
8468
value={[hemisphere, h => dispatch(changeHemisphere(h))]}
@@ -206,7 +190,7 @@ const CritterpediaPage = () => {
206190
)}
207191
</Container>
208192
</Box>
209-
<Box my="50px">
193+
<Box mt="50px" pb="50px">
210194
<Container>
211195
<Flex mb="-20px" justifyContent="space-between">
212196
<Flex mr="50px">
@@ -261,7 +245,7 @@ const CritterpediaPage = () => {
261245
</Flex>
262246
</Container>
263247
{view === 'Grid' && <GridView mb="30px" />}
264-
{view === 'List' && <Box>Building</Box>}
248+
{view === 'List' && <Box>Not implemented yet.</Box>}
265249
<Container maxWidth="660px" mb="50px">
266250
{mode === MODE_DISCOVERY && (
267251
<>
@@ -314,27 +298,7 @@ const CritterpediaPage = () => {
314298
</p>
315299
</Text>
316300
</Container>
317-
<Box
318-
sx={{
319-
margin: '0 auto',
320-
maxWidth: '728px',
321-
backgroundColor: 'title-bg',
322-
backgroundClip: 'content-box',
323-
mb: '50px',
324-
}}
325-
>
326-
<GPT
327-
adUnitPath="/21918258587/critterpedia-index"
328-
sizeMapping={[
329-
{ viewport: [0, 0], slot: [320, 50] },
330-
{ viewport: [750, 0], slot: [728, 90] },
331-
]}
332-
/>
333-
</Box>
334-
<Container maxWidth="660px" mb="50px">
335-
{disqus}
336-
</Container>
337-
<Container maxWidth="660px" mb="50px">
301+
<Container maxWidth="660px" mb={0}>
338302
<Text fontSize="14px">
339303
<p>
340304
<b>Disclaimer:</b>

data-updater/data/v1/fish.json

Lines changed: 160 additions & 160 deletions
Large diffs are not rendered by default.

data-updater/data/v1/insects.json

Lines changed: 160 additions & 160 deletions
Large diffs are not rendered by default.

data-updater/data/v1/sea-creatures.json

Lines changed: 80 additions & 80 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)