Skip to content

Commit bd25bb2

Browse files
committed
Move component examples to mappers section
1 parent ef5102e commit bd25bb2

File tree

19 files changed

+9
-13
lines changed

19 files changed

+9
-13
lines changed

packages/react-renderer-demo/src/components/navigation/mapper.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ import useMapperLink from '../../hooks/use-mapper-link';
2020

2121
const useStyles = makeStyles(navStyles);
2222

23-
const Item = ({ href, linkText, component }) => {
23+
const Item = ({ href, linkText, component, divider }) => {
2424
const classes = useStyles();
2525
const router = useRouter();
2626
const link = useMapperLink(href.replace('/?', '?'));
2727

2828
return (
2929
<ListItem
30+
divider={divider}
3031
button
3132
selected={href.replace('/?', '?') === router.asPath.replace(query, '')}
3233
key={href || linkText}
@@ -47,7 +48,8 @@ const Item = ({ href, linkText, component }) => {
4748
Item.propTypes = {
4849
href: PropTypes.string.isRequired,
4950
linkText: PropTypes.string,
50-
component: PropTypes.node
51+
component: PropTypes.node,
52+
divider: PropTypes.bool
5153
};
5254

5355
const FinalList = ({ title, level, link, fields, previousLinks = [], renderItems, openable = true, open = false }) => {

packages/react-renderer-demo/src/components/navigation/schemas/mappers.schema.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { baseExamples } from '../examples-definitions';
2+
13
const mappersSchema = [
24
{
35
subHeader: true,
@@ -50,9 +52,7 @@ const mappersSchema = [
5052
noRoute: true,
5153
title: 'Mapper components'
5254
},
53-
/**
54-
* Here will be component definitions
55-
*/
55+
...baseExamples.sort((a, b) => a.linkText.localeCompare(b.linkText)),
5656
{
5757
subHeader: true,
5858
noRoute: true,
@@ -68,7 +68,8 @@ const mappersSchema = [
6868
},
6969
{
7070
link: 'validator-mapper',
71-
linkText: 'Validator mapper'
71+
linkText: 'Validator mapper',
72+
divider: true
7273
}
7374
];
7475

packages/react-renderer-demo/src/components/navigation/schemas/schema.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { baseExamples } from '../examples-definitions';
21
import flatMap from 'lodash/flatMap';
32
import schemaRenderer from './renderer.schema';
43
import schemaNav from './schema.schema';
@@ -42,12 +41,6 @@ const schema = [
4241
linkText: 'Form builder',
4342
link: 'live-editor'
4443
},
45-
{
46-
title: 'Component definitions',
47-
link: 'component-example',
48-
noRoute: true,
49-
fields: baseExamples.sort((a, b) => a.linkText.localeCompare(b.linkText))
50-
},
5144
{
5245
linkText: 'Testing',
5346
link: 'testing'

0 commit comments

Comments
 (0)