Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature/language selector #31

Merged
merged 6 commits into from
Aug 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to define theme="c" or something like that

: <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;
}