File tree Expand file tree Collapse file tree 3 files changed +54
-4
lines changed
Expand file tree Collapse file tree 3 files changed +54
-4
lines changed Original file line number Diff line number Diff line change @@ -68,10 +68,15 @@ const AccordionItemsList = (props: Props) => (
6868 </ Accordion . Trigger >
6969 </ h2 >
7070 </ Accordion . Header >
71- < Accordion . Content
72- className = 'accordion-list-content text-[13px] font-semibold leading-[120%]'
73- >
74- < ul >
71+ < Accordion . Content className = 'accordion-list-content text-[13px] font-semibold leading-[120%]' >
72+ < ul className = { clsx (
73+ { flex : relation . horizontal } ,
74+ { 'flex-row' : relation . horizontal } ,
75+ { 'flex-wrap' : relation . horizontal } ,
76+ { 'gap-6' : relation . horizontal } ,
77+ { 'py-6' : relation . horizontal }
78+ ) }
79+ >
7580 {
7681 _ . map ( relation . items , ( item , idxx ) => (
7782 < >
Original file line number Diff line number Diff line change 33import type { RelatedRecord } from './RelatedRecord' ;
44
55export type RelatedRecordsList = {
6+ /**
7+ * When set to true, items will be displayed in a row rather than a column
8+ */
9+ horizontal ?: boolean ,
10+
611 /**
712 * Icon to use in front of each list item. Defaults to none. Note this is overridden if a renderItem prop is provided
813 */
Original file line number Diff line number Diff line change @@ -54,6 +54,40 @@ const sampleDataWithIcon = [
5454 }
5555] ;
5656
57+ const sampleDataWithImages = [
58+ {
59+ title : 'Related Images' ,
60+ horizontal : true ,
61+ renderItem : ( item ) => (
62+ < img src = { item . data . src } className = 'max-h-[90px]' alt = { item . name } />
63+ ) ,
64+ items : [
65+ {
66+ name : 'Kazuya Miyuki' ,
67+ data : {
68+ src : 'https://static.wikia.nocookie.net/all-worlds-alliance/images/1/15/MiyukiKazuya-Render.png'
69+ }
70+ } ,
71+ {
72+ name : 'Eijun Sawamura' ,
73+ data : {
74+ src : 'https://static.wikia.nocookie.net/all-worlds-alliance/images/2/22/369779ccc7619f63a468c6e8fd3be2f4.png'
75+ }
76+ }
77+ ] ,
78+ icon : 'person'
79+ } ,
80+ {
81+ title : 'Related Organizations' ,
82+ items : [
83+ {
84+ name : 'Seido High School Baseball Club'
85+ }
86+ ] ,
87+ icon : 'occupation'
88+ }
89+ ] ;
90+
5791const sampleDataWithClickEvent = [
5892 {
5993 title : 'Related People' ,
@@ -103,3 +137,9 @@ export const WithClickEvent = () => (
103137 items = { sampleDataWithClickEvent }
104138 />
105139) ;
140+
141+ export const WithImagesInRow = ( ) => (
142+ < AccordionItemsList
143+ items = { sampleDataWithImages }
144+ />
145+ ) ;
You can’t perform that action at this time.
0 commit comments