Skip to content

Commit

Permalink
Refactored className usage for InlineTextButton
Browse files Browse the repository at this point in the history
They are changed to use rootClassName for consistency
and protection against future bundling order changes.
  • Loading branch information
Gnito committed Feb 19, 2019
1 parent d2b1db8 commit b1eb69f
Show file tree
Hide file tree
Showing 22 changed files with 32 additions and 18 deletions.
2 changes: 2 additions & 0 deletions src/components/ManageListingCard/ManageListingCard.css
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
}

.menuItem {
@apply --marketplaceLinkStyles;
@apply --marketplaceH5FontStyles;
color: var(--matterColorLight);
font-weight: var(--fontWeightMedium);
Expand Down Expand Up @@ -269,6 +270,7 @@
}

.title {
@apply --marketplaceLinkStyles;
/* Font */
@apply --marketplaceH3FontStyles;
color: var(--matterColor);
Expand Down
4 changes: 2 additions & 2 deletions src/components/ManageListingCard/ManageListingCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export const ManageListingCardComponent = props => {
<MenuContent rootClassName={css.menuContent}>
<MenuItem key="close-listing">
<InlineTextButton
className={menuItemClasses}
rootClassName={menuItemClasses}
onClick={event => {
event.preventDefault();
event.stopPropagation();
Expand Down Expand Up @@ -315,7 +315,7 @@ export const ManageListingCardComponent = props => {
<div className={css.mainInfo}>
<div className={css.titleWrapper}>
<InlineTextButton
className={titleClasses}
rootClassName={titleClasses}
onClick={event => {
event.preventDefault();
event.stopPropagation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ exports[`ManageListingCard matches snapshot 1`] = `
rootClassName=""
>
<InlineTextButton
className=""
onClick={[Function]}
rootClassName=""
>
<FormattedMessage
id="ManageListingCard.closeListing"
Expand Down Expand Up @@ -109,8 +109,8 @@ exports[`ManageListingCard matches snapshot 1`] = `
<div>
<div>
<InlineTextButton
className=""
onClick={[Function]}
rootClassName=""
>
<span
key="1"
Expand Down
2 changes: 1 addition & 1 deletion src/components/ModalMissingInformation/EmailReminder.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const EmailReminder = props => {
const email = user.id ? <span className={css.email}>{user.attributes.email}</span> : '';

const resendEmailLink = (
<InlineTextButton className={css.helperLink} onClick={onResendVerificationEmail}>
<InlineTextButton rootClassName={css.helperLink} onClick={onResendVerificationEmail}>
<FormattedMessage id="ModalMissingInformation.resendEmailLinkText" />
</InlineTextButton>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
}

.helperLink {
@apply --marketplaceLinkStyles;
@apply --marketplaceModalHelperLink;
}

Expand Down
3 changes: 3 additions & 0 deletions src/components/SearchFiltersPanel/SearchFiltersPanel.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
}

.resetAllButton {
@apply --marketplaceLinkStyles;
@apply --marketplaceH5FontStyles;
font-weight: var(--fontWeightMedium);
color: var(--matterColorAnti);
Expand All @@ -33,6 +34,7 @@
}

.cancelButton {
@apply --marketplaceLinkStyles;
@apply --marketplaceH5FontStyles;
font-weight: var(--fontWeightMedium);
color: var(--matterColorAnti);
Expand All @@ -50,6 +52,7 @@
}

.applyButton {
@apply --marketplaceLinkStyles;
@apply --marketplaceH5FontStyles;
font-weight: var(--fontWeightMedium);

Expand Down
6 changes: 3 additions & 3 deletions src/components/SearchFiltersPanel/SearchFiltersPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ class SearchFiltersPanelComponent extends Component {
<div className={classes}>
<div className={css.filtersWrapper}>{/* Add filters here */}</div>
<div className={css.footer}>
<InlineTextButton className={css.resetAllButton} onClick={this.resetAll}>
<InlineTextButton rootClassName={css.resetAllButton} onClick={this.resetAll}>
<FormattedMessage id={'SearchFiltersPanel.resetAll'} />
</InlineTextButton>
<InlineTextButton className={css.cancelButton} onClick={this.cancelFilters}>
<InlineTextButton rootClassName={css.cancelButton} onClick={this.cancelFilters}>
<FormattedMessage id={'SearchFiltersPanel.cancel'} />
</InlineTextButton>
<InlineTextButton className={css.applyButton} onClick={this.applyFilters}>
<InlineTextButton rootClassName={css.applyButton} onClick={this.applyFilters}>
<FormattedMessage id={'SearchFiltersPanel.apply'} />
</InlineTextButton>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/TabNavHorizontal/TabNavHorizontal.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
}

.tabContent {
@apply --marketplaceLinkStyles;
display: flex;
flex-direction: column;
justify-content: flex-end;
Expand Down
2 changes: 1 addition & 1 deletion src/components/TabNavHorizontal/TabNavHorizontal.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Tab = props => {
return (
<div className={className}>
{isButton ? (
<InlineTextButton className={buttonClasses} onClick={onClick}>
<InlineTextButton rootClassName={buttonClasses} onClick={onClick}>
{text}
</InlineTextButton>
) : (
Expand Down
1 change: 1 addition & 0 deletions src/components/TopbarDesktop/TopbarDesktop.css
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@
}

.logoutButton {
@apply --marketplaceLinkStyles;
/* Font is specific to this component */
@apply --marketplaceH4FontStyles;
font-size: 14px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/TopbarDesktop/TopbarDesktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const TopbarDesktop = props => {
</NamedLink>
</MenuItem>
<MenuItem key="logout">
<InlineTextButton className={css.logoutButton} onClick={onLogout}>
<InlineTextButton rootClassName={css.logoutButton} onClick={onLogout}>
<span className={css.menuItemBorder} />
<FormattedMessage id="TopbarDesktop.logout" />
</InlineTextButton>
Expand Down
1 change: 1 addition & 0 deletions src/components/TopbarMobileMenu/TopbarMobileMenu.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
}

.logoutButton {
@apply --marketplaceLinkStyles;
/* Logout font is smaller and gray since the action is not recommended. */
@apply --marketplaceH3FontStyles;
color: var(--matterColorAnti);
Expand Down
2 changes: 1 addition & 1 deletion src/components/TopbarMobileMenu/TopbarMobileMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const TopbarMobileMenu = props => {
<span className={css.greeting}>
<FormattedMessage id="TopbarMobileMenu.greeting" values={{ displayName }} />
</span>
<InlineTextButton className={css.logoutButton} onClick={onLogout}>
<InlineTextButton rootClassName={css.logoutButton} onClick={onLogout}>
<FormattedMessage id="TopbarMobileMenu.logoutLink" />
</InlineTextButton>
<NamedLink
Expand Down
2 changes: 2 additions & 0 deletions src/components/UserCard/UserCard.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
}

.showMore {
@apply --marketplaceLinkStyles;
@apply --marketplaceH4FontStyles;
margin: 0 0 0 5px;
}
Expand Down Expand Up @@ -116,6 +117,7 @@
}

.contact {
@apply --marketplaceLinkStyles;
@apply --marketplaceH4FontStyles;
margin: 0;
}
4 changes: 2 additions & 2 deletions src/components/UserCard/UserCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ExpandableBio extends Component {
this.setState({ expand: true });
};
const showMore = (
<InlineTextButton className={css.showMore} onClick={handleShowMoreClick}>
<InlineTextButton rootClassName={css.showMore} onClick={handleShowMoreClick}>
<FormattedMessage id="UserCard.showFullBioLink" />
</InlineTextButton>
);
Expand Down Expand Up @@ -86,7 +86,7 @@ const UserCard = props => {
const separator = isCurrentUser ? null : <span className={css.linkSeparator}></span>;

const contact = (
<InlineTextButton className={css.contact} onClick={handleContactUserClick}>
<InlineTextButton rootClassName={css.contact} onClick={handleContactUserClick}>
<FormattedMessage id="UserCard.contactUser" />
</InlineTextButton>
);
Expand Down
1 change: 1 addition & 0 deletions src/containers/AuthenticationPage/AuthenticationPage.css
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@

/* Helper links */
.modalHelperLink {
@apply --marketplaceLinkStyles;
@apply --marketplaceModalHelperLink;
}

Expand Down
2 changes: 1 addition & 1 deletion src/containers/AuthenticationPage/AuthenticationPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export class AuthenticationPageComponent extends Component {
const email = <span className={css.email}>{user.attributes.email}</span>;

const resendEmailLink = (
<InlineTextButton className={css.modalHelperLink} onClick={onResendVerificationEmail}>
<InlineTextButton rootClassName={css.modalHelperLink} onClick={onResendVerificationEmail}>
<FormattedMessage id="AuthenticationPage.resendEmailLinkText" />
</InlineTextButton>
);
Expand Down
1 change: 1 addition & 0 deletions src/containers/ListingPage/ListingPage.css
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@
}

.contactLink {
@apply --marketplaceLinkStyles;
@apply --marketplaceH4FontStyles;
margin: 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/ListingPage/SectionHeading.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const SectionHeading = props => {
{showContactUser ? (
<span className={css.contactWrapper}>
<span className={css.separator}></span>
<InlineTextButton className={css.contactLink} onClick={onContactUser}>
<InlineTextButton rootClassName={css.contactLink} onClick={onContactUser}>
<FormattedMessage id="ListingPage.contactUser" />
</InlineTextButton>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
}

.helperLink {
@apply --marketplaceLinkStyles;
@apply --marketplaceModalHelperLink;
}

Expand Down
4 changes: 2 additions & 2 deletions src/containers/PasswordRecoveryPage/PasswordRecoveryPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ export const PasswordRecoveryPageComponent = props => {
});

const resendEmailLink = (
<InlineTextButton className={css.helperLink} onClick={() => onSubmitEmail(submittedEmail)}>
<InlineTextButton rootClassName={css.helperLink} onClick={() => onSubmitEmail(submittedEmail)}>
<FormattedMessage id="PasswordRecoveryPage.resendEmailLinkText" />
</InlineTextButton>
);

const fixEmailLink = (
<InlineTextButton className={css.helperLink} onClick={onRetypeEmail}>
<InlineTextButton rootClassName={css.helperLink} onClick={onRetypeEmail}>
<FormattedMessage id="PasswordRecoveryPage.fixEmailLinkText" />
</InlineTextButton>
);
Expand Down
2 changes: 1 addition & 1 deletion src/forms/PayoutDetailsForm/PayoutDetailsFormCompany.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ const PayoutDetailsFormCompanyComponent = ({ fieldRenderProps }) => {
<React.Fragment>
<InlineTextButton
type="button"
className={css.fieldArrayAdd}
rootClassName={css.fieldArrayAdd}
onClick={() => push('company.additionalOwners', undefined)}
>
<span className={css.additionalOwnerLabel}>
Expand Down

0 comments on commit b1eb69f

Please sign in to comment.