Skip to content

Commit aa290c7

Browse files
committed
move pages one up
1 parent 009dd88 commit aa290c7

File tree

1 file changed

+13
-26
lines changed

1 file changed

+13
-26
lines changed

src/components/pages/Home.js renamed to src/pages/Home.js

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
import React, { useState, useEffect } from 'react'
1+
import React, { useState } from 'react'
22
import styled from 'styled-components'
33
import { Card } from 'antd'
44
import GitHubButton from 'react-github-btn'
5-
import ReactGA from 'react-ga'
65

7-
import VersionSelector from '../common/VersionSelector'
8-
import DiffViewer from '../common/DiffViewer'
9-
import Settings from '../common/Settings'
10-
import { homepage } from '../../../package.json'
11-
import logo from '../../assets/logo.svg'
12-
import { SHOW_LATEST_RCS } from '../../utils'
6+
import VersionSelector from '../components/common/VersionSelector'
7+
import DiffViewer from '../components/common/DiffViewer'
8+
import { Settings } from '../components/Settings'
9+
import { homepage } from '../../package.json'
10+
import logo from '../assets/logo.svg'
11+
import { SHOW_LATEST_RCS } from '../utils'
1312

1413

1514
const Page = styled.div`
@@ -57,20 +56,13 @@ const StarButton = styled(({ className, ...props }) => (
5756
`
5857

5958
export const Home = () => {
60-
const [fromVersion, setFromVersion] = useState('')
61-
const [toVersion, setToVersion] = useState('')
59+
const [fromVersion, setFromVersion] = useState(null)
60+
const [toVersion, setToVersion] = useState(null)
6261
const [showDiff, setShowDiff] = useState(false)
6362
const [settings, setSettings] = useState({
6463
[`${SHOW_LATEST_RCS}`]: false,
6564
})
6665

67-
useEffect(() => {
68-
if (process.env.NODE_ENV === 'production') {
69-
ReactGA.initialize('UA-136307971-1')
70-
ReactGA.pageview('/')
71-
}
72-
}, [])
73-
7466
const handleShowDiff = ({ fromVersion, toVersion }) => {
7567
if (fromVersion === toVersion) {
7668
return
@@ -110,7 +102,7 @@ export const Home = () => {
110102
data-show-count="true"
111103
aria-label="Star react-native-community/upgrade-helper on GitHub"
112104
>
113-
Star
105+
Star
114106
</StarButton>
115107

116108
<Settings handleSettingsChange={handleSettingsChange} />
@@ -121,18 +113,13 @@ export const Home = () => {
121113
showReleaseCandidates={settings[SHOW_LATEST_RCS]}
122114
/>
123115

124-
<Subtitle>
125-
Don't forget: `RnDiffApp` is a placeholder. When upgrading, all
126-
instances of `RnDiffApp` should be `YourProjectName`, all `rndiffapp`
127-
should be `yourprojectname` etc.
128-
</Subtitle>
129-
</Container>
116+
<Subtitle>Don't forget: `RnDiffApp` is a placeholder. When upgrading, all instances of `RnDiffApp` should be `YourProjectName`, all `rndiffapp` should be `yourprojectname` etc.</Subtitle></Container>
130117

131-
<DiffViewer
118+
{/* <DiffViewer
132119
showDiff={showDiff}
133120
fromVersion={fromVersion}
134121
toVersion={toVersion}
135-
/>
122+
/> */}
136123
</Page>
137124
)
138125
}

0 commit comments

Comments
 (0)