Skip to content

Commit eaeea23

Browse files
author
Ives van Hoorne
committed
Fix Button disabling for Import from GitHub
1 parent 7cff97f commit eaeea23

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/app/pages/GitHub/index.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,9 @@ const getFullGitHubUrl = url =>
5252

5353
export default class GitHub extends React.PureComponent {
5454
state: State = {
55-
url: 'https://github.com/reactjs/redux/tree/master/examples/counter',
55+
url: '',
56+
transformedUrl: '',
5657
error: null,
57-
transformedUrl: getFullGitHubUrl(
58-
'https://github.com/reactjs/redux/tree/master/examples/counter',
59-
),
6058
};
6159

6260
updateUrl = e => {
@@ -91,14 +89,16 @@ export default class GitHub extends React.PureComponent {
9189
</SubTitle>
9290
</Description>
9391

94-
<Label htmlFor="githuburl">GitHub URL</Label>
95-
92+
<Label htmlFor="githuburl">
93+
URL to GitHub Repository (supports branches and paths too)
94+
</Label>
9695
<StyledInput
9796
name="githuburl"
9897
value={url}
9998
onChange={this.updateUrl}
100-
placeholder="GitHub URL (can contain branch and path too)"
99+
placeholder="Insert GitHub URL..."
101100
/>
101+
102102
{error !== null &&
103103
<ErrorMessage>
104104
{error}
@@ -111,7 +111,9 @@ export default class GitHub extends React.PureComponent {
111111
placeholder="The Sandbox URL"
112112
/>
113113

114-
<Button to={gitHubToSandboxUrl(url)}>Open Sandbox</Button>
114+
<Button disabled={!transformedUrl} to={gitHubToSandboxUrl(url)}>
115+
Open Sandbox
116+
</Button>
115117
</Content>
116118
</Container>
117119
);

0 commit comments

Comments
 (0)