Skip to content

Commit

Permalink
use COLORS, and get rid of bundled TextInput component; directly rend…
Browse files Browse the repository at this point in the history
…er separate components
  • Loading branch information
ccatherinetan committed Oct 19, 2023
1 parent 38cf862 commit 421e0c1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
14 changes: 10 additions & 4 deletions src/app/input-text/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
'use client';

import TextInput from '@/components/TextInput/TextInput';
import React from 'react';
import { InputTitleText, InputText } from '../../components/TextInput/styles';

export default function InputText() {
return <TextInput />;
}
export default function InputTextTest() {
return (
<>
<InputTitleText>Label</InputTitleText>
<InputText $error={false} placeholder="Input Suggestion"/>
</>
)
}
11 changes: 0 additions & 11 deletions src/components/TextInput/TextInput.tsx

This file was deleted.

8 changes: 4 additions & 4 deletions src/components/TextInput/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export const InputText = styled.input<{ $error: boolean }>`
font-size: 1rem; // 16px
font-family: ${inter.style};
font-weight: 400;
line-height: 19.2px;
line-height: 19.2px;
word-wrap: break-word;
padding: 10px 20px 10px 20px;
padding: 0.625rem 1.25rem; // 10px 20px 10px 20px;
border-radius: 5px;
border: 1px solid
${({ $error }) => ($error ? COLORS.errorColor : COLORS.existingInputColor)};
Expand All @@ -23,7 +23,7 @@ export const InputText = styled.input<{ $error: boolean }>`
&:focus {
outline: none !important;
border: 1px solid
border: 2px solid
${({ $error }) => ($error ? COLORS.errorColor : COLORS.activeGreen)};
}
&::placeholder {
Expand All @@ -32,7 +32,7 @@ export const InputText = styled.input<{ $error: boolean }>`
}
`;
export const InputTitleText = styled.label`
color: #555555;
color: ${COLORS.existingInputColor};
font-size: 1.5rem; // 24px;
font-family: ${inter.style};
font-weight: 500;
Expand Down

0 comments on commit 421e0c1

Please sign in to comment.