This commit is contained in:
PhilReact 2024-12-24 01:32:14 +02:00
parent 55035f8c43
commit 15d8bcbc65
2 changed files with 37 additions and 35 deletions

View File

@ -109,41 +109,43 @@ export const TradeOffers: React.FC<any> = ({foreignCoinBalance}:any) => {
} }
} }
const columnDefs: ColDef[] = [ const columnDefs: ColDef[] = useMemo(()=> {
{ return [
headerCheckboxSelection: true, // Adds a checkbox in the header for selecting all rows {
checkboxSelection: true, // Adds checkboxes in each row for selection headerCheckboxSelection: true, // Adds a checkbox in the header for selecting all rows
headerName: "Select", // You can customize the header name checkboxSelection: true, // Adds checkboxes in each row for selection
width: 50, // Adjust the width as needed headerName: "", // You can customize the header name
pinned: 'left', // Optional, to pin this column on the left width: 50, // Adjust the width as needed
resizable: false, pinned: 'left', // Optional, to pin this column on the left
}, resizable: false,
{ headerName: "QORT AMOUNT", field: "qortAmount" , flex: 1, // Flex makes this column responsive },
minWidth: 150, // Ensure it doesn't shrink too much { headerName: "QORT AMOUNT", field: "qortAmount" , flex: 1, // Flex makes this column responsive
resizable: true }, minWidth: 150, // Ensure it doesn't shrink too much
{ headerName: `${getCoinLabel()}/QORT`, valueGetter: (params) => +params.data.foreignAmount / +params.data.qortAmount, sortable: true, sort: 'asc', flex: 1, // Flex makes this column responsive resizable: true },
minWidth: 150, // Ensure it doesn't shrink too much { headerName: `${getCoinLabel()}/QORT`, valueGetter: (params) => +params.data.foreignAmount / +params.data.qortAmount, sortable: true, sort: 'asc', flex: 1, // Flex makes this column responsive
resizable: true }, minWidth: 150, // Ensure it doesn't shrink too much
{ headerName: `Total ${getCoinLabel()} Value`, field: "foreignAmount", flex: 1, // Flex makes this column responsive resizable: true },
minWidth: 150, // Ensure it doesn't shrink too much { headerName: `Total ${getCoinLabel()} Value`, field: "foreignAmount", flex: 1, // Flex makes this column responsive
resizable: true }, minWidth: 150, // Ensure it doesn't shrink too much
{ headerName: "Seller", field: "qortalCreator", flex: 1, // Flex makes this column responsive resizable: true },
minWidth: 300, // Ensure it doesn't shrink too much { headerName: "Seller", field: "qortalCreator", flex: 1, // Flex makes this column responsive
resizable: true, valueGetter: (params)=> { minWidth: 300, // Ensure it doesn't shrink too much
if(params?.data?.qortalCreator){ resizable: true, valueGetter: (params)=> {
if(qortalNames[params?.data?.qortalCreator]){ if(params?.data?.qortalCreator){
return qortalNames[params?.data?.qortalCreator] if(qortalNames[params?.data?.qortalCreator]){
} else if(qortalNames[params?.data?.qortalCreator] === undefined){ return qortalNames[params?.data?.qortalCreator]
getName(params?.data?.qortalCreator) } else if(qortalNames[params?.data?.qortalCreator] === undefined){
getName(params?.data?.qortalCreator)
return params?.data?.qortalCreator return params?.data?.qortalCreator
} else { } else {
return params?.data?.qortalCreator return params?.data?.qortalCreator
}
} }
} } },
} }, ];
]; },[qortalNames])

View File

@ -345,7 +345,7 @@ export const Header = ({
}} }}
> >
<img <img
src={getCoinIcon(getCoinLabel(selectedCoin))} src={getCoinIcon(getCoinLabel())}
style={{ style={{
height: "25px", height: "25px",
width: "auto", width: "auto",