Skip to content

Commit

Permalink
[CastIt.Server.ClientApp] Improved the file item slider on small reso…
Browse files Browse the repository at this point in the history
…lutions
  • Loading branch information
Wolfteam committed Apr 28, 2024
1 parent 1550567 commit 5eabd90
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ interface Props {

function FileItemDuration(props: Props) {
const classes = useStyles();
const isXsScreen = useMediaQuery((theme: Theme) => theme.breakpoints.down('sm'));
const hideDuration = useMediaQuery((theme: Theme) => theme.breakpoints.down('lg'));

return (
<ListItemSecondaryAction className={classes.duration}>
<Grid container justifyContent="center" alignItems="center" className={'text-overflow-elipsis'}>
{props.loop ? <Loop fontSize="small" /> : null}
{!isXsScreen ? <Typography>{props.fullTotalDuration}</Typography> : null}
{!hideDuration ? <Typography>{props.fullTotalDuration}</Typography> : null}
</Grid>
</ListItemSecondaryAction>
);
Expand Down
33 changes: 17 additions & 16 deletions CastIt.Server/ClientApp/src/components/file/file_item_slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,30 @@ interface Props {

function FileItemSlider(props: Props) {
const classes = useStyles();
const isXsScreen = useMediaQuery((theme: Theme) => theme.breakpoints.down('sm'));
const showInlineDurations = useMediaQuery((theme: Theme) => theme.breakpoints.down('lg'));

const slider = <Slider size="small" value={props.playedPercentage} disabled className={classes.slider} />;
if (!isXsScreen) {
if (!showInlineDurations) {
return slider;
}

return (
<Grid container justifyContent="space-between" alignItems="center">
<Grid item xs={2}>
<Typography variant="subtitle1" className={'text-overflow-elipsis'} align="left">
{props.playedTime}
</Typography>
</Grid>
<Grid item xs={8} style={{ marginBottom: 7 }}>
{slider}
</Grid>
<Grid item xs={2}>
<Typography variant="subtitle1" className={'text-overflow-elipsis'} align="right">
{props.duration}
</Typography>
<>
<Grid container justifyContent="space-between" alignItems="center">
<Grid item xs={6}>
<Typography variant="subtitle1" className={'text-overflow-elipsis'} align="left">
{props.playedTime}
</Typography>
</Grid>

<Grid item xs={6}>
<Typography variant="subtitle1" className={'text-overflow-elipsis'} align="right">
{props.duration}
</Typography>
</Grid>
</Grid>
</Grid>
<Grid container>{slider}</Grid>
</>
);
}

Expand Down

0 comments on commit 5eabd90

Please sign in to comment.