Skip to content

Commit aa85942

Browse files
committed
Get rid of duplication of text to allow searching
1 parent 1c7f1ec commit aa85942

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

packages/react-renderer-demo/src/components/component-example-text.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ const ComponentExampleText = ({ linkText, schema, variants, component, activeMap
1111
</Heading>
1212
<ComponentExample variants={variants} schema={schema} activeMapper={activeMapper} component={component} />
1313
<br />
14-
{avalableMappers.map(({ mapper, title }) => (
15-
<div key={mapper} hidden={activeMapper !== mapper}>
16-
<ContentText activeMapper={activeMapper} component={component} />
17-
</div>
18-
))}
14+
<ContentText activeMapper={activeMapper} component={component} />
1915
</React.Fragment>
2016
);
2117

packages/react-renderer-demo/src/components/docsearch.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,7 @@ const DocSearch = () => {
5353
inputSelector: '#data-driven-forms-search',
5454
handleSelected: (input, event, suggestion) => {
5555
event.button = 0;
56-
const resultUrl = new URL(suggestion.url);
57-
58-
let query = '';
59-
if (resultUrl.pathname.startsWith('/mappper/')) {
60-
['mui', 'pf4', 'pf3'].find((mapper) => {
61-
if (resultUrl.hash.includes(mapper)) {
62-
query = `?mapper=${mapper}`;
63-
return true;
64-
}
65-
66-
return undefined;
67-
});
68-
}
69-
70-
push(`${resultUrl.pathname}${query}${resultUrl.hash ? resultUrl.hash : ''}`);
56+
push(suggestion.url.replace('https://data-driven-forms.org', ''));
7157
input.close();
7258
}
7359
// debug: true, // Set debug to true if you want to inspect the dropdown.

0 commit comments

Comments
 (0)