Skip to content

Commit ea2109d

Browse files
authored
fix(playground): warn if version not specified (#2668)
1 parent 739161e commit ea2109d

File tree

311 files changed

+510
-105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

311 files changed

+510
-105
lines changed

docs/api/select.md

Lines changed: 2 additions & 2 deletions

src/components/global/Playground/index.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,6 @@ interface UsageTargetOptions {
9696
*/
9797
declarations?: string[];
9898
};
99-
/**
100-
* The major version of Ionic to use in the generated Stackblitz examples.
101-
* This will also load assets for Stackblitz from the specified version directory.
102-
*/
103-
version?: number;
10499
}
105100

106101
/**
@@ -120,7 +115,7 @@ export default function Playground({
120115
mode,
121116
devicePreview,
122117
includeIonContent = true,
123-
version = 6,
118+
version,
124119
}: {
125120
code: { [key in UsageTarget]?: MdxContent | UsageTargetOptions };
126121
title?: string;
@@ -135,6 +130,10 @@ export default function Playground({
135130
description?: string;
136131
devicePreview?: boolean;
137132
includeIonContent: boolean;
133+
/**
134+
* The major version of Ionic to use in the generated Stackblitz examples.
135+
* This will also load assets for Stackblitz from the specified version directory.
136+
*/
138137
version: number;
139138
}) {
140139
if (!code || Object.keys(code).length === 0) {
@@ -145,6 +144,10 @@ export default function Playground({
145144
console.warn(`Invalid mode provided: ${mode}. Accepted values are: "ios" or "md".`);
146145
return;
147146
}
147+
if (typeof version === 'undefined') {
148+
console.warn('You must specify a `version` for the Playground example. For example: <Playground version="7" />');
149+
return;
150+
}
148151

149152
const { isDarkTheme } = useThemeContext();
150153

static/usage/v6/accordion/accessibility/animations/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/basic/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/customization/advanced-expansion-styles/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/customization/expansion-styles/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/customization/icons/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/customization/theming/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/disable-group/index.md

Lines changed: 1 addition & 0 deletions

static/usage/v6/accordion/disable/group/index.md

Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)