Skip to content

Commit

Permalink
feat: add new demo file and improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVarchuk committed May 27, 2021
1 parent d525e6d commit 456666e
Show file tree
Hide file tree
Showing 12 changed files with 3,087 additions and 67 deletions.
9 changes: 7 additions & 2 deletions demo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import { resolve as urlResolve } from 'url';
import { RedocStandalone } from '../src';
import ComboBox from './ComboBox';

const DEFAULT_SPEC = 'openapi.yaml';
const NEW_VERSION_SPEC = 'openapi-3-1.yaml';

const demos = [
{ value: NEW_VERSION_SPEC, label: 'OpenApi 3.1' },
{ value: 'https://api.apis.guru/v2/specs/instagram.com/1.0.0/swagger.yaml', label: 'Instagram' },
{
value: 'https://api.apis.guru/v2/specs/googleapis.com/calendar/v3/openapi.yaml',
Expand All @@ -16,8 +20,6 @@ const demos = [
{ value: 'https://docs.graphhopper.com/openapi.json', label: 'GraphHopper' },
];

const DEFAULT_SPEC = 'openapi.yaml';

class DemoApp extends React.Component<
{},
{ specUrl: string; dropdownOpen: boolean; cors: boolean }
Expand Down Expand Up @@ -45,6 +47,9 @@ class DemoApp extends React.Component<
}

handleChange = (url: string) => {
if (url === NEW_VERSION_SPEC) {
this.setState({ cors: false })
}
this.setState({
specUrl: url,
});
Expand Down
Loading

0 comments on commit 456666e

Please sign in to comment.