Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alextranwork committed Aug 26, 2020
1 parent bdffecc commit d54eb8f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
12 changes: 5 additions & 7 deletions src/Form/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react';
import React, { Component, ComponentProps } from 'react';
import styled, { css } from 'styled-components';
import { Field } from './Field';
import StyledLabel from './Label';
Expand Down Expand Up @@ -29,13 +29,11 @@ export interface InputProps {
placeholder?: string;
multiline?: boolean;
label?: any;
autofocus?: any;
autoFocus?: boolean;
transformOnBlur?: any;
onFocus?: any;
onBlur?: any;
onChange?: any;
autoFocus?: boolean;
maxLength?: number;
onKeyDown?: any;
minRows?: number;
rows?: number;
Expand Down Expand Up @@ -242,7 +240,7 @@ export class InputClass extends Component<InputProps, any> {
}

componentDidMount() {
if (this.props.autofocus && this.ref.current) {
if (this.props.autoFocus && this.ref.current) {
this.ref.current.focus();
}

Expand Down Expand Up @@ -344,7 +342,7 @@ export class InputClass extends Component<InputProps, any> {
label,
multiline,
autogrow,
autofocus,
autoFocus,
id,
error,
floating,
Expand Down Expand Up @@ -428,4 +426,4 @@ export class InputClass extends Component<InputProps, any> {
}
}

export const Input = createEasyInput<InputProps & EasyInputProps>(InputClass);
export const Input = createEasyInput<ComponentProps<typeof StyledInput> & EasyInputProps>(InputClass);
4 changes: 2 additions & 2 deletions src/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export const Icon = createComponent<IconProps, 'i'>({
props: ({ name }) => ({
className: `mdi mdi-${name}`,
}),
style: ({ theme, size, color, disabled, onClick }: any) => {
const colorFromTheme = theme.colors[color];
style: ({ theme, size, color, disabled, onClick }) => {
const colorFromTheme = color ? theme.colors[color] : '';
const resolvedColor = colorFromTheme || color;

return css`
Expand Down
2 changes: 2 additions & 0 deletions src/Modal/Modal.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ export const LongContent = () => (
export const DropdownTrigger = () => <ModalDropdownExample body="I'm triggered by a dropdown" />;

export const NoAutoFocus = () => <ModalNoAutoFocusExample body="I'm triggered by a dropdown" />;

export const TitleElement = () => <ModalNoAutoFocusExample title={<h1>Hello world</h1>} />;
2 changes: 1 addition & 1 deletion src/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface ModalProps {
animationOut?: string;
animationDuration?: number;
onClose?: any;
title?: string;
title?: string | JSX.Element;
}

const ModalContainer = createComponent({
Expand Down

0 comments on commit d54eb8f

Please sign in to comment.