Skip to content

Commit

Permalink
loading indicator position changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
receptiryaki committed Apr 18, 2020
1 parent 77dbf72 commit 88224fd
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions src/app/containers/GithubRepoForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,15 @@ export function GithubRepoForm() {
<Wrapper>
<FormGroup onSubmit={onSubmitForm}>
<FormLabel>Github Username</FormLabel>
<Input
type="text"
placeholder="Type any Github username"
value={username}
onChange={onChangeUsername}
/>
<InputWrapper>
<Input
type="text"
placeholder="Type any Github username"
value={username}
onChange={onChangeUsername}
/>
{isLoading && <LoadingIndicator small />}
</InputWrapper>
</FormGroup>
{repos?.length > 0 ? (
<List>
Expand All @@ -75,8 +78,6 @@ export function GithubRepoForm() {
/>
))}
</List>
) : isLoading ? (
<LoadingIndicator small />
) : error ? (
<ErrorText>There is an error occurred!</ErrorText>
) : null}
Expand All @@ -91,14 +92,23 @@ const Wrapper = styled.div`
}
`;

const InputWrapper = styled.div`
display: flex;
align-items: center;
${Input} {
width: ${100 / 3}%;
margin-right: 0.5rem;
}
`;

const ErrorText = styled.span`
color: ${p => p.theme.text};
`;

const FormGroup = styled.form`
display: flex;
flex-direction: column;
width: ${100 / 3}%;
margin-bottom: 1rem;
${FormLabel} {
Expand Down

0 comments on commit 88224fd

Please sign in to comment.