Skip to content
Merged
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
5 changes: 3 additions & 2 deletions frontend/components/buttons/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export interface IButtonProps {
| "dialog";
ariaExpanded?: boolean;
ariaLabel?: string;
/** Small: 1/2 the padding */
size?: "small" | "default";
/** Small: 1/2 the padding, Wide: 200px */
size?: "small" | "wide" | "default";
}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
Expand Down Expand Up @@ -136,6 +136,7 @@ class Button extends React.Component<IButtonProps, IButtonState> {
className,
{
[`${baseClass}--${variant}__small`]: size === "small",
[`${baseClass}__wide`]: size === "wide",
[`${baseClass}--disabled`]: disabled,
[`${baseClass}--icon-stroke`]: iconStroke,
}
Expand Down
5 changes: 5 additions & 0 deletions frontend/components/buttons/Button/_styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -551,4 +551,9 @@ $base-class: "button";
right: -$pad-small;
margin-left: -$pad-small;
}

// Used in registration/auth pages
&__wide {
width: 200px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ const ConfirmInviteForm = ({
error={formErrors.password_confirmation}
parseTarget
/>
<div className="button-wrap">
<div className="button-wrap--center">
<Button
type="submit"
disabled={Object.keys(formErrors).length > 0}
className="confirm-invite-button"
size="wide"
>
Submit
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ class ForgotPasswordForm extends Component {
placeholder="Email"
type="email"
/>
<div className="button-wrap">
<div className="button-wrap--center">
<Button
className={`${baseClass}__submit-btn`}
type="submit"
isLoading={isLoading}
size="wide"
>
Get instructions
</Button>
Expand Down
4 changes: 0 additions & 4 deletions frontend/components/forms/ForgotPasswordForm/_styles.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.forgot-password-form {
width: 100%;

&__submit-btn {
width: 160px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,13 @@ class AdminDetails extends Component {
tabIndex={tabIndex}
label="Confirm password"
/>
<div className="button-wrap">
<Button type="submit" tabIndex={tabIndex} disabled={!currentPage}>
<div className="button-wrap--center">
<Button
type="submit"
tabIndex={tabIndex}
disabled={!currentPage}
size="wide"
>
Next
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,13 @@ const ConfirmationPage = ({
your instance. Sending usage statistics from your Fleet instance is
optional and can be disabled in settings.
</p>
<div className="button-wrap">
<div className="button-wrap--center">
<Button
type="submit"
tabIndex={tabIndex}
disabled={!currentPage}
isLoading={isLoading}
size="wide"
>
Confirm
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,4 @@
top: 0;
}
}

.button {
width: 160px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,13 @@ class FleetDetails extends Component {
this.firstInput = input;
}}
/>{" "}
<div className="button-wrap">
<Button type="submit" tabIndex={tabIndex} disabled={!currentPage}>
<div className="button-wrap--center">
<Button
type="submit"
tabIndex={tabIndex}
disabled={!currentPage}
size="wide"
>
Next
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,13 @@ class OrgDetails extends Component {
tabIndex={tabIndex}
helpText="Personalize Fleet with your brand. For best results, use a square image at least 150px wide, like https://fleetdm.com/logo.png."
/>
<div className="button-wrap">
<Button type="submit" tabIndex={tabIndex} disabled={!currentPage}>
<div className="button-wrap--center">
<Button
type="submit"
tabIndex={tabIndex}
disabled={!currentPage}
size="wide"
>
Next
</Button>
</div>
Expand Down
10 changes: 0 additions & 10 deletions frontend/components/forms/RegistrationForm/_styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,4 @@
margin: 0;
padding: 0;
}

&__field-wrapper {
.button-wrap {
justify-content: center;
}

.button {
width: 160px;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,8 @@ const ResetPasswordForm = ({
className={`${baseClass}__input`}
type="password"
/>
<div className="button-wrap">
<Button
type="submit"
onClick={onFormSubmit}
className={`${baseClass}__btn`}
>
<div className="button-wrap--center">
<Button type="submit" onClick={onFormSubmit} size="wide">
Reset password
</Button>
</div>
Expand Down
4 changes: 0 additions & 4 deletions frontend/components/forms/ResetPasswordForm/_styles.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
.reset-password-form {
width: 100%;

.button-wrap {
justify-content: center;
}

&__input {
width: 100%;
}
Expand Down
5 changes: 0 additions & 5 deletions frontend/pages/ConfirmInvitePage/_styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,4 @@
&__description {
margin: 0;
}

.confirm-invite-button {
align-self: center;
width: 160px;
}
}
8 changes: 5 additions & 3 deletions frontend/pages/NoAccessPage/NoAccessPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ const NoAccessPage = ({ router, orgContactUrl }: INoAccessPageProps) => {
.
</p>
</div>
<Button onClick={onBackToLogin} className={`${baseClass}__btn`}>
Back to login
</Button>
<div className="button-wrap--center">
<Button onClick={onBackToLogin} size="wide">
Back to login
</Button>
</div>
</AuthenticationFormWrapper>
);
};
Expand Down
6 changes: 0 additions & 6 deletions frontend/pages/RegistrationPage/_styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,4 @@
&__flash-message {
top: 180px;
}

.button-wrap {
button {
width: 200px;
}
}
}
11 changes: 9 additions & 2 deletions frontend/styles/global/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,17 @@ form,
margin: 0;
display: flex;
gap: $pad-medium;

&--center {
margin: 0;
display: flex;
gap: $pad-medium;
justify-content: center;
}
}

// Override button width to auto unless icon-only which has fixed widths
.button:not(.button--icon):not(.button--icon__small) {
// Override button width to auto unless icon-only or wide buttons which has fixed widths
.button:not(.button--icon):not(.button--icon__small):not(.button__wide) {
width: auto;
}

Expand Down
Loading