Skip to content
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

feat: onboarding step badges #8102

Merged
merged 1 commit into from
Sep 5, 2024
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
8 changes: 6 additions & 2 deletions frontend/src/component/onboarding/GenerateApiKey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import { SingleSelectConfigButton } from '../common/DialogFormTemplate/ConfigBut
import EnvironmentsIcon from '@mui/icons-material/CloudCircle';
import { ArcherContainer, ArcherElement } from 'react-archer';
import { useEffect } from 'react';
import { SectionHeader } from './SharedComponents';
import { SectionHeader, StepperBox } from './SharedComponents';
import { Stepper } from './Stepper';
import { Badge } from '../common/Badge/Badge';

const ChooseEnvironment = ({
environments,
Expand Down Expand Up @@ -227,7 +228,10 @@ export const GenerateApiKey = ({
return (
<SpacedContainer>
<Typography variant='h2'>Connect an SDK to Unleash</Typography>
<Stepper active={1} steps={3} />
<StepperBox>
<Stepper active={1} steps={3} />
<Badge color='secondary'>2/3 - Generate API Key</Badge>
</StepperBox>
<Box sx={{ mt: 2 }}>
<SectionHeader>Environment</SectionHeader>
<SectionDescription>
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/component/onboarding/SelectSdk.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Avatar, Box, Link, styled, Typography } from '@mui/material';
import type { FC } from 'react';
import { formatAssetPath } from 'utils/formatPath';
import { SectionHeader } from './SharedComponents';
import { SectionHeader, StepperBox } from './SharedComponents';
import { clientSdks, type Sdk, serverSdks } from './sharedTypes';
import { Stepper } from './Stepper';
import { Badge } from '../common/Badge/Badge';

const SpacedContainer = styled('div')(({ theme }) => ({
padding: theme.spacing(5, 8, 8, 8),
Expand Down Expand Up @@ -60,7 +61,11 @@ export const SelectSdk: FC<ISelectSdkProps> = ({ onSelect }) => {
return (
<SpacedContainer>
<Typography variant='h2'>Connect an SDK to Unleash</Typography>
<Stepper active={0} steps={3} />
<StepperBox>
<Stepper active={0} steps={3} />
<Badge color='secondary'>1/3 - Choose SDK</Badge>
</StepperBox>

<Box sx={{ mt: 2 }}>
<SectionHeader>Select SDK</SectionHeader>
<SecondarySectionHeader>
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/component/onboarding/SharedComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ export const SectionHeader = styled('div')(({ theme }) => ({
marginBottom: theme.spacing(1),
fontSize: theme.typography.body1.fontSize,
}));

export const StepperBox = styled('div')(({ theme }) => ({
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
marginTop: theme.spacing(2),
}));
1 change: 0 additions & 1 deletion frontend/src/component/onboarding/Stepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type { FC } from 'react';
const StepContainer = styled('div')(({ theme }) => ({
display: 'flex',
gap: theme.spacing(1),
marginTop: theme.spacing(2),
}));

const Step = styled('div')(({ theme }) => ({
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/component/onboarding/TestSdkConnection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Tooltip,
Typography,
} from '@mui/material';
import { SectionHeader } from './SharedComponents';
import { SectionHeader, StepperBox } from './SharedComponents';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import { allSdks, type Sdk } from './sharedTypes';
import {
Expand All @@ -21,6 +21,7 @@ import useToast from 'hooks/useToast';
import CopyIcon from '@mui/icons-material/FileCopy';
import { formatAssetPath } from '../../utils/formatPath';
import { Stepper } from './Stepper';
import { Badge } from '../common/Badge/Badge';

const SpacedContainer = styled('div')(({ theme }) => ({
padding: theme.spacing(5, 8, 2, 8),
Expand Down Expand Up @@ -116,7 +117,10 @@ export const TestSdkConnection: FC<ITestSdkConnectionProps> = ({
return (
<SpacedContainer>
<Typography variant='h2'>Connect an SDK to Unleash</Typography>
<Stepper active={2} steps={3} />
<StepperBox>
<Stepper active={2} steps={3} />
<Badge color='secondary'>3/3 - Test connection</Badge>
</StepperBox>
<Box sx={{ mt: 2 }}>
<ChangeSdk>
{sdkIcon ? (
Expand Down
Loading