File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
src/lib/kit/components/Layouts Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -14,14 +14,17 @@ import './Column.scss';
1414
1515const b = block ( 'column' ) ;
1616
17- interface ColumnProps { }
17+ interface ColumnProps {
18+ action ?: React . ReactNode ;
19+ }
1820
1921const ColumnBase = < T extends FieldValue , S extends Spec > ( {
2022 name,
2123 spec,
2224 input,
2325 meta,
2426 children,
27+ action,
2528} : LayoutProps < T , undefined , undefined , S > & ColumnProps ) => {
2629 const arrayItem = React . useMemo ( ( ) => isArrayItem ( name ) , [ name ] ) ;
2730 const generateButton = React . useMemo ( ( ) => withGenerateButton ( spec ) , [ spec ] ) ;
@@ -47,9 +50,7 @@ const ColumnBase = <T extends FieldValue, S extends Spec>({
4750 </ span >
4851 ) : null }
4952 </ div >
50- { Boolean ( spec . viewSpec . layoutAction ) && (
51- < div className = { b ( 'first-row-action' ) } > { spec . viewSpec . layoutAction } </ div >
52- ) }
53+ { Boolean ( action ) && < div className = { b ( 'first-row-action' ) } > { action } </ div > }
5354 </ div >
5455 < div className = { b ( 'second-row' ) } >
5556 < div className = { b ( 'second-row-inner' ) } >
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ const b = block('row');
1616
1717interface RowProps {
1818 verboseDescription ?: boolean ;
19+ action ?: React . ReactNode ;
1920}
2021
2122const RowBase = < T extends FieldValue , S extends Spec > ( {
@@ -24,6 +25,7 @@ const RowBase = <T extends FieldValue, S extends Spec>({
2425 input,
2526 meta,
2627 verboseDescription,
28+ action,
2729 children,
2830} : LayoutProps < T , undefined , undefined , S > & RowProps ) => {
2931 const arrayItem = React . useMemo ( ( ) => isArrayItem ( name ) , [ name ] ) ;
@@ -49,9 +51,7 @@ const RowBase = <T extends FieldValue, S extends Spec>({
4951 </ Text >
5052 </ span >
5153 ) : null }
52- { Boolean ( spec . viewSpec . layoutAction ) && (
53- < span className = { b ( 'left-action' ) } > { spec . viewSpec . layoutAction } </ span >
54- ) }
54+ { Boolean ( action ) && < span className = { b ( 'left-action' ) } > { action } </ span > }
5555 </ div >
5656 </ div >
5757 < div className = { b ( 'right' ) } >
You can’t perform that action at this time.
0 commit comments