Add first rendition theme configs

Change-type: patch
Changelog-entry: Use rendition theme property for step buttons
Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzoa@balena.io>
This commit is contained in:
Lorenzo Alberto Maria Ambrosi 2019-05-22 10:37:35 +02:00
parent 33df23fc8c
commit 543ba51d3c
6 changed files with 42 additions and 34 deletions

View File

@ -65,7 +65,6 @@ const SelectImageButton = (props) => {
<Provider> <Provider>
<StepSelection> <StepSelection>
<StepButton <StepButton
primary
onClick={props.openImageSelector} onClick={props.openImageSelector}
> >
Select image Select image

View File

@ -138,7 +138,6 @@ class ProgressButton extends React.Component {
<Provider> <Provider>
<StepSelection> <StepSelection>
<StepButton <StepButton
primary
onClick= { this.props.callback } onClick= { this.props.callback }
disabled= { this.props.disabled } disabled= { this.props.disabled }
> >

View File

@ -46,12 +46,6 @@ svg-icon > img[disabled] {
position: relative; position: relative;
} }
.page-main .button-brick {
width: 200px;
height: 48px;
font-size: 16px;
}
.page-main .button-abort-write { .page-main .button-abort-write {
width: 20px; width: 20px;
height: 20px; height: 20px;
@ -67,6 +61,7 @@ svg-icon > img[disabled] {
width: 200px; width: 200px;
height: 48px; height: 48px;
font-size: 16px; font-size: 16px;
font-weight: 300;
} }
%step-border { %step-border {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2016 resin.io * Copyright 2018 resin.io
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -16,31 +16,50 @@
'use strict' 'use strict'
// eslint-disable-next-line no-unused-vars
const React = require('react')
const { default: styled } = require('styled-components') const { default: styled } = require('styled-components')
const { colors } = require('./theme') const { colors } = require('./theme')
const { const {
Button, Txt, Flex Button, Txt, Flex, Provider
} = require('rendition') } = require('rendition')
exports.StepButton = styled(Button) ` const theme = {
button: {
border: {
width: '0',
radius: '2px'
},
disabled: {
opacity: 1
},
extend: (props) => `
width: 200px; width: 200px;
height: 48px; min-height: 48px;
font-size: 16px; font-size: 16px;
margin: auto;
overflow: hidden;
border: none;
border-radius: 2px;
&:disabled { &:disabled {
background-color: ${colors.dark.disabled.background}; background-color: ${colors.dark.disabled.background};
color: ${colors.dark.disabled.foreground}; color: ${colors.dark.disabled.foreground};
opacity: 1; opacity: 1;
&:hover { &:hover {
background-color: ${colors.dark.disabled.background}; background-color: ${colors.dark.disabled.background};
color: ${colors.dark.disabled.foreground}; color: ${colors.dark.disabled.foreground};
} }
} }
` `
}
}
exports.StepButton = (props) => {
return (
<Provider theme={theme}>
<Button primary {...props}>
</Button>
</Provider>
)
}
exports.ChangeButton = styled(Button) ` exports.ChangeButton = styled(Button) `
color: ${colors.primary.background}; color: ${colors.primary.background};

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2016 resin.io * Copyright 2018 resin.io
* *
* Licensed under the Apache License, Version 2.0 (the "License"), * Licensed under the Apache License, Version 2.0 (the "License"),
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -6388,11 +6388,6 @@ svg-icon > img[disabled] {
.page-main .relative { .page-main .relative {
position: relative; } position: relative; }
.page-main .button-brick {
width: 200px;
height: 48px;
font-size: 16px; }
.page-main .button-abort-write { .page-main .button-abort-write {
width: 20px; width: 20px;
height: 20px; height: 20px;
@ -6406,7 +6401,8 @@ svg-icon > img[disabled] {
.button-brick { .button-brick {
width: 200px; width: 200px;
height: 48px; height: 48px;
font-size: 16px; } font-size: 16px;
font-weight: 300; }
.page-main .step-border-left, .page-main .step-border-right { .page-main .step-border-left, .page-main .step-border-right {
height: 2px; height: 2px;