Skip to content

Commit 15c311e

Browse files
committed
feat: move appname input to settings
1 parent 1991ed3 commit 15c311e

File tree

2 files changed

+24
-25
lines changed

2 files changed

+24
-25
lines changed

src/components/common/Settings.js

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React, { useState } from 'react'
2-
import { Popover, Button, Checkbox } from 'antd'
2+
import { Popover, Button, Checkbox, Form, Input } from 'antd'
33
import { SHOW_LATEST_RCS } from '../../utils'
44

5-
const Settings = ({ handleSettingsChange }) => {
5+
const Settings = ({ handleSettingsChange, appName, setAppName }) => {
66
const [popoverVisibility, setVisibility] = useState(false)
77

88
const handleClickChange = visibility => setVisibility(visibility)
@@ -14,11 +14,23 @@ const Settings = ({ handleSettingsChange }) => {
1414
<Popover
1515
placement="bottomRight"
1616
content={
17-
<Checkbox.Group onChange={updateCheckboxValues}>
18-
<div>
19-
<Checkbox value={SHOW_LATEST_RCS}>{SHOW_LATEST_RCS}</Checkbox>
20-
</div>
21-
</Checkbox.Group>
17+
<Form>
18+
<Form.Item>
19+
<Checkbox.Group onChange={updateCheckboxValues}>
20+
<div>
21+
<Checkbox value={SHOW_LATEST_RCS}>{SHOW_LATEST_RCS}</Checkbox>
22+
</div>
23+
</Checkbox.Group>
24+
</Form.Item>
25+
<Form.Item label="Your AppName">
26+
<Input
27+
value={appName}
28+
onChange={e => {
29+
setAppName(e.target.value)
30+
}}
31+
/>
32+
</Form.Item>
33+
</Form>
2234
}
2335
trigger="click"
2436
visible={popoverVisibility}

src/components/pages/Home.js

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,6 @@ const TitleHeader = styled.h1`
4444
margin-left: 15px;
4545
`
4646

47-
const AppNameInput = styled.input`
48-
border-radius: 5px;
49-
outline: none;
50-
border: solid 1px #ddd;
51-
padding: 8px;
52-
width: 50%;
53-
margin-bottom: 8px;
54-
`
55-
5647
const StarButton = styled(({ className, ...props }) => (
5748
<div className={className}>
5849
<GitHubButton {...props} />
@@ -121,17 +112,13 @@ const Home = () => {
121112
Star
122113
</StarButton>
123114

124-
<Settings handleSettingsChange={handleSettingsChange} />
115+
<Settings
116+
handleSettingsChange={handleSettingsChange}
117+
appName={appName}
118+
setAppName={setAppName}
119+
/>
125120
</TitleContainer>
126121

127-
<h4>Enter your App Name.</h4>
128-
<AppNameInput
129-
value={appName}
130-
onChange={e => {
131-
setAppName(e.target.value)
132-
}}
133-
/>
134-
135122
<VersionSelector
136123
showDiff={handleShowDiff}
137124
showReleaseCandidates={settings[SHOW_LATEST_RCS]}

0 commit comments

Comments
 (0)