implement ui support for anonymous login https://github.com/umputun/remark/issues/279

This commit is contained in:
Vyrtsev Mikhail
2019-03-25 01:25:47 +03:00
parent 13f914f58c
commit 24ea8805bb
24 changed files with 324 additions and 58 deletions
+18 -7
View File
@@ -62,10 +62,25 @@ export class Button extends Component<JSX.HTMLAttributes & Props, State> {
this.props.onFocus!(e);
}
render(props: RenderableProps<Props>, state: State) {
const { children } = props;
render(props: RenderableProps<JSX.HTMLAttributes & Props>, state: State) {
const { children, className } = props;
const { isClicked, isFocused } = state;
let rclassName = b(
'button',
{ mix: props.mix },
{ theme: props.theme, type: props.type, kind: props.kind, clicked: isClicked, focused: isFocused }
);
if (className) {
rclassName +=
' ' +
b(
className,
{},
{ theme: props.theme, type: props.type, kind: props.kind, clicked: isClicked, focused: isFocused }
);
}
const localProps = { ...props };
delete localProps.children;
delete localProps.mix;
@@ -73,11 +88,7 @@ export class Button extends Component<JSX.HTMLAttributes & Props, State> {
return (
<button
{...localProps}
className={b(
'button',
{ mix: props.mix },
{ theme: props.theme, type: props.type, kind: props.kind, clicked: isClicked, focused: isFocused }
)}
className={rclassName}
onMouseDown={this.onMouseDown}
onBlur={this.onBlur}
onFocus={this.onFocus}