Skip to content

Commit

Permalink
Add playground page
Browse files Browse the repository at this point in the history
  • Loading branch information
255kb committed Dec 19, 2023
1 parent 1fdd9a0 commit 7106ea4
Show file tree
Hide file tree
Showing 8 changed files with 669 additions and 115 deletions.
41 changes: 24 additions & 17 deletions components/accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,21 @@ const Accordion: FunctionComponent<{
<span
className='me-4'
id={`accordionContent${dataGroupIndex}${dataItemIndex}`}
>
{dataItem.title}
</span>
dangerouslySetInnerHTML={{ __html: dataItem.title }}
></span>

<div className='ms-auto'>
{Array.isArray(dataItem.text) && (
{(Array.isArray(dataItem.content) ||
dataItem.count !== undefined) && (
<span className='badge text-bg-gray-200 rounded-pill'>
{dataItem.text.length}{' '}
{dataItem.text.length > 1
? counterSuffix.plural
: counterSuffix.singular}
{Array.isArray(dataItem.content)
? dataItem.content.length
: dataItem.count}{' '}
{(Array.isArray(dataItem.content)
? dataItem.content.length
: dataItem.count) > 1
? counterSuffix?.plural
: counterSuffix?.singular}
</span>
)}
</div>
Expand All @@ -78,13 +82,12 @@ const Accordion: FunctionComponent<{
className={`accordion-collapse ${
accordionItemState ? '' : 'collapse'
}`}
id='helpOne'
aria-labelledby={`accordionContent${dataGroupIndex}${dataItemIndex}`}
data-bs-parent={`#accordion${dataGroupIndex}${dataItemIndex}`}
>
{Array.isArray(dataItem.text) && (
{Array.isArray(dataItem.content) && (
<ol className='accordion-body text-gray-700 list-group-numbered'>
{dataItem.text.map((textItem, textItemIndex) => {
{dataItem.content.map((textItem, textItemIndex) => {
return (
<li
key={`dataGroup${dataGroupIndex}dataItem${dataItemIndex}textItem${textItemIndex}`}
Expand All @@ -95,12 +98,16 @@ const Accordion: FunctionComponent<{
})}
</ol>
)}
{!Array.isArray(dataItem.text) && (
<div
className='accordion-body text-gray-700'
dangerouslySetInnerHTML={{ __html: dataItem.text }}
></div>
)}
{!Array.isArray(dataItem.content) &&
typeof dataItem.content === 'string' && (
<div
className='accordion-body text-gray-700'
dangerouslySetInnerHTML={{ __html: dataItem.content }}
></div>
)}
{!Array.isArray(dataItem.content) &&
typeof dataItem.content !== 'string' &&
dataItem.content}
</div>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions components/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ const Footer: FunctionComponent<{
</li>
<li className='mb-2'>
<Link href='/status/' className='text-reset'>
Status
Services status
</Link>
</li>
</ul>
<h6 className='fw-bold text-uppercase text-gray-700'>Tools</h6>
<h6 className='fw-bold text-uppercase text-gray-700'>Apps</h6>

<ul className='list-unstyled text-gray-700'>
<li className='mb-2'>
Expand Down
Loading

0 comments on commit 7106ea4

Please sign in to comment.