Skip to content

Commit

Permalink
feat(frontend): add HomeContent component (#3556)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeepc committed Jan 24, 2024
1 parent 224c637 commit 1c22e62
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 35 deletions.
28 changes: 28 additions & 0 deletions web/src/pages/Wizard/HomeContent.tsx
@@ -0,0 +1,28 @@
import Header from 'components/Wizard/Header';
import Content from 'components/Wizard/Content';
import {withCustomization} from 'providers/Customization';
import {useWizard} from 'providers/Wizard';
import * as S from './Wizard.styled';

const HomeContent = () => {
const {activeStepId, isLoading, onGoTo, onNext, steps} = useWizard();
const completedSteps = steps.filter(({state}) => state === 'completed').length;

return (
<S.Container>
<S.Header>
<S.Title>Welcome to Tracetest!</S.Title>
<S.Text>
Here&apos;s a guide to get started and help you test your modern applications with OpenTelemetry.
</S.Text>
</S.Header>

<S.Body>
<Header activeStep={completedSteps} totalCompleteSteps={steps.length} />
<Content activeStepId={activeStepId} isLoading={isLoading} onChange={onGoTo} onNext={onNext} steps={steps} />
</S.Body>
</S.Container>
);
};

export default withCustomization(HomeContent, 'homeContent');
44 changes: 9 additions & 35 deletions web/src/pages/Wizard/Wizard.tsx
@@ -1,40 +1,14 @@
import withAnalytics from 'components/WithAnalytics/WithAnalytics';
import Header from 'components/Wizard/Header';
import Content from 'components/Wizard/Content';
import DataStoreProvider from 'providers/DataStore/DataStore.provider';
import SettingsProvider from 'providers/Settings/Settings.provider';
import {useWizard} from 'providers/Wizard';
import * as S from './Wizard.styled';

const Wizard = () => {
const {activeStepId, isLoading, onGoTo, onNext, steps} = useWizard();
const completedSteps = steps.filter(({state}) => state === 'completed').length;

return (
<DataStoreProvider>
<SettingsProvider>
<S.Container>
<S.Header>
<S.Title>Welcome to Tracetest!</S.Title>
<S.Text>
Here&apos;s a guide to get started and help you test your modern applications with OpenTelemetry.
</S.Text>
</S.Header>

<S.Body>
<Header activeStep={completedSteps} totalCompleteSteps={steps.length} />
<Content
activeStepId={activeStepId}
isLoading={isLoading}
onChange={onGoTo}
onNext={onNext}
steps={steps}
/>
</S.Body>
</S.Container>
</SettingsProvider>
</DataStoreProvider>
);
};
import HomeContent from './HomeContent';

const Wizard = () => (
<DataStoreProvider>
<SettingsProvider>
<HomeContent />
</SettingsProvider>
</DataStoreProvider>
);

export default withAnalytics(Wizard, 'wizard');

0 comments on commit 1c22e62

Please sign in to comment.