-
Couldn't load subscription status.
- Fork 11
feat(web): activation modal steps, updated copy #1079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
800861e
feat(stepper): add shadcn stepper components
zackspear 9ca508f
chore(serverState): remove partnerLogo property from server state con…
zackspear ae777b3
refactor(web): modal add subfooter slot
zackspear c97db78
feat(modal): add ActivationSteps component to subFooter slot in Welco…
zackspear fb9601c
refactor: improve activation modal buttons responsiveness
zackspear e3b1ee7
refactor: update activation flow messaging and UI
zackspear 5dbe66c
feat: web/deploy-dev.sh add dynamic web component JS file whitelistin…
zackspear c49dca4
fix: remove test UTM parameters from Unraid docs links in activation …
zackspear 0ab8f64
refactor: improve konami code handling and add type safety to activat…
zackspear e1e5330
chore: remove extra semicolon in serverState.ts
zackspear 163cd61
Apply suggestions from code review
zackspear File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,119 @@ | ||
| <script setup lang="ts"> | ||
| import { Button } from "@/components/shadcn/button"; | ||
|
|
||
| import { | ||
| Stepper, | ||
| StepperDescription, | ||
| StepperItem, | ||
| StepperSeparator, | ||
| StepperTitle, | ||
| StepperTrigger, | ||
| } from "@/components/shadcn/stepper"; | ||
| import { CheckIcon, KeyIcon, ServerStackIcon } from "@heroicons/vue/24/outline"; | ||
| import { | ||
| KeyIcon as KeyIconSolid, | ||
| LockClosedIcon, | ||
| ServerStackIcon as ServerStackIconSolid, | ||
| } from "@heroicons/vue/24/solid"; | ||
|
|
||
| import type { Component } from 'vue' | ||
|
|
||
| type StepState = "inactive" | "active" | "completed"; | ||
|
|
||
| withDefaults(defineProps<{ | ||
| activeStep: number | ||
| }>(), { | ||
| activeStep: 1 | ||
| }) | ||
|
|
||
| interface Step { | ||
| step: number; | ||
| title: string; | ||
| description: string; | ||
| icon: { | ||
| inactive: Component; | ||
| active: Component; | ||
| completed: Component; | ||
| }; | ||
| }; | ||
| const steps: readonly Step[] = [ | ||
| { | ||
| step: 1, | ||
| title: "Create Device Password", | ||
| description: "Secure your device", | ||
| icon: { | ||
| inactive: LockClosedIcon, | ||
| active: LockClosedIcon, | ||
| completed: CheckIcon, | ||
| }, | ||
| }, | ||
| { | ||
| step: 2, | ||
| title: "Activate License", | ||
| description: "Create an Unraid.net account and activate your key", | ||
| icon: { | ||
| inactive: KeyIcon, | ||
| active: KeyIconSolid, | ||
| completed: CheckIcon, | ||
| }, | ||
| }, | ||
| { | ||
| step: 3, | ||
| title: "Unleash Your Hardware", | ||
| description: "Device is ready to configure", | ||
| icon: { | ||
| inactive: ServerStackIcon, | ||
| active: ServerStackIconSolid, | ||
| completed: CheckIcon, | ||
| }, | ||
| }, | ||
| ] as const; | ||
| </script> | ||
|
|
||
| <template> | ||
| <Stepper | ||
| :default-value="activeStep" | ||
| class="text-foreground flex w-full items-start gap-2 text-16px" | ||
| > | ||
| <StepperItem | ||
| v-for="step in steps" | ||
| :key="step.step" | ||
| v-slot="{ state }: { state: StepState }" | ||
| class="relative flex w-full flex-col items-center justify-center" | ||
| :step="step.step" | ||
| :disabled="true" | ||
| > | ||
| <StepperSeparator | ||
| v-if="step.step !== steps[steps.length - 1].step" | ||
| class="absolute left-[calc(50%+20px)] right-[calc(-50%+10px)] top-[1.5rem] &block h-0.5 shrink-0 rounded-full bg-muted group-data-[state=completed]:bg-primary" | ||
| /> | ||
|
|
||
| <StepperTrigger as-child> | ||
| <Button | ||
| :variant="state === 'completed' || state === 'active' ? 'default' : 'outline'" | ||
| size="default" | ||
| class="z-10 rounded-full shrink-0 opacity-100" | ||
| :class="[ | ||
| state !== 'inactive' && | ||
| 'ring-2 ring-primary ring-offset-2 ring-offset-background *:cursor-default', | ||
| ]" | ||
| :disabled="state === 'inactive'" | ||
| > | ||
| <component :is="step.icon[state]" class="size-4" /> | ||
| </Button> | ||
| </StepperTrigger> | ||
|
|
||
| <div class="mt-2 flex flex-col items-center text-center"> | ||
| <StepperTitle | ||
| :class="[state === 'active' && 'text-primary']" | ||
| class="text-2xs font-semibold transition" | ||
| > | ||
| {{ step.title }} | ||
| </StepperTitle> | ||
| <StepperDescription class="text-2xs font-normal"> | ||
| {{ step.description }} | ||
| </StepperDescription> | ||
| </div> | ||
| </StepperItem> | ||
| </Stepper> | ||
| </template> | ||
This file contains hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.