modify color card by data
This commit is contained in:
@@ -12,11 +12,12 @@ const CardList = ({
|
||||
showEditModal,
|
||||
showDeleteDialog,
|
||||
cardColor,
|
||||
fieldColor,
|
||||
}) => {
|
||||
const getCardStyle = () => {
|
||||
const color = cardColor ?? '#F3EDEA'; // Orange color
|
||||
const getCardStyle = (color) => {
|
||||
const colorStyle = color ?? '#F3EDEA'; // Orange color
|
||||
return {
|
||||
border: `2px solid ${color}`,
|
||||
border: `2px solid ${colorStyle}`,
|
||||
borderRadius: '8px',
|
||||
textAlign: 'center', // Center text
|
||||
};
|
||||
@@ -47,12 +48,14 @@ const CardList = ({
|
||||
alignItems: 'center',
|
||||
}}
|
||||
>
|
||||
<span style={getTitleStyle(item.color ?? cardColor)}>
|
||||
<span
|
||||
style={getTitleStyle(fieldColor ? item[fieldColor] : cardColor)}
|
||||
>
|
||||
{item[header]}
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
style={getCardStyle()}
|
||||
style={getCardStyle(fieldColor ? item[fieldColor] : cardColor)}
|
||||
actions={[
|
||||
<EyeOutlined
|
||||
style={{ color: '#1890ff' }}
|
||||
|
||||
Reference in New Issue
Block a user