Skip to content

Commit 50a195e

Browse files
add prefix to state query params (#30)
1 parent a265c78 commit 50a195e

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/components/viewer/ComponentViewerStateCreator.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('ComponentViewerStateCreator', () => {
3232

3333
it('should take fullscreen state from url', () => {
3434
const stateCreator = new ComponentViewerStateCreator(registries);
35-
const state = stateCreator.stateFromUrl('fullScreen=true');
35+
const state = stateCreator.stateFromUrl('_rcv_fs=true');
3636

3737
expect(state.isFullScreen).toEqual(true);
3838
});
@@ -49,6 +49,6 @@ describe('ComponentViewerStateCreator', () => {
4949
selectedToolbarItem: ''
5050
});
5151

52-
expect(url).toEqual('registryName=core&demoName=demo-name&fullScreen=true');
52+
expect(url).toEqual('_rcv_rname=core&_rcv_dname=demo-name&_rcv_fs=true');
5353
});
5454
});

src/components/viewer/ComponentViewerStateCreator.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import { Registry, Registries } from '../';
55
import { DemoEntryAndRegistry } from '../registry/DemoEntryAndRegistry';
66

77
const queryParamNames = {
8-
registryName: 'registryName',
9-
demoName: 'demoName',
10-
entryTitle: 'entryTitle',
11-
selectedToolbarItem: 'toolbarItem',
12-
isFullScreen: 'fullScreen',
13-
isHelpOn: 'help'
8+
registryName: '_rcv_rname',
9+
demoName: '_rcv_dname',
10+
entryTitle: '_rcv_title',
11+
selectedToolbarItem: '_rcv_titem',
12+
isFullScreen: '_rcv_fs',
13+
isHelpOn: '_rcv_help'
1414
};
1515

1616
export class ComponentViewerStateCreator {

0 commit comments

Comments
 (0)