Skip to content

Commit

Permalink
ENH: UI: paper material for cards (#1261)
Browse files Browse the repository at this point in the history
  • Loading branch information
Minamiyama authored Apr 11, 2024
1 parent ace5428 commit a7f0c3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 4 additions & 2 deletions xinference/web/ui/src/scenes/launch_model/modelCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
Stack,
TextField,
} from '@mui/material'
import Paper from '@mui/material/Paper'
import React, { useContext, useEffect, useRef, useState } from 'react'
import { useNavigate } from 'react-router-dom'

Expand Down Expand Up @@ -327,7 +328,7 @@ const ModelCard = ({

// Set two different states based on mouse hover
return (
<Box
<Paper
style={hover ? styles.containerSelected : styles.container}
onMouseEnter={() => setHover(true)}
onMouseLeave={() => setHover(false)}
Expand All @@ -336,6 +337,7 @@ const ModelCard = ({
setSelected(true)
}
}}
elevation={hover ? 24 : 4}
>
{modelType === 'LLM' ? (
<Box style={styles.descriptionCard}>
Expand Down Expand Up @@ -951,7 +953,7 @@ const ModelCard = ({
message="Please fill in the added custom parameters completely!"
key={'top' + 'center'}
/>
</Box>
</Paper>
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const styles = {
position: 'relative',
width: '300px',
height: '300px',
border: '1px solid #ddd',
borderRadius: '20px',
},
containerSelected: {
Expand All @@ -13,17 +12,14 @@ const styles = {
position: 'relative',
width: '300px',
height: '300px',
border: '1px solid #ddd',
borderRadius: '20px',
boxShadow: '0 0 10px #ccc',
},
descriptionCard: {
position: 'relative',
top: '-1px',
left: '-1px',
width: '300px',
height: '300px',
border: '1px solid #ddd',
padding: '20px',
borderRadius: '20px',
},
Expand Down

0 comments on commit a7f0c3b

Please sign in to comment.