diff --git a/lib/gui/app/components/featured-project/featured-project.jsx b/lib/gui/app/components/featured-project/featured-project.jsx index b813197b..0fca321b 100644 --- a/lib/gui/app/components/featured-project/featured-project.jsx +++ b/lib/gui/app/components/featured-project/featured-project.jsx @@ -17,28 +17,25 @@ 'use strict' const React = require('react') +const propTypes = require('prop-types') const SafeWebview = require('../safe-webview/safe-webview.jsx') const settings = require('../../models/settings') const analytics = require('../../modules/analytics') -const endpoint = null class FeaturedProject extends React.Component { constructor (props) { super(props) this.state = { - endpoint + endpoint: null } } componentDidMount () { return settings.load() .then(() => { - if (settings.has('featuredProjectEndpoint')) { - this.setState({ endpoint: settings.get('featuredProjectEndpoint') }) - } else { - this.setState({ endpoint: 'https://assets.balena.io/etcher-featured/index.html' }) - } + const endpoint = settings.get('featuredProjectEndpoint') || 'https://assets.balena.io/etcher-featured/index.html' + this.setState({ endpoint }) }) .catch(analytics.logException) } @@ -53,4 +50,8 @@ class FeaturedProject extends React.Component { } } +FeaturedProject.propTypes = { + onWebviewShow: propTypes.func +} + module.exports = FeaturedProject diff --git a/lib/gui/app/components/reduced-flashing-infos/index.js b/lib/gui/app/components/reduced-flashing-infos/index.js new file mode 100644 index 00000000..4b1446e3 --- /dev/null +++ b/lib/gui/app/components/reduced-flashing-infos/index.js @@ -0,0 +1,34 @@ +/* + * Copyright 2016 resin.io + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict' + +/** + * @module Etcher.Components.ReducedFlashingInfos + */ + +const angular = require('angular') +const { react2angular } = require('react2angular') + +const MODULE_NAME = 'Etcher.Components.ReducedFlashingInfos' +const ReducedFlashingInfos = angular.module(MODULE_NAME, []) + +ReducedFlashingInfos.component( + 'reducedFlashingInfos', + react2angular(require('./reduced-flashing-infos.jsx')) +) + +module.exports = MODULE_NAME diff --git a/lib/gui/app/components/reduced-flashing-infos/reduced-flashing-infos.jsx b/lib/gui/app/components/reduced-flashing-infos/reduced-flashing-infos.jsx new file mode 100644 index 00000000..c9b2a2b5 --- /dev/null +++ b/lib/gui/app/components/reduced-flashing-infos/reduced-flashing-infos.jsx @@ -0,0 +1,68 @@ +/* + * Copyright 2016 resin.io + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict' + +const React = require('react') +const propTypes = require('prop-types') +const styled = require('styled-components').default +const SvgIcon = require('../svg-icon/svg-icon.jsx') + +const Div = styled.div ` + position: absolute; + top: 45px; + left: 550px; + + > span.step-name { + justify-content: flex-start; + + > span { + margin-left: 5px; + font-weight: normal; + } + } + + .svg-icon[disabled] { + opacity: 0.4; + } +` + +const ReducedFlashingInfos = (props) => { + return (props.shouldShow) ? ( +