mirror of
https://github.com/Redocly/redoc.git
synced 2025-07-11 00:32:36 +03:00
fix: hideLoading options in redoc standalone (#1709)
This commit is contained in:
parent
cd2d6f76e8
commit
6a52a16d5b
|
@ -1,6 +1,6 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
import { RedocNormalizedOptions, RedocRawOptions } from '../services/RedocNormalizedOptions';
|
import { argValueToBoolean, RedocNormalizedOptions, RedocRawOptions } from '../services/RedocNormalizedOptions';
|
||||||
import { ErrorBoundary } from './ErrorBoundary';
|
import { ErrorBoundary } from './ErrorBoundary';
|
||||||
import { Loading } from './Loading/Loading';
|
import { Loading } from './Loading/Loading';
|
||||||
import { Redoc } from './Redoc/Redoc';
|
import { Redoc } from './Redoc/Redoc';
|
||||||
|
@ -15,7 +15,7 @@ export interface RedocStandaloneProps {
|
||||||
|
|
||||||
export const RedocStandalone = function (props: RedocStandaloneProps) {
|
export const RedocStandalone = function (props: RedocStandaloneProps) {
|
||||||
const { spec, specUrl, options = {}, onLoaded } = props;
|
const { spec, specUrl, options = {}, onLoaded } = props;
|
||||||
const hideLoading = options.hideLoading !== undefined;
|
const hideLoading = argValueToBoolean(options.hideLoading, false);
|
||||||
|
|
||||||
const normalizedOpts = new RedocNormalizedOptions(options);
|
const normalizedOpts = new RedocNormalizedOptions(options);
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ export interface RedocRawOptions {
|
||||||
hideSchemaPattern?: boolean;
|
hideSchemaPattern?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
function argValueToBoolean(val?: string | boolean, defaultValue?: boolean): boolean {
|
export function argValueToBoolean(val?: string | boolean, defaultValue?: boolean): boolean {
|
||||||
if (val === undefined) {
|
if (val === undefined) {
|
||||||
return defaultValue || false;
|
return defaultValue || false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user