🧊 Adds a reusable Input element

This commit is contained in:
Alicia Sykes
2022-06-12 15:37:39 +01:00
parent 9b8f5d2b40
commit 11506277a7
3 changed files with 130 additions and 2 deletions

View File

@@ -1,5 +1,39 @@
import { useState } from 'react';
import styled from 'styled-components';
import colors from 'styles/colors';
import Input from 'components/Form/Input'
const HomeContainer = styled.section`
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
height: 100%;
`;
const Home = (): JSX.Element => <div>Home Page</div>;
const UserInputMain = styled.div`
background: ${colors.backgroundLighter};
border-radius: 8px;
padding: 1rem;
`;
const Home = (): JSX.Element => {
const [userInput, setUserInput] = useState('');
return (
<HomeContainer>
<UserInputMain>
<Input
id="user-input"
value={userInput}
label="Enter an IP or URL"
size="large"
orientation="vertical"
handleChange={(e) => setUserInput(e.target.value)}
/>
<p>{ userInput }</p>
</UserInputMain>
</HomeContainer>
);
}
export default Home;