ux: move to minimal layout (#30327)

This commit is contained in:
Jordan Vidrine 2024-12-17 14:41:00 -06:00 committed by GitHub
parent 284fe89165
commit 85b45a8379
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 25 additions and 69 deletions

View File

@ -3,10 +3,7 @@ import { tracked } from "@glimmer/tracking";
import { concat } from "@ember/helper"; import { concat } from "@ember/helper";
import { action } from "@ember/object"; import { action } from "@ember/object";
import { service } from "@ember/service"; import { service } from "@ember/service";
import { eq } from "truth-helpers";
import concatClass from "discourse/helpers/concat-class"; import concatClass from "discourse/helpers/concat-class";
import dIcon from "discourse-common/helpers/d-icon";
import { i18n } from "discourse-i18n";
export default class SignupProgressBar extends Component { export default class SignupProgressBar extends Component {
@service siteSettings; @service siteSettings;
@ -22,10 +19,6 @@ export default class SignupProgressBar extends Component {
} }
} }
stepText(step) {
return i18n(`create_account.progress_bar.${step}`);
}
get currentStepIndex() { get currentStepIndex() {
return this.steps.findIndex((step) => step === this.args.step); return this.steps.findIndex((step) => step === this.args.step);
} }
@ -57,19 +50,8 @@ export default class SignupProgressBar extends Component {
> >
<div class="signup-progress-bar__step"> <div class="signup-progress-bar__step">
<div class="signup-progress-bar__circle"> <div class="signup-progress-bar__circle">
{{#if this.site.desktopView}}
{{#if (eq (this.getStepState index) "completed")}}
{{dIcon "check"}}
{{/if}}
{{/if}}
</div> </div>
{{#unless (eq index this.lastStepIndex)}}
<span class="signup-progress-bar__line"></span>
{{/unless}}
</div> </div>
<span class="signup-progress-bar__step-text">
{{this.stepText step}}
</span>
</div> </div>
{{/each}} {{/each}}
</div> </div>

View File

@ -1,15 +1,22 @@
$progress-bar-line-width: 2px; :root {
$progress-bar-circle-size: 1.2rem; --progress-bar-line-width: 1px;
$progress-bar-icon-size: 0.8rem; --progress-bar-circle-size: 0.5rem;
--progress-bar-icon-size: 0.25rem;
}
.signup-progress-bar { .signup-progress-bar {
width: 100%; width: auto;
display: flex; display: flex;
box-sizing: border-box; box-sizing: border-box;
margin-bottom: 1.2em; margin-bottom: 1.2em;
gap: 1rem;
.account-created &,
.activate-account & {
margin-inline: 0;
}
&__segment { &__segment {
width: 100%; width: auto;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 0.5rem; gap: 0.5rem;
@ -21,7 +28,7 @@ $progress-bar-icon-size: 0.8rem;
} }
&:last-child { &:last-child {
width: $progress-bar-circle-size; width: var(--progress-bar-circle-size);
.signup-progress-bar__circle { .signup-progress-bar__circle {
transform: translateX(-50%); transform: translateX(-50%);
z-index: 1; z-index: 1;
@ -33,66 +40,29 @@ $progress-bar-icon-size: 0.8rem;
display: flex; display: flex;
} }
&__step-text {
color: var(--primary-high);
white-space: nowrap;
width: fit-content;
transform: translateX(calc(calc($progress-bar-circle-size / 2) - 50%));
.signup-progress-bar__segment:first-child & {
transform: translateX(0%);
}
.signup-progress-bar__segment:last-child & {
transform: translateX(
calc(calc($progress-bar-circle-size + $progress-bar-line-width) - 100%)
);
}
.--active & {
font-weight: bold;
color: var(--primary);
}
}
&__line {
transform: translateY(
calc(calc($progress-bar-circle-size + $progress-bar-line-width) / 2)
);
height: $progress-bar-line-width;
width: 100%;
background-color: var(--primary-low-mid);
.--completed & {
background-color: var(--success);
}
}
&__circle { &__circle {
flex-shrink: 0; flex-shrink: 0;
font-size: $progress-bar-icon-size; font-size: var(--progress-bar-icon-size);
color: var(--secondary); color: var(--secondary);
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: $progress-bar-circle-size; height: var(--progress-bar-circle-size);
width: $progress-bar-circle-size; width: var(--progress-bar-circle-size);
transform: none;
border-radius: 50%; border-radius: 50%;
border: $progress-bar-line-width solid var(--primary-low-mid); border: var(--progress-bar-line-width) solid var(--primary-low-mid);
background-color: var(--secondary); background-color: var(--secondary);
.--active & { .--active & {
background-color: var(--success);
border-color: var(--success); border-color: var(--success);
background: var(--success); box-shadow: 0 0 1px calc(var(--progress-bar-circle-size) / 2)
box-shadow: 0 0 1px 5px var(--success-low); var(--success-low);
} }
.--completed & { .--completed & {
background-color: var(--success); background-color: var(--success);
border-color: var(--success); border-color: var(--success);
} }
} }
&__line.--completed {
background-color: var(--success);
}
} }

View File

@ -2,6 +2,10 @@
box-sizing: border-box; box-sizing: border-box;
padding: 1em; padding: 1em;
.signup-progress-bar {
margin: 0;
}
.invitation-cta { .invitation-cta {
display: flex; display: flex;
flex-direction: column; flex-direction: column;