-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
147 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 6 additions & 82 deletions
88
services/console/src/components/console/onboard/OnboardSteps.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,10 @@ | ||
import { For, type Accessor } from "solid-js"; | ||
import { BENCHER_WORDMARK } from "../../../util/ext"; | ||
import type { PlanLevel } from "../../../types/bencher"; | ||
|
||
interface Props { | ||
step: OnboardStep; | ||
plan?: Accessor<PlanLevel>; | ||
} | ||
|
||
export enum OnboardStep { | ||
API_TOKEN = 1, | ||
PROJECT = 2, | ||
RUN = 3, | ||
INVITE = 4, | ||
PLAN = 5, | ||
} | ||
|
||
const stepPath = (step: OnboardStep) => { | ||
switch (step) { | ||
case OnboardStep.API_TOKEN: | ||
return "/console/onboard/token"; | ||
case OnboardStep.PROJECT: | ||
return "/console/onboard/project"; | ||
case OnboardStep.RUN: | ||
return "/console/onboard/run"; | ||
case OnboardStep.INVITE: | ||
return "/console/onboard/invite"; | ||
case OnboardStep.PLAN: | ||
return "/console/onboard/plan"; | ||
} | ||
}; | ||
import { themeSignal } from "../../navbar/theme/util"; | ||
import OnboardStepsInner, { type Props } from "./OnboardStepsInner" | ||
|
||
const OnboardSteps = (props: Props) => { | ||
const stepHref = (step: OnboardStep) => { | ||
const path = stepPath(step); | ||
const plan = props.plan?.(); | ||
return plan ? `${path}?plan=${plan}` : path; | ||
}; | ||
const theme = themeSignal; | ||
|
||
return ( | ||
<section class="section"> | ||
<div class="container"> | ||
<div class="columns is-centered"> | ||
<div class="column is-half"> | ||
<div class="content has-text-centered"> | ||
<div title="Bencher - Continuous Benchmarking"> | ||
<img | ||
src={BENCHER_WORDMARK} | ||
width="150" | ||
height="28.25" | ||
alt="🐰 Bencher" | ||
/> | ||
</div> | ||
</div> | ||
<br /> | ||
<div class="steps"> | ||
<For | ||
each={[ | ||
OnboardStep.API_TOKEN, | ||
OnboardStep.PROJECT, | ||
OnboardStep.RUN, | ||
OnboardStep.INVITE, | ||
OnboardStep.PLAN, | ||
]} | ||
> | ||
{(step) => ( | ||
<div | ||
class={`step-item ${ | ||
props.step >= step ? " is-active is-primary" : "" | ||
}`} | ||
> | ||
<a class="step-marker" href={stepHref(step)}> | ||
{step} | ||
</a> | ||
</div> | ||
)} | ||
</For> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
); | ||
}; | ||
return <OnboardStepsInner {...props} theme={theme()} />; | ||
} | ||
|
||
export default OnboardSteps; | ||
export default OnboardSteps; |
7 changes: 7 additions & 0 deletions
7
services/console/src/components/console/onboard/OnboardStepsFallback.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import OnboardSteps, { type Props } from "./OnboardStepsInner" | ||
|
||
const OnboardStepsFallback = (props: Props) => { | ||
return <OnboardSteps {...props} />; | ||
} | ||
|
||
export default OnboardStepsFallback; |
87 changes: 87 additions & 0 deletions
87
services/console/src/components/console/onboard/OnboardStepsInner.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { For, type Accessor } from "solid-js"; | ||
import type { PlanLevel } from "../../../types/bencher"; | ||
import { Theme, themeWordmark } from "../../navbar/theme/theme"; | ||
|
||
export interface Props { | ||
theme?: Theme; | ||
step: OnboardStep; | ||
plan?: Accessor<PlanLevel>; | ||
} | ||
|
||
export enum OnboardStep { | ||
API_TOKEN = 1, | ||
PROJECT = 2, | ||
RUN = 3, | ||
INVITE = 4, | ||
PLAN = 5, | ||
} | ||
|
||
const stepPath = (step: OnboardStep) => { | ||
switch (step) { | ||
case OnboardStep.API_TOKEN: | ||
return "/console/onboard/token"; | ||
case OnboardStep.PROJECT: | ||
return "/console/onboard/project"; | ||
case OnboardStep.RUN: | ||
return "/console/onboard/run"; | ||
case OnboardStep.INVITE: | ||
return "/console/onboard/invite"; | ||
case OnboardStep.PLAN: | ||
return "/console/onboard/plan"; | ||
} | ||
}; | ||
|
||
const OnboardSteps = (props: Props) => { | ||
const stepHref = (step: OnboardStep) => { | ||
const path = stepPath(step); | ||
const plan = props.plan?.(); | ||
return plan ? `${path}?plan=${plan}` : path; | ||
}; | ||
|
||
return ( | ||
<section class="section"> | ||
<div class="container"> | ||
<div class="columns is-centered"> | ||
<div class="column is-half"> | ||
<div class="content has-text-centered"> | ||
<div title="Bencher - Continuous Benchmarking"> | ||
<img | ||
src={themeWordmark(props.theme ?? Theme.Light)} | ||
width="150" | ||
height="28.25" | ||
alt="🐰 Bencher" | ||
/> | ||
</div> | ||
</div> | ||
<br /> | ||
<div class="steps"> | ||
<For | ||
each={[ | ||
OnboardStep.API_TOKEN, | ||
OnboardStep.PROJECT, | ||
OnboardStep.RUN, | ||
OnboardStep.INVITE, | ||
OnboardStep.PLAN, | ||
]} | ||
> | ||
{(step) => ( | ||
<div | ||
class={`step-item ${ | ||
props.step >= step ? " is-active is-primary" : "" | ||
}`} | ||
> | ||
<a class="step-marker" href={stepHref(step)}> | ||
{step} | ||
</a> | ||
</div> | ||
)} | ||
</For> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
); | ||
}; | ||
|
||
export default OnboardSteps; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.