Skip to content

Commit 8bba107

Browse files
committed
fix: codeSandboxOptions => codeSandboxOption.
1 parent 10e4afd commit 8bba107

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/ThirdPartyButton.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import './ThirdPartyButton.less';
77
type ThirdPartyButtonProps = {
88
prefixCls?: string;
99
codePenOption?: CodePreviewProps['codePenOption'];
10-
codeSandboxOptions?: CodeSandboxProps;
10+
codeSandboxOption?: CodeSandboxProps;
1111
}
1212

1313
const ThirdPartyButton: React.FC<ThirdPartyButtonProps> = (props) => {
14-
const { codePenOption, codeSandboxOptions, prefixCls } = props || {};
14+
const { codePenOption, codeSandboxOption, prefixCls } = props || {};
1515
const { includeModule, ...otherCodePenOptions } = codePenOption || {};
1616
if (otherCodePenOptions && otherCodePenOptions.js) {
1717
let include = (includeModule || []).join('|');
@@ -31,8 +31,8 @@ const ThirdPartyButton: React.FC<ThirdPartyButtonProps> = (props) => {
3131
</svg>
3232
</Codepen>
3333
)}
34-
{codeSandboxOptions && (
35-
<CodeSandbox {...codeSandboxOptions}>
34+
{codeSandboxOption && (
35+
<CodeSandbox {...codeSandboxOption}>
3636
<svg height="12" fill="currentColor" viewBox="0 0 69 69">
3737
<path d="M32,38.2764838 L11,24 L11,35.7160031 L22.0526316,43.2306536 L22.0526316,54.3200601 L32,60 L32,38.2764838 Z M38,38.2764838 L38,60 L47.9473684,54.3200601 L47.9473684,43.2306536 L59,35.7160031 L59,24 L38,38.2764838 Z M46.296506,13 L35.5021904,21.0761293 L24.7078748,13.004586 L15,18.6913552 L35.5021904,33 L56,18.6913552 L46.296506,13.004586 L46.296506,13 Z M37.1676303,0.571217481 L63.7371606,15.5989936 C65.1342563,16.3900364 66,17.8813846 66,19.4990592 L66,49.4964682 C66.0011469,51.1157433 65.1356391,52.6091811 63.7371606,53.4010064 L37.1676303,68.4287825 C35.8224939,69.1904058 34.1819333,69.1904058 32.8367968,68.4287825 L6.26726663,53.4010064 C4.86707992,52.6103421 4,51.1166819 4,49.4964682 L4,19.4990592 C4,17.8813846 4.86574257,16.3900364 6.26283836,15.5989936 L32.8323686,0.571217481 C34.1775051,-0.190405827 35.8180656,-0.190405827 37.1632021,0.571217481 L37.1676303,0.571217481 Z"/>
3838
</svg>

src/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export interface CodePreviewProps extends SplitProps {
6868
*/
6969
includeModule?: string[];
7070
};
71-
codeSandboxOptions?: CodeSandboxProps;
71+
codeSandboxOption?: CodeSandboxProps;
7272
/** @default 'Code' */
7373
btnText?: string;
7474
/** @default 'Hide Editor' */
@@ -202,7 +202,7 @@ export default class CodePreview extends React.PureComponent<CodePreviewProps, I
202202
});
203203
}
204204
public render() {
205-
const { style, prefixCls, language, className, editProps, codePenOption, codeSandboxOptions, code, dependencies, btnText, btnHideText, onlyEdit, bordered, noCode, noPreview, noScroll, bgWhite, ...otherProps } = this.props;
205+
const { style, prefixCls, language, className, editProps, codePenOption, codeSandboxOption, code, dependencies, btnText, btnHideText, onlyEdit, bordered, noCode, noPreview, noScroll, bgWhite, ...otherProps } = this.props;
206206
const isOneItem = (!noCode && !noPreview) ? false : (!noCode || !noPreview);
207207
let visiable = this.state.width === 1 ? false : [isOneItem ? 1 : 2];
208208
return (
@@ -265,7 +265,7 @@ export default class CodePreview extends React.PureComponent<CodePreviewProps, I
265265
<ThirdPartyButton
266266
prefixCls={prefixCls}
267267
codePenOption={codePenOption}
268-
codeSandboxOptions={codeSandboxOptions}
268+
codeSandboxOption={codeSandboxOption}
269269
/>
270270
<div className={`${prefixCls}-bar-btn`} onClick={this.onSwitchSource.bind(this)}>{this.state.width === 1 ? btnText : btnHideText}</div>
271271
<div

website/Example.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ const Example = () => {
122122
}
123123
}}
124124
noPreview={state.noPreview}
125-
codeSandboxOptions={state.codeSandboxShow ? state.codeSandbox : undefined}
125+
codeSandboxOption={state.codeSandboxShow ? state.codeSandbox : undefined}
126126
codePenOption={state.codePenShow ? state.codePen : undefined}
127127
/>
128128
<div>

0 commit comments

Comments
 (0)