Skip to content

Commit 0d3fa9f

Browse files
derskealrefinedblessing
authored andcommitted
Fix image upload command for Windows and Linux (#75)
* Added upload image command for Linux and Windows | removed duplicate npm script command * Changed color of propType dropdown to white * Fixed requiredProp switch toggling * re-added package-lock.json * Changed double quotes to single quotes * enclosed typeOptions jsx in brackets * npm prestart | upload image shortcut * image upload shortcut * image upload shortcut * upload image shortcut
1 parent 9b729b3 commit 0d3fa9f

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ $RECYCLE.BIN/
154154
##
155155
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
156156

157+
#VSCode
158+
.vscode/
159+
157160
# User-specific files
158161
*.suo
159162
*.user
@@ -480,4 +483,4 @@ ASALocalRun/
480483
React-Proto.dmg
481484
installers/
482485

483-
# End of https://www.gitignore.io/api/node,linux,macos,windows,visualstudio,yarn
486+
# End of https://www.gitignore.io/api/node,linux,macos,windows,visualstudio,yarn

src/components/Info.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import React from 'react';
1+
import React from "react";
2+
3+
const command = window.navigator.platform.match(/^mac/) ? 'Cmd+O' : 'Ctrl+Shift+O';
24

35
const Info = () => (
46
<div className="info">
5-
<h1>Press Cmd+O to upload an image</h1>
7+
<h1>Press {command} to upload an image</h1>
68
</div>
79
);
810

src/components/Props.jsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,15 @@ const typeOptions = [
7777
key=''
7878
>
7979
</option>,
80-
...Object.keys(availablePropTypes).map(
81-
type => <option
80+
...Object.keys(availablePropTypes).map(type => (
81+
<option
8282
value={type}
8383
key={type}
84+
style={{ color: '#000'}}
8485
>
8586
{type}
86-
</option>,
87+
</option>
88+
),
8789
),
8890
];
8991

@@ -101,6 +103,12 @@ class Props extends Component {
101103
});
102104
}
103105

106+
togglePropRequired = () => {
107+
this.setState({
108+
propRequired: !this.state.propRequired,
109+
});
110+
}
111+
104112
handleAddProp = (event) => {
105113
event.preventDefault();
106114
const {
@@ -190,7 +198,7 @@ class Props extends Component {
190198
<InputLabel className={classes.light} htmlFor='propRequired'>Required?</InputLabel>
191199
<Switch
192200
checked={this.state.propRequired}
193-
onChange={this.handleChange}
201+
onChange={this.togglePropRequired}
194202
value='propRequired'
195203
color='secondary'
196204
id='propRequired'

0 commit comments

Comments
 (0)