Skip to content

Commit c0a8d3e

Browse files
committed
Add property for corner button in grid view
1 parent 9ac9ba4 commit c0a8d3e

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

libs/remix-ui/grid-view/src/lib/remix-ui-grid-cell.tsx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ interface RemixUIGridCellProps {
3030
handleExpand?: any
3131
id: string
3232
searchKeywords?: string[]
33+
cornerBtnLabel?: string
34+
cornerBtnCallback?: () => void
35+
cornerBtnCSS?: string
3336
}
3437

3538
export const RemixUIGridCell = (props: RemixUIGridCellProps) => {
@@ -110,15 +113,18 @@ export const RemixUIGridCell = (props: RemixUIGridCellProps) => {
110113
}
111114
</div> }
112115
{ props.children }
113-
{ filterCon.showPin && <button
114-
className={`${pinned ? 'fas fa-toggle-on fa-lg text-dark' : 'fas fa-toggle-off fa-lg text-secondary'}` + ` fa-regular border-0 p-0 mt-2 align-self-end mr-1 remixui_grid_cell_pin`}
115-
style={{ fontSize: 'large' }}
116-
data-id={`${pinned ? `${props.id}-pinned` : `${props.id}-unpinned`}`}
117-
onClick={async () => {
118-
if (!props.pinStateCallback) setPinned(!pinned)
119-
if (await props.pinStateCallback(!pinned)) setPinned(!pinned)
120-
}}
121-
></button>}
116+
<div className='d-flex w-100 flex-row justify-content-between'>
117+
{ props.cornerBtnLabel || props.cornerBtnCSS ? <button className={props.cornerBtnCSS} onClick={() => props.cornerBtnCallback && props.cornerBtnCallback()}>{props.cornerBtnLabel}</button> : <div></div> }
118+
{ filterCon.showPin && <button
119+
className={`${pinned ? 'fas fa-toggle-on fa-lg text-dark' : 'fas fa-toggle-off fa-lg text-secondary'}` + ` fa-regular border-0 p-0 mt-2 align-self-end mr-1 remixui_grid_cell_pin`}
120+
style={{ fontSize: 'large' }}
121+
data-id={`${pinned ? `${props.id}-pinned` : `${props.id}-unpinned`}`}
122+
onClick={async () => {
123+
if (!props.pinStateCallback) setPinned(!pinned)
124+
if (await props.pinStateCallback(!pinned)) setPinned(!pinned)
125+
}}
126+
></button>}
127+
</div>
122128
</div>
123129
</div>
124130

0 commit comments

Comments
 (0)