Skip to content
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
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,9 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get
/static/app/components/loading/ @getsentry/app-frontend
/static/app/components/events/interfaces/ @getsentry/app-frontend
/static/app/components/forms/ @getsentry/app-frontend
/static/app/components/featureShowcase.mdx @getsentry/app-frontend
/static/app/components/featureShowcase.spec.tsx @getsentry/app-frontend
/static/app/components/featureShowcase.tsx @getsentry/app-frontend
/static/app/components/markdownTextArea.tsx @getsentry/app-frontend
/static/app/locale.tsx @getsentry/app-frontend
## End of Frontend
Expand Down
2 changes: 2 additions & 0 deletions knip.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const productionEntryPoints = [
'static/app/components/pipeline/**/*.{js,ts,tsx}',
// TODO: Remove when used
'static/app/views/seerExplorer/contexts/**/*.{js,ts,tsx}',
// TODO: Remove when used
'static/app/components/featureShowcase.tsx',
];

const testingEntryPoints = [
Expand Down
196 changes: 196 additions & 0 deletions static/app/components/featureShowcase.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
---
title: FeatureShowcase
description: A multi-step modal tour for showcasing features.
category: overlay
source: sentry/components/featureShowcase
---

import {Fragment} from 'react';

import tourAlertImage from 'sentry-images/spot/performance-tour-alert.svg';
import tourCorrelateImage from 'sentry-images/spot/performance-tour-correlate.svg';
import tourTraceImage from 'sentry-images/spot/performance-tour-trace.svg';

import {Button, LinkButton} from '@sentry/scraps/button';
import {Flex} from '@sentry/scraps/layout';

import {openModal} from 'sentry/actionCreators/modal';
import {FeatureShowcase, useShowcaseContext} from 'sentry/components/featureShowcase';
import {GlobalModal} from 'sentry/components/globalModal';
import * as Storybook from 'sentry/stories';

export function ReadTheDocsFooter() {
const {close} = useShowcaseContext();
return (
<Flex justify="end">
<LinkButton
external
href="https://docs.sentry.io"
onClick={close}
priority="primary"
>
Read the Docs
</LinkButton>
</Flex>
);
}

Render `<FeatureShowcase>` inside `openModal` with `<FeatureShowcase.Step>` children to create a multi-step modal tour.

```jsx
openModal(deps => (
<FeatureShowcase {...deps}>
<FeatureShowcase.Step>
<FeatureShowcase.Image src={image} alt="Step title" />
<FeatureShowcase.StepTitle>Step title</FeatureShowcase.StepTitle>
<FeatureShowcase.StepContent>Step description</FeatureShowcase.StepContent>
<FeatureShowcase.StepActions />
</FeatureShowcase.Step>
</FeatureShowcase>
));
```

## Basic

Each step can include an image, title, content, and navigation actions. The default `<FeatureShowcase.StepActions />` renders Back/Next/Done buttons automatically.

<Storybook.Demo>
<Fragment>
<GlobalModal />
<Button
priority="primary"
onClick={() => {
openModal(deps => (
<FeatureShowcase {...deps}>
<FeatureShowcase.Step>
<FeatureShowcase.Image src={tourTraceImage} alt="Trace Errors" />
<FeatureShowcase.StepTitle>Trace Errors</FeatureShowcase.StepTitle>
<FeatureShowcase.StepContent>
Trace errors across your services to find the root cause.
</FeatureShowcase.StepContent>
<FeatureShowcase.StepActions />
</FeatureShowcase.Step>
<FeatureShowcase.Step>
<FeatureShowcase.Image src={tourAlertImage} alt="Set Alerts" />
<FeatureShowcase.StepTitle>Set Alerts</FeatureShowcase.StepTitle>
<FeatureShowcase.StepContent>
Get notified when things break before your users do.
</FeatureShowcase.StepContent>
<FeatureShowcase.StepActions />
</FeatureShowcase.Step>
<FeatureShowcase.Step>
<FeatureShowcase.Image src={tourCorrelateImage} alt="Correlate Data" />
<FeatureShowcase.StepTitle>Correlate Data</FeatureShowcase.StepTitle>
<FeatureShowcase.StepContent>
Correlate errors, transactions, and releases to find patterns.
</FeatureShowcase.StepContent>
<FeatureShowcase.StepActions />
</FeatureShowcase.Step>
</FeatureShowcase>
));
}}
>
Open Tour
</Button>
</Fragment>
</Storybook.Demo>
```jsx
openModal(deps => (
<FeatureShowcase {...deps}>
<FeatureShowcase.Step>
<FeatureShowcase.Image src={tourTraceImage} alt="Trace Errors" />
<FeatureShowcase.StepTitle>Trace Errors</FeatureShowcase.StepTitle>
<FeatureShowcase.StepContent>
Trace errors across your services to find the root cause.
</FeatureShowcase.StepContent>
<FeatureShowcase.StepActions />
</FeatureShowcase.Step>
<FeatureShowcase.Step>
<FeatureShowcase.Image src={tourAlertImage} alt="Set Alerts" />
<FeatureShowcase.StepTitle>Set Alerts</FeatureShowcase.StepTitle>
<FeatureShowcase.StepContent>
Get notified when things break before your users do.
</FeatureShowcase.StepContent>
<FeatureShowcase.StepActions />
</FeatureShowcase.Step>
<FeatureShowcase.Step>
<FeatureShowcase.Image src={tourCorrelateImage} alt="Correlate Data" />
<FeatureShowcase.StepTitle>Correlate Data</FeatureShowcase.StepTitle>
<FeatureShowcase.StepContent>
Correlate errors, transactions, and releases to find patterns.
</FeatureShowcase.StepContent>
<FeatureShowcase.StepActions />
</FeatureShowcase.Step>
</FeatureShowcase>
));
```

## Custom Footer Buttons

Pass custom children alongside `<FeatureShowcase.StepActions />`, or replace it entirely with your own footer. Use `useShowcaseContext()` to access `close` and `advance` from custom components.

<Storybook.Demo>
<Fragment>
<GlobalModal />
<Button
priority="primary"
onClick={() => {
openModal(deps => (
<FeatureShowcase {...deps}>
<FeatureShowcase.Step>
<FeatureShowcase.Image src={tourTraceImage} alt="Trace Errors" />
<FeatureShowcase.StepTitle>Trace Errors</FeatureShowcase.StepTitle>
<FeatureShowcase.StepContent>
Trace errors across your services to find the root cause.
</FeatureShowcase.StepContent>
<FeatureShowcase.StepActions />
</FeatureShowcase.Step>
<FeatureShowcase.Step>
<FeatureShowcase.Image src={tourCorrelateImage} alt="Correlate Data" />
<FeatureShowcase.StepTitle>Correlate Data</FeatureShowcase.StepTitle>
<FeatureShowcase.StepContent>
Correlate errors, transactions, and releases to find patterns.
</FeatureShowcase.StepContent>
<ReadTheDocsFooter />
</FeatureShowcase.Step>
</FeatureShowcase>
));
}}
>
Open Tour
</Button>
</Fragment>
</Storybook.Demo>
```jsx
function ReadTheDocsFooter() {
const {close} = useShowcaseContext();
return (
<Flex justify="end">
<LinkButton external href="https://docs.sentry.io" onClick={close} priority="primary">
Read the Docs
</LinkButton>
</Flex>
);
}

openModal(deps => (

<FeatureShowcase {...deps}>
<FeatureShowcase.Step>
<FeatureShowcase.Image src={tourTraceImage} alt="Trace Errors" />
<FeatureShowcase.StepTitle>Trace Errors</FeatureShowcase.StepTitle>
<FeatureShowcase.StepContent>
Trace errors across your services to find the root cause.
</FeatureShowcase.StepContent>
<FeatureShowcase.StepActions />
</FeatureShowcase.Step>
<FeatureShowcase.Step>
<FeatureShowcase.Image src={tourCorrelateImage} alt="Correlate Data" />
<FeatureShowcase.StepTitle>Correlate Data</FeatureShowcase.StepTitle>
<FeatureShowcase.StepContent>
Correlate errors, transactions, and releases to find patterns.
</FeatureShowcase.StepContent>
<ReadTheDocsFooter />
</FeatureShowcase.Step>
</FeatureShowcase>
)); ```
Loading
Loading