You've already forked homehub
Release 1.3.0
This commit is contained in:
20
packages/homehub_components/src/FatalError.js
Normal file
20
packages/homehub_components/src/FatalError.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import {IconArrowsExclamation, Icon} from '@bthlabs/homehub-icons';
|
||||
import ClassName from 'classnames';
|
||||
import React from 'react';
|
||||
|
||||
export const FatalError = (props) => {
|
||||
const className = ClassName('FatalError', props.className);
|
||||
|
||||
return (
|
||||
<div className={className}>
|
||||
<Icon icon={IconArrowsExclamation} size="0.8rem" />
|
||||
<p>
|
||||
The service <code>{props.service.kind}:{props.service.instance}</code>
|
||||
{' '}
|
||||
has encountered an error:
|
||||
{' '}
|
||||
<code>{props.serviceState.error().message}</code>
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
21
packages/homehub_components/src/Widget.js
Normal file
21
packages/homehub_components/src/Widget.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import ClassName from 'classnames';
|
||||
import React from 'react';
|
||||
|
||||
export const Widget = (props) => {
|
||||
const className = ClassName('Widget', props.className);
|
||||
|
||||
const style = {};
|
||||
if (props.appearance) {
|
||||
if (props.appearance.color) {
|
||||
style.backgroundColor = props.appearance.color;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={className} style={style}>
|
||||
<div className="widget-content">
|
||||
{props.children}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
8
packages/homehub_components/src/index.js
Normal file
8
packages/homehub_components/src/index.js
Normal file
@@ -0,0 +1,8 @@
|
||||
/*!
|
||||
* BTHLabs HomeHub - Components (https://bthlabs.pl/)
|
||||
* Copyright 2021-present BTHLabs
|
||||
* Apache License Version 2.0
|
||||
*/
|
||||
|
||||
export {FatalError} from './FatalError';
|
||||
export {Widget} from './Widget';
|
||||
Reference in New Issue
Block a user