decent nice slider and playback sort of experience
This commit is contained in:
@@ -1,9 +1,14 @@
|
|||||||
import {
|
import {
|
||||||
|
Avatar,
|
||||||
|
AvatarGroup,
|
||||||
|
Card,
|
||||||
CardMedia,
|
CardMedia,
|
||||||
Container,
|
Container,
|
||||||
|
Divider,
|
||||||
Fab,
|
Fab,
|
||||||
Grid,
|
Grid,
|
||||||
IconButton,
|
IconButton,
|
||||||
|
Slider,
|
||||||
Stack,
|
Stack,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
Typography,
|
Typography,
|
||||||
@@ -72,7 +77,8 @@ function ConversationDetails({ masterConversation }: { masterConversation: Maste
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Container maxWidth={false} disableGutters>
|
<Container maxWidth={false} disableGutters>
|
||||||
<Stack direction={'column'}>
|
<Stack direction={'column'} sx={{ position: 'relative' }}>
|
||||||
|
{/* conversation header details and controls */}
|
||||||
<Box sx={{ p: 2, boxShadow: 3, zIndex: 10 }}>
|
<Box sx={{ p: 2, boxShadow: 3, zIndex: 10 }}>
|
||||||
<Stack direction="row" alignItems="center">
|
<Stack direction="row" alignItems="center">
|
||||||
<IconButton color="primary" size="small">
|
<IconButton color="primary" size="small">
|
||||||
@@ -114,16 +120,24 @@ function ConversationDetails({ masterConversation }: { masterConversation: Maste
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Grid container>
|
{/* main canvas */}
|
||||||
{masterConversation.room &&
|
<Container maxWidth={'sm'} sx={{ pt: 2 }}>
|
||||||
Object.entries(masterConversation.room).map(([userId, userPeerContents]) => {
|
<ConversationChunk />
|
||||||
return (
|
</Container>
|
||||||
<Grid item key={`userPeerRenderConvoDetails-${userId}`}>
|
|
||||||
<Video stream={userPeerContents.stream} />
|
<Container maxWidth={false}>
|
||||||
</Grid>
|
<Stack direction="row" alignItems={'center'}>
|
||||||
);
|
{masterConversation.room &&
|
||||||
})}
|
Object.entries(masterConversation.room).map(([userId, userPeerContents]) => {
|
||||||
</Grid>
|
return (
|
||||||
|
<Video
|
||||||
|
key={`userPeerRenderConvoDetails-${userId}`}
|
||||||
|
stream={userPeerContents.stream}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Stack>
|
||||||
|
</Container>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
@@ -151,3 +165,74 @@ function Video({ stream }: { stream: MediaStream }) {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const marks = [
|
||||||
|
{
|
||||||
|
value: 0,
|
||||||
|
label: 'Arjun',
|
||||||
|
avatar: <Avatar alt="Remy Sharp" src="https://mui.com/static/images/avatar/1.jpg" />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 20,
|
||||||
|
label: 'Nick',
|
||||||
|
avatar: <Avatar alt="Remy Sharp" src="https://mui.com/static/images/avatar/3.jpg" />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 37,
|
||||||
|
label: 'Jeremy',
|
||||||
|
avatar: <Avatar alt="Remy Sharp" src="https://mui.com/static/images/avatar/2.jpg" />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 100,
|
||||||
|
label: '43 sec',
|
||||||
|
avatar: <Avatar alt="Remy Sharp" src="https://mui.com/static/images/avatar/2.jpg" />,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
function valuetext(value: number) {
|
||||||
|
return `${value}°C`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: get label based on what region we are in
|
||||||
|
function valueLabelFormat(value: number) {
|
||||||
|
return (
|
||||||
|
marks.find((mark) => mark.value === value)?.avatar ?? (
|
||||||
|
<Avatar alt="Agnes Walker" src="https://mui.com/static/images/avatar/5.jpg" />
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function ConversationChunk() {
|
||||||
|
return (
|
||||||
|
<Card sx={{ display: 'flex', flexDirection: 'column', p: 2 }}>
|
||||||
|
<Stack direction={'row'} alignItems={'center'} justifyContent="flex-end" spacing={2}>
|
||||||
|
<Typography variant={'caption'} color={'GrayText'}>
|
||||||
|
Monday
|
||||||
|
</Typography>
|
||||||
|
|
||||||
|
<Divider orientation={'vertical'} flexItem />
|
||||||
|
|
||||||
|
<Typography variant={'caption'} color={'GrayText'}>
|
||||||
|
2:30pm
|
||||||
|
</Typography>
|
||||||
|
|
||||||
|
<Divider orientation={'vertical'} flexItem />
|
||||||
|
|
||||||
|
<Typography variant={'caption'} color={'GrayText'}>
|
||||||
|
6/18/22
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
|
<Box sx={{ position: 'relative', p: 4 }}>
|
||||||
|
<Slider
|
||||||
|
aria-label="Restricted values"
|
||||||
|
defaultValue={25}
|
||||||
|
valueLabelFormat={valueLabelFormat}
|
||||||
|
getAriaValueText={valuetext}
|
||||||
|
valueLabelDisplay="on"
|
||||||
|
marks={marks}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user