Skip to content

Commit

Permalink
Merge pull request #31 from Vizzuality/feature/language-selector
Browse files Browse the repository at this point in the history
Feature/language selector
  • Loading branch information
davidsingal authored Aug 1, 2019
2 parents 1eaa7c0 + ee5a8a2 commit 8f6463b
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 43 deletions.
22 changes: 4 additions & 18 deletions src/components/button/style.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,10 @@
cursor: pointer;
}

&:focus {
border-color: $primary;
}

&.background {
background-color: $primary;
color:$white;
&:focus {
height: 26px;
width: 124.8px;
border: 2px solid $white;
opacity: 0.4;
border-radius: 15px;
}

&.contrast {
background-color: $white;
color: $primary;
Expand All @@ -41,15 +31,14 @@
}

&.transparent {
border-color: rgba(0, 133, 127, 0.2);
border-color: rgba(0, 133, 127, 0.4);
background-color: transparent;
color: $primary;

&:hover {
border: 2px solid rgba(0, 133, 127, 0.4);
}
&:focus {
border-color: $primary;
}

&.contrast {
color: $white;
}
Expand All @@ -59,9 +48,6 @@
&:hover {
border-color: rgba(0,0,0,0.4);
}
&:focus {
border-color: $body-color;
}
}
}

Expand Down
20 changes: 14 additions & 6 deletions src/components/buttonGroup/style.module.scss
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
@import '../../styles/vars';

.container {
display: inline-flex;
border: 2px solid rgba(0,0,0,0.2);
height: 30px;
display: inline-flex;
position: relative;
height: 26px;
border-radius: 15px;

* {
button {
display: block;
position: relative;
margin: -2px;
border: none;
text-align: center;
color: $body-color;

&:focus {
border-radius: 15px;
text-align: center;
border: 2px solid white;
margin: -2px;
height: 30px;
background-color: $white;
color: $primary;
}
border-bottom: 3px solid white;;

}
}
}
10 changes: 5 additions & 5 deletions src/components/spinner/style.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
.loader {
position: relative;
margin: auto;
border: 16px solid rgba(0, 133, 127, .1);
border-top: 16px solid $primary;
border: 8px solid rgba(0, 133, 127, .1);
border-top: 8px solid $primary;
opacity: 0.4;
border-radius: 50%;
width: 120px;
height: 120px;
animation: loading 3s linear infinite;
width: 40px;
height: 40px;
animation: loading 2s linear infinite;

@keyframes loading {
0% { transform: rotate(0deg); }
Expand Down
29 changes: 16 additions & 13 deletions src/components/widget/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ class Widget extends PureComponent {
toggleCollapse: PropTypes.func
};

static defaultProps = {
isActive: false,
isCollapsed: false,
layerId: null,
layersIds: null,
toggleActive: () => { },
toggleCollapse: () => { }
};
static defaultProps = {
isActive: false,
isCollapsed: false,
layerId: null,
layersIds: null,
toggleActive: () => { },
toggleCollapse: () => { }
};


activeToggleHandler = () => {
Expand All @@ -49,7 +49,7 @@ static defaultProps = {

render() {
const { isLoading } = this.props;
const { name, widgetConfig, isCollapsed, isActive, layerId, children, id, slug } = this.props;
const { name, widgetConfig, isCollapsed, isActive, layerId, children, id, slug, ...props } = this.props;

const widgetData = widgetConfig.parse({});

Expand All @@ -74,26 +74,29 @@ static defaultProps = {
{name}
</button>
{layerId && (
<Button isActive={isActive} onClick={this.activeToggleHandler}>
<Button
hasBackground={isActive}
hasContrast={!isActive}
isActive={isActive}
onClick={this.activeToggleHandler}
>
{isActive ? 'Hide layer' : 'Show layer'}
</Button>
)}
</div>

{isLoading && <Spinner isLoading />}

<div className={classnames(styles.content)}>
{children({
id,
name,
slug,
isCollapsed,
data: widgetData,
...props
})}
</div>
</div>
);
}
}

export default Widget;
3 changes: 2 additions & 1 deletion src/components/widgets/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ class WidgetList extends PureComponent {
<div className={styles.actionBar}>
{
isCollapsed
? <Button isTransparent isGrey onClick={this.onClickExpandAll}>Expand all widgets</Button>
? <Button hasBackground hasContrast onClick={this.onClickExpandAll}>Expand all widgets</Button>
: <Button isTransparent isGrey onClick={this.onClickCollapseAll}>Collapse all widgets</Button>
}

</div>
{widgets.map(widget => (
<Widget
Expand Down
2 changes: 2 additions & 0 deletions src/components/widgets/style.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
}

.actionBar {
display: flex;
justify-content: space-between;
margin-bottom: 20px;
}

0 comments on commit 8f6463b

Please # to comment.