Skip to content

Commit

Permalink
update example
Browse files Browse the repository at this point in the history
  • Loading branch information
precious-onyenaucheya-ons committed Jul 21, 2023
1 parent 08b2c22 commit 28ef690
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 91 deletions.
7 changes: 7 additions & 0 deletions src/components/list/_macro.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ const EXAMPLE_ITEM_NAVIGATION_TITLE = {
title: 'Long article title',
navigationTitle: 'Nav friendly title',
};
const EXAMPLE_NESTED_LIST_TEXT_ITEMS = {
itemsList: [
{ text: 'First item' },
{ text: 'Second item' },
{ text: 'Third item', itemsList: [{ text: 'First item' }, { text: 'Second item' }] },
],
};

describe('macro: list', () => {
describe('list element', () => {
Expand Down
93 changes: 2 additions & 91 deletions src/foundations/lists/example-bare-list.njk
Original file line number Diff line number Diff line change
@@ -1,100 +1,11 @@
{# {% from "components/list/_macro.njk" import onsList %}
{{
onsList({
"variants": 'bare',
"itemsList": [
{
"url": '#0',
"text": 'Who we are'
},
{
"url": '#0',
"text": 'What we do'
},
{
"url": 'https://goo.gl/maps/ULnVRd16zfFLZWdt7',
"text": 'Where to find us',
"external": true
}
]
})
}} #}

{#
{% from "components/list/_macro.njk" import onsList %}
{{
onsList({
"variants": 'bare',
"itemsList": [
{
"url": '#0',
"text": 'What we do'
},
{
"url": '#0',
"text": 'Who we are',
"subItems": [
{
"url": '#0',
"text": 'What we do',
"subItems": [
{
"url": '#0',
"text": 'Who we are',
},
{
"url": '#0',
"text": 'Who we are'
}]
},
{
"url": '#0',
"text": 'Who we are'
},
{
"url": '#0',
"text": 'Who we are'
}]
},
{
"url": '#0',
"text": 'What we do'
},
{
"url": 'https://goo.gl/maps/ULnVRd16zfFLZWdt7',
"text": 'Where to find us',
"external": true
}
]
})
}} #}

{% from "components/list/_macro.njk" import onsList %}
{{
onsList({
"variants": 'bare',
"itemsList": [
{
"url": '#0',
"text": 'Who we are',
"itemsList": [
{
"url": '#0',
"text": 'Who we are'
},
{
"url": '#0',
"text": 'Who we are',
"itemsList": [
{
"url": '#0',
"text": 'list item 1'
},
{
"url": '#0',
"text": 'list item 2'
}]
}]
"text": 'Who we are'
},
{
"url": '#0',
Expand All @@ -107,4 +18,4 @@
}
]
})
}}
}}
39 changes: 39 additions & 0 deletions src/foundations/lists/example-nested-list.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{% from "components/list/_macro.njk" import onsList %}
{{
onsList({
"variants": 'bare',
"itemsList": [
{
"url": '#0',
"text": 'Who we are',
"itemsList": [
{
"url": '#0',
"text": 'Who we are'
},
{
"url": '#0',
"text": 'Who we are',
"itemsList": [
{
"url": '#0',
"text": 'list item 1'
},
{
"url": '#0',
"text": 'list item 2'
}]
}]
},
{
"url": '#0',
"text": 'What we do'
},
{
"url": 'https://goo.gl/maps/ULnVRd16zfFLZWdt7',
"text": 'Where to find us',
"external": true
}
]
})
}}

0 comments on commit 28ef690

Please sign in to comment.