1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-12 08:58:17 +03:00

F OpenNebula/One#6826: Fix selected row (#3407)

Co-authored-by: Tino Vázquez <cvazquez@opennebula.io>
This commit is contained in:
Jorge Miguel Lobo Escalona 2025-02-03 15:55:20 +01:00 committed by GitHub
parent fc12305c3c
commit 93521db87a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 11 deletions

View File

@ -13,15 +13,15 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
import { memo, useMemo } from 'react'
import PropTypes from 'prop-types'
import clsx from 'clsx'
import PropTypes from 'prop-types'
import { memo, useMemo } from 'react'
import {
Card,
CardActionArea,
CardHeader,
CardActions,
CardHeader,
CardMedia,
Skeleton,
useTheme,
@ -65,6 +65,7 @@ const SelectCard = memo(
}),
[theme]
)
const { isNearScreen, fromRef } = useNearScreen({
distance: '100px',
})
@ -77,9 +78,13 @@ const SelectCard = memo(
{observerOff || isNearScreen ? (
<Card
{...cardProps}
className={clsx(classes.root, cardProps?.className, {
className={clsx(
classes.root({ isSelected }),
cardProps?.className,
{
[classes.actionArea]: !handleClick,
})}
}
)}
data-cy={dataCy ? `${dataCy}-card` : undefined}
>
{/* CARD ACTION AREA */}

View File

@ -13,14 +13,14 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
import { Checkbox, Grid, TableCell, TableRow, useTheme } from '@mui/material'
import EnhancedTableStyles from '@modules/components/Tables/Enhanced/styles'
import { SERVER_CONFIG } from '@ConstantsModule'
import { useAuth } from '@FeaturesModule'
import { css } from '@emotion/css'
import EnhancedTableStyles from '@modules/components/Tables/Enhanced/styles'
import { Checkbox, Grid, TableCell, TableRow, useTheme } from '@mui/material'
import get from 'lodash.get'
import PropTypes from 'prop-types'
import { ReactElement, memo, useMemo } from 'react'
import { css } from '@emotion/css'
const listStyles = ({ palette }) => ({
row: css({
@ -180,7 +180,8 @@ const SwitchRowComponent = memo(
return Component
},
(prev, next) => prev.RowCardComponent === next.RowCardComponent
(prev, next) =>
prev.RowCardComponent === next.RowCardComponent && prev.props === next.props
)
SwitchRowComponent.propTypes = {

View File

@ -89,7 +89,7 @@ export const EnhancedTableStyles = ({ palette, typography, breakpoints }) => ({
backgroundColor: palette.action.hover,
},
'&.selected': {
border: `2px solid ${palette.secondary.main}`,
border: `.2rem solid ${palette.secondary.main}`,
},
},
}),