Skip to content

Commit

Permalink
refactor: 💡 <Text />, required types and style for infoSmall
Browse files Browse the repository at this point in the history
  • Loading branch information
koepferd committed Feb 9, 2021
1 parent a630110 commit 470267f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/components/agencySelection/AgencySelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ export const AgencySelection = (props: AgencySelectionProps) => {
text={translate(
'profile.data.register.consultingModeInfo.groupChats'
)}
type="infoSmall"
/>
) : (
<>
Expand All @@ -202,6 +203,7 @@ export const AgencySelection = (props: AgencySelectionProps) => {
text={translate(
'profile.data.register.selectAgencyInfo'
)}
type="infoSmall"
/>
)}
{!props.preselectedAgency &&
Expand Down
3 changes: 2 additions & 1 deletion src/components/inputField/InputField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ export const InputField = (props: InputFieldProps) => {
) : null}
{inputItem.infoText && (
<Text
text={inputItem.infoText}
className="formWrapper__infoText"
text={inputItem.infoText}
type="infoSmall"
/>
)}
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/profile/AskerNewRegistration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export const AskerNewRegistration = () => {
text={translate(
'profile.data.register.consultingModeInfo.singleChats'
)}
type="infoSmall"
/>
</div>
) : (
Expand Down
1 change: 1 addition & 0 deletions src/components/registration/Registration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ const Registration = () => {
text={translate(
'registration.password.note'
)}
type="infoSmall"
/>
)}
{resortData.showEmail && (
Expand Down
9 changes: 6 additions & 3 deletions src/components/selectedAgencyInfo/SelectedAgencyInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ export const SelectedAgencyInfo = (props: SelectedAgencyInfoProps) => {
<div className="selectedAgencyInfo__teamAgency">
<InfoIcon className="selectedAgencyInfo__icon" />
<Text
text={translate('registration.agency.prefilled.isTeam')}
className="selectedAgencyInfo__text"
text={translate('registration.agency.prefilled.isTeam')}
type="infoSmall"
/>
</div>
</div>
Expand All @@ -47,8 +48,9 @@ export const SelectedAgencyInfo = (props: SelectedAgencyInfoProps) => {
}`}
>
<Text
text={props.prefix}
className="selectedAgencyInfo__text selectedAgencyInfo__overline"
text={props.prefix}
type="infoSmall"
/>
<p className="selectedAgencyInfo__agencyName">
{props.agencyData.name}
Expand All @@ -57,8 +59,9 @@ export const SelectedAgencyInfo = (props: SelectedAgencyInfoProps) => {
<div className="selectedAgencyInfo__teamAgency">
<InfoIcon className="selectedAgencyInfo__icon" />
<Text
text={translate('registration.agency.prefilled.isTeam')}
className="selectedAgencyInfo__text"
text={translate('registration.agency.prefilled.isTeam')}
type="infoSmall"
/>
</div>
)}
Expand Down
8 changes: 6 additions & 2 deletions src/components/text/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface TextProps {
text: string;
labelType?: LABEL_TYPES;
className?: string;
type?:
type:
| 'standard'
| 'infoLargeStandard'
| 'infoLargeAlternative'
Expand All @@ -32,7 +32,11 @@ const getLabelContent = (type: string) => {

export const Text = (props: TextProps) => {
return (
<p className={`text ${props.className ? props.className : ''}`}>
<p
className={`text text--${props.type} ${
props.className ? props.className : ''
}`}
>
{props.labelType && (
<span
className={
Expand Down
9 changes: 6 additions & 3 deletions src/components/text/text.styles.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
.text {
color: $tertiary;
font-size: $font-size-secondary;
line-height: $line-height-secondary;
text-align: left;
margin: 0;

&--infoSmall {
color: $tertiary;
font-size: $font-size-secondary;
line-height: $line-height-secondary;
}

&__label {
font-family: $font-family-medium;
font-weight: $font-weight-medium;
Expand Down

0 comments on commit 470267f

Please sign in to comment.