Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed ui break through css #2501

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 37 additions & 5 deletions src/webview/cluster/app/cluster.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export default (theme: Theme) =>
},
cardTransform: {
width: '27em',
height: 'auto',
marginRight: theme.spacing(4),
position: 'relative',
transform: 'scale(0.95)',
'&:hover': {
transform: 'scale(1)',
Expand All @@ -48,18 +48,50 @@ export default (theme: Theme) =>
padding: theme.spacing(2),
borderBottom: '0 solid transparent'
},
cardImageContainer: {
display: 'inherit',
padding: '10px',
height: '50px',
maxHeight: '10rem',
maxWidth: '15rem'
},
cardImageTableContainer: {
display: 'inline-block',
verticalAlign: 'top',
height: '15%',
width: 'auto',
marginTop: '1rem'
},
cardBody: {
maxHeight: '15em',
overflow: 'hidden',
overflowY:'scroll',
'&::-webkit-scrollbar':{
width:0,
}
},
cardBodyMargin: {
marginTop: theme.spacing(3)
},
cardButton: {
display: 'block',
marginBottom: theme.spacing(2)
margin: theme.spacing(2)
},
button: {
display: 'table-cell',
minWidth: '8rem',
maxWidth: '20rem',
maxHeight: '5rem',
height: '2rem',
textAlign: 'center',
overflow: 'hidden',
textOverflow: 'ellipsis',
color: 'var(--vscode-button-foreground)',
backgroundColor: '#EE0000',
'&:hover': {
color: 'var(--vscode-button-foreground)',
backgroundColor: '#BE0000',
},
textTransform: "none"
textTransform: 'none'
},
cardContent: {
background: 'var(--vscode-settings-focusedRowBackground)',
Expand All @@ -70,4 +102,4 @@ export default (theme: Theme) =>
maxHeight: '100%',
maxWidth: '100%'
}
})
})
56 changes: 30 additions & 26 deletions src/webview/cluster/app/cluster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
Tooltip,
Typography
} from '@material-ui/core';

import clsx from 'clsx';
import AddClusterView from './clusterView';
import AddSandboxView from './sandboxView';
import clusterStyle from './cluster.style';
Expand Down Expand Up @@ -108,35 +108,39 @@ export default function Header() {
</Typography>
</div>
<CardContent style={{ height: 240 }}>
<Typography style={{ padding: '10px', height: '50px' }}>
<Typography className={index === 2 ? classes.cardImageTableContainer : classes.cardImageContainer}>
{list.imageUrl.map((url: string, index: string | number) => (
<img src={url} key={index} className={classes.image} style={{ marginLeft: '.625rem', marginRight: '.625rem' }}></img>
<img src={url} key={index} className={classes.image} style={{ marginLeft: '.625rem', marginRight: '.625rem', position: 'relative' }}></img>
))}
</Typography>
<List>
<ListItem>
<ListItemText
primary={list.description}
secondary={list.smallInfo} />
</ListItem>
</List>
<div className={index === 2 ? clsx(classes.cardBody, classes.cardBodyMargin) : classes.cardBody}>
<List>
<ListItem>
<ListItemText
primary={list.description}
secondary={list.smallInfo} />
</ListItem>
</List>
</div>
</CardContent>
<CardActions className={classes.cardButton}>
<Tooltip title={list.tooltip} placement="top">
<div>
<a onClick={() => handleView(index)} style={{ textDecoration: 'none' }} href={clusterTypes[index].redirectLink || '#'}>
<Button
variant="contained"
color="default"
component="span"
className={classes.button}
>
{list.buttonText}
</Button>
</a>
</div>
</Tooltip>
</CardActions>
<div>
<CardActions className={classes.cardButton}>
<Tooltip title={list.tooltip} placement="top">
<div>
<a onClick={() => handleView(index)} style={{ textDecoration: 'none' }} href={clusterTypes[index].redirectLink || '#'}>
<Button
variant="contained"
color="default"
component="span"
className={classes.button}
>
{list.buttonText}
</Button>
</a>
</div>
</Tooltip>
</CardActions>
</div>
</Card>
))}
</>
Expand Down