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

fix: error messages positioning and font size #96

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/components/InputField/InputField.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}

.error-message {
@apply text-error text-12 font-regular font-inter tracking-semi-wide leading-16;
@apply text-error absolute -bottom-xl;
Copy link
Contributor

@Safei-Ashraf Safei-Ashraf Feb 8, 2023

Choose a reason for hiding this comment

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

adjust spacing to be -24px instead of -32px, equivalent class named 'lrg' instead of 'xl'
and error line-height to be 16px instead of 32px (maybe another typography component? idk)
would make it look closer to mockup,
if you agreed to change that but the mockup is out of date, ignore my review 😀
Attached is the input screenshot with my suggested changes

Copy link
Contributor

Choose a reason for hiding this comment

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

image

}

.disabled {
Expand Down
11 changes: 7 additions & 4 deletions src/components/InputField/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import styles from './InputField.module.css';

import { IInputFieldProps } from './IInputField.d';
import { BaseIcon } from '../IconButton/BaseIcon';
import { Typography } from '../Typography';

const InputField: FC<IInputFieldProps> = ({
label,
Expand Down Expand Up @@ -40,7 +41,7 @@ const InputField: FC<IInputFieldProps> = ({
});

return (
<div className="flex flex-col">
<div className="flex flex-col relative">
{label ? (
<label htmlFor={id} className={labelClasses}>
{label}
Expand Down Expand Up @@ -74,9 +75,11 @@ const InputField: FC<IInputFieldProps> = ({
<input id={id} className={inputClasses} {...inputProps} />
)}
</div>
{errorMessage ? (
<span className={styles['error-message']}>{errorMessage}</span>
) : null}
{errorMessage && (
<Typography variant="body1" className={styles['error-message']}>
{errorMessage}
</Typography>
)}
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/SelectInput/SelectInput.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}

.error-message {
@apply text-error text-12 font-regular font-inter tracking-semi-wide leading-16;
@apply text-error absolute -bottom-xl;
Copy link
Contributor

Choose a reason for hiding this comment

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

same changes as src/components/InputField/InputField.module.css Review

}

.disabled {
Expand Down
9 changes: 6 additions & 3 deletions src/components/SelectInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { FC } from 'react';
import styles from './SelectInput.module.css';

import { ISelectInputProps } from './ISelectInput.d';
import { Typography } from '../Typography';

const SelectInput: FC<ISelectInputProps> = ({
id,
Expand Down Expand Up @@ -47,10 +48,12 @@ const SelectInput: FC<ISelectInputProps> = ({
);
})}
</select>
{errorMessage && (
<Typography variant="body1" className={styles['error-message']}>
{errorMessage}
</Typography>
)}
</div>
{errorMessage && (
<span className={styles['error-message']}>{errorMessage}</span>
)}
</>
);
};
Expand Down