1
1
import React , { useState , useEffect } from 'react'
2
2
import styled from 'styled-components'
3
- import { Card } from 'antd'
3
+ import { Alert , Card } from 'antd'
4
4
import GitHubButton from 'react-github-btn'
5
5
import ReactGA from 'react-ga'
6
6
import VersionSelector from '../common/VersionSelector'
@@ -31,6 +31,7 @@ const TitleContainer = styled.div`
31
31
const Subtitle = styled . div ( {
32
32
display : 'flex' ,
33
33
alignItems : 'center' ,
34
+ justifyContent : 'center' ,
34
35
marginTop : 50
35
36
} )
36
37
@@ -58,6 +59,7 @@ const Home = () => {
58
59
const [ fromVersion , setFromVersion ] = useState ( '' )
59
60
const [ toVersion , setToVersion ] = useState ( '' )
60
61
const [ showDiff , setShowDiff ] = useState ( false )
62
+ const [ showAppNameWarning , setAppNameWarning ] = useState ( false )
61
63
const [ settings , setSettings ] = useState ( {
62
64
[ `${ SHOW_LATEST_RCS } ` ] : false
63
65
} )
@@ -76,6 +78,7 @@ const Home = () => {
76
78
77
79
setFromVersion ( fromVersion )
78
80
setToVersion ( toVersion )
81
+ setAppNameWarning ( true )
79
82
setShowDiff ( true )
80
83
}
81
84
@@ -119,11 +122,18 @@ const Home = () => {
119
122
showReleaseCandidates = { settings [ SHOW_LATEST_RCS ] }
120
123
/>
121
124
122
- < Subtitle >
123
- Don't forget: `RnDiffApp` is a placeholder. When upgrading, all
125
+ { showAppNameWarning ? (
126
+ < Subtitle >
127
+ < Alert
128
+ message = "Don't forget: `RnDiffApp` is a placeholder. When upgrading, all
124
129
instances of `RnDiffApp` should be `YourProjectName`, all `rndiffapp`
125
- should be `yourprojectname` etc.
126
- </ Subtitle >
130
+ should be `yourprojectname` etc."
131
+ type = "warning"
132
+ closable
133
+ onClose = { ( ) => setAppNameWarning ( false ) }
134
+ />
135
+ </ Subtitle >
136
+ ) : null }
127
137
</ Container >
128
138
129
139
< DiffViewer
0 commit comments