name, value, and onchange props were added
This commit is contained in:
parent
adc559fdeb
commit
448356a343
@ -1,4 +1,4 @@
|
|||||||
import React from "react";
|
import React, { useState } from "react";
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
|
|
||||||
import TextInput from "@docspace/components/text-input";
|
import TextInput from "@docspace/components/text-input";
|
||||||
@ -19,19 +19,23 @@ const Label = styled.label`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const LabledInput = ({ label, placeholder }) => {
|
export const LabledInput = ({ label, placeholder, value, onChange, name }) => {
|
||||||
|
const [inputValue, setInputValue] = useState(value);
|
||||||
|
|
||||||
|
const handleChange = (e) => {
|
||||||
|
setInputValue(e.target.value);
|
||||||
|
onChange(e);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Label>
|
<Label>
|
||||||
<span>{label}</span>
|
<span>{label}</span>
|
||||||
<TextInput
|
<TextInput
|
||||||
id=""
|
name={name}
|
||||||
mask={null}
|
|
||||||
name=""
|
|
||||||
onBlur={() => {}}
|
|
||||||
onChange={function noRefCheck() {}}
|
|
||||||
onFocus={function noRefCheck() {}}
|
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
tabIndex={1}
|
tabIndex={1}
|
||||||
|
value={inputValue}
|
||||||
|
onChange={handleChange}
|
||||||
/>
|
/>
|
||||||
</Label>
|
</Label>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user