Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring Default textarea size #73

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,24 @@ const Textarea = styled(TextareaAutosize)<ExampleTextProps>`
border: 0;
resize: none;
flex-grow: 1;
color: ${props => (props.theme.main === 'dark' ? '#fff' : '#14213d')};
color: ${(props) => (props.theme.main === "dark" ? "#fff" : "#14213d")};
background-color: transparent;
font-family: ${props =>
props.theme && props.theme.font ? props.theme.font : 'Roboto'};
font-size: ${props => (props.smallerFont ? '1.2em' : '1.61em')};
${props => (props.showCopyCursor ? 'cursor: text;' : '')};
font-family: ${(props) =>
props.theme && props.theme.font ? props.theme.font : "Roboto"};
font-size: ${(props) => (props.smallerFont ? "1.2em" : "1.61em")};
${(props) => (props.showCopyCursor ? "cursor: text;" : "")};
width: 100%;
min-height: 64px;

@media (max-width: 720px) {
min-height: auto;
}

::placeholder {
color: ${props =>
props.theme.main === 'dark'
? 'hsl(221, 51%, 64%)'
: 'rgba(20, 33, 61, 0.4)'};
color: ${(props) =>
props.theme.main === "dark"
? "hsl(221, 51%, 64%)"
: "rgba(20, 33, 61, 0.4)"};
}

:focus {
Expand Down Expand Up @@ -119,7 +124,8 @@ export interface Props extends HTMLAttributes<HTMLDivElement> {
maxContentLength?: number;
}

export const InOutTextarea: FC<Props> = props => {
export const InOutTextarea: FC<Props> = (props) => {
return
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should be removed I believe

const [menuOptions, setMenuOptions] = useState<InOptions>([]);
const [menuOutOptions, setMenuOutOptions] = useState<OutOptions>([]);
const [inOptionsMenuRef, inOptionsMenuRefSizes] = useDimensions({
Expand Down Expand Up @@ -248,7 +254,6 @@ export const InOutTextarea: FC<Props> = props => {
<Textarea
data-test="from-textarea"
placeholder="..."
rows={2}
smallerFont={false}
value={inValue}
maxLength={maxContentLength}
Expand All @@ -266,7 +271,7 @@ export const InOutTextarea: FC<Props> = props => {
<IconX size={32} />
</IconContainer>
</TextAreaContent>
<TextAreaContent>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert that?

</TextAreaContent>
<TextAreaWrapper>
<Textarea
disabled
Expand All @@ -283,5 +288,7 @@ export const InOutTextarea: FC<Props> = props => {
</TextAreaContent>
</ConvertCardContent>
</ConvertCard>
</TextAreaContent>
</>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two lines have to be deleted

);
};