Skip to content

Commit 0850705

Browse files
committed
refactor placeholder to include pref button
1 parent de165bb commit 0850705

File tree

7 files changed

+65
-36
lines changed

7 files changed

+65
-36
lines changed

images/exit.svg

Lines changed: 12 additions & 0 deletions
Loading

images/preferences.svg

Lines changed: 13 additions & 14 deletions
Loading

shared/components/Preferences/Preferences.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22

33
var Isvg = require('react-inlinesvg');
4-
var preferences = require('../../../images/preferences.svg');
4+
var exitUrl = require('../../../images/exit.svg');
55
var classNames = require('classnames');
66

77
class Preferences extends React.Component {
@@ -11,9 +11,9 @@ class Preferences extends React.Component {
1111
"preferences--selected": this.props.isPreferencesShowing
1212
});
1313
return (
14-
<div className={preferencesContainerClass}>
14+
<div className={preferencesContainerClass} tabindex="0">
1515
<button className="preferences__exit-button" onClick={this.props.closePreferences}>
16-
X
16+
<Isvg src={exitUrl} alt="Exit Preferences" />
1717
</button>
1818
</div>
1919
);

shared/containers/App/App.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ class App extends React.Component {
2020
openPreferences={this.props.openPreferences}
2121
isPreferencesShowing = {this.props.preferences.isPreferencesShowing}
2222
/>
23+
<Preferences
24+
isPreferencesShowing = {this.props.preferences.isPreferencesShowing}
25+
closePreferences={this.props.closePreferences}/>
2326
<Editor
2427
content={this.props.file.content}
2528
updateFile={this.props.updateFile} />
@@ -29,9 +32,6 @@ class App extends React.Component {
2932
<link type='text/css' rel='stylesheet' href='preview-styles.css' />
3033
}
3134
isPlaying={this.props.ide.isPlaying}/>
32-
<Preferences
33-
isPreferencesShowing = {this.props.preferences.isPreferencesShowing}
34-
closePreferences={this.props.closePreferences}/>
3535
</div>
3636
);
3737
}

styles/abstracts/_placeholders.scss

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
%toolbar-button {
2-
background-color: $light-button-background-color;
3-
color: $light-button-color;
1+
%button {
42
display: inline-block;
53
height: #{44 / $base-font-size}rem;
64
width: #{44 / $base-font-size}rem;
@@ -10,11 +8,15 @@
108
cursor: pointer;
119
border: none;
1210
outline: none;
11+
}
1312

13+
%toolbar-button {
14+
@extend %button;
15+
background-color: $light-button-background-color;
16+
color: $light-button-color;
1417
& g {
1518
fill: $light-toolbar-button-color;
1619
}
17-
1820
&:hover {
1921
background-color: $light-button-background-hover-color;
2022
color: $light-button-hover-color;
@@ -30,3 +32,18 @@
3032
}
3133
}
3234
}
35+
36+
%preferences-button {
37+
@extend %button;
38+
background-color: $light-preferences-button-background-color;
39+
& g {
40+
fill: $light-preferences-button-color;
41+
}
42+
&:hover {
43+
background-color: $light-preferences-button-background-color;
44+
45+
& g {
46+
fill: $light-preferences-button-hover-color;
47+
}
48+
}
49+
}

styles/abstracts/_variables.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,9 @@ $dark-button-active-color: $white;
3535
$editor-border-color: #f4f4f4;
3636
$editor-selected-line-color: #f3f3f3;
3737

38-
$preferences-background-color: #f4f4f4;
38+
$light-preferences-background-color: #f4f4f4;
39+
40+
$light-preferences-button-color: #8e8e8f;
41+
$light-preferences-button-hover-color: #333333;
42+
43+
$light-preferences-button-background-color: #e6e6e6;

styles/components/_preferences.scss

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
.preferences {
2-
background-color: $preferences-background-color;
2+
background-color: $light-preferences-background-color;
33
display: none;
44
&--selected {
55
display: flex;
66
}
77
}
88

99
.preferences__exit-button {
10-
background-color: $light-button-background-color;
11-
color: $light-button-color;
12-
display: inline-block;
13-
height: #{44 / $base-font-size}rem;
14-
width: #{44 / $base-font-size}rem;
15-
text-align: center;
16-
line-height: #{50 / $base-font-size}rem;
17-
cursor: pointer;
18-
border: none;
19-
outline: none;
10+
@extend %preferences-button;
2011
margin-left: auto;
12+
background-color: $light-preferences-background-color;
13+
14+
&:hover {
15+
background-color: $light-preferences-background-color;
16+
}
2117
}

0 commit comments

Comments
 (0)