Skip to content

Commit

Permalink
feat(input): initial implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulFasola committed Mar 8, 2021
1 parent a4c15d1 commit 91a4e98
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/components/common/Input/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from 'react';
import { Outline, Input as StyledInput } from './style';

export enum IconType {
Sucess = 'success',
Failure = 'failure',
}

interface IInputElementProps {
maxLength: number;
minLength: number;
max: number;
min: number;
placeholder?: string;
value: string;
}

interface IProps extends IInputElementProps {
type: 'text' | 'number';
style?: React.CSSProperties;
}

const Input: React.FC<IProps> = (props) => {
return (
<Outline>
<StyledInput {...props} />
</Outline>
);
};

Input.defaultProps = {
type: 'text',
};

export { Input };
12 changes: 12 additions & 0 deletions src/components/common/Input/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import styled from 'styled-components';

export const Outline = styled.div``;

export const Input = styled.input`
outline: none;
width: 100%;
&:-moz-ui-invalid {
box-shadow: none !important;
}
`;

0 comments on commit 91a4e98

Please sign in to comment.