Skip to content

Commit

Permalink
Complete open sidemenu #11
Browse files Browse the repository at this point in the history
  • Loading branch information
prayag17 committed Jul 6, 2023
1 parent 83ebd5d commit ce4b635
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 36 deletions.
12 changes: 12 additions & 0 deletions src/components/icons/mdiBackburger.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";

import { mdiBackburger } from "@mdi/js";

export const MdiBackburger = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiBackburger}></path>
</SvgIcon>
);
};
12 changes: 12 additions & 0 deletions src/components/icons/mdiClose.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";

import { mdiClose } from "@mdi/js";

export const MdiClose = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiClose}></path>
</SvgIcon>
);
};
30 changes: 12 additions & 18 deletions src/components/menu/sidemenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import Divider from "@mui/material/Divider";
import MuiDrawer from "@mui/material/Drawer";
import ListItemText from "@mui/material/ListItemText";

import { MdiMenu } from "../icons/mdiMenu";
import { MdiClose } from "../icons/mdiClose";
import { MdiLogoutVariant } from "../icons/mdiLogoutVariant";

import { MediaCollectionTypeIconCollection } from "../../components/utils/iconsCollection.jsx";
Expand Down Expand Up @@ -80,7 +80,6 @@ export const SideMenu = ({}) => {
enabled: !!user.data,
networkMode: "always",
});
const handleDrawerOpen = () => {};

const handleLogout = async () => {
console.log("Logging out user...");
Expand Down Expand Up @@ -139,14 +138,7 @@ export const SideMenu = ({}) => {
sx={{
justifyContent: "center",
}}
>
{/* <div>
<Avatar src={""}/>
<Typography variant="h3">
{user["Name"]}
</Typography>
</div> */}
</DrawerHeader>
></DrawerHeader>
<Divider />
{libraries.isLoading ? (
<>
Expand Down Expand Up @@ -287,27 +279,29 @@ export const SideMenu = ({}) => {

<MuiDrawer
open={open}
variant="persistent"
onClose={() => setDrawerOpen(false)}
elevation={0}
PaperProps={{
sx: {
m: 1,
height: "auto",
minHeight: "-webkit-fill-available",
background: "transparent",
backdropFilter: "blur(15px)",
borderRadius: "15px",
background: "rgb(0 0 0 / 0.5)",
backdropFilter: "blur(10px)",
boxShadow: "0 0 15px rgb(0 0 0 / 0.2)",
width: 260,
},
}}
className="sidemenu-open"
>
<DrawerHeader
className="Mui-DrawerHeader"
sx={{
justifyContent: "center",
justifyContent: "flex-start",
}}
></DrawerHeader>
>
<IconButton onClick={() => setDrawerOpen(false)}>
<MdiClose />
</IconButton>
</DrawerHeader>
<Divider />
{libraries.isLoading ? (
<>
Expand Down
8 changes: 8 additions & 0 deletions src/components/menu/sidemenu.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@
transform: translateX(0);
}
}
&-open {
.sidemenu-item::before {
width: 100%;
inset: 0;
border-radius: 0;
z-index: -1;
}
}
}
10 changes: 5 additions & 5 deletions src/routes/item/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,8 @@ const ItemDetail = () => {
setAudioTracks(audios);
setSubtitleTracks(subs);

setCurrentVideoTrack(videos[0]?.DisplayTitle);
setCurrentAudioTrack(audios[0]?.DisplayTitle);
setCurrentVideoTrack(videos[0]?.Index);
setCurrentAudioTrack(audios[0]?.Index);
setCurrentSubTrack(subs[0]?.Index);
}
}, [item.isSuccess]);
Expand Down Expand Up @@ -1054,7 +1054,7 @@ const ItemDetail = () => {
.VideoType
) {
setUrl(
`${window.api.basePath}/Videos/${item.data.Id}/stream.${item.data.MediaSources[0].Container}?Static=true&mediaSourceId=${item.data.Id}&deviceId=${window.api.deviceInfo.id}&api_key=${window.api.accessToken}&Tag=${item.data.MediaSources[0].ETag}`,
`${window.api.basePath}/Videos/${item.data.Id}/stream.${item.data.MediaSources[0].Container}?Static=true&mediaSourceId=${item.data.Id}&deviceId=${window.api.deviceInfo.id}&api_key=${window.api.accessToken}&Tag=${item.data.MediaSources[0].ETag}&videoStreamIndex=${currentVideoTrack}&audioStreamIndex=${currentAudioTrack}`,
);
setPosition(
item
Expand Down Expand Up @@ -1602,7 +1602,7 @@ const ItemDetail = () => {
sindex
}
value={
stream.DisplayTitle
stream.Index
}
>
{
Expand Down Expand Up @@ -1673,7 +1673,7 @@ const ItemDetail = () => {
sindex
}
value={
stream.DisplayTitle
stream.Index
}
>
{
Expand Down
22 changes: 9 additions & 13 deletions src/routes/player/videoPlayer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -556,19 +556,15 @@ export const VideoPlayer = () => {
attributes: {
crossOrigin: "true",
},
tracks: [],
// tracks: subtitleTracksStore.map((sub, index) => {
// return {
// kind: "subtitles",
// src: `${window.api.basePath}/Videos/${itemId}/${itemId}/Subtitles/${sub.Index}/Stream.vtt?api_key=${window.api.accessToken}`,
// srcLang: sub?.Language,
// default: false,
// mode:
// sub.Index == currentSubtrack
// ? "showing"
// : "hidden",
// };
// }),
tracks: [
{
kind: "subtitles",
src: `${window.api.basePath}/Videos/${itemId}/${itemId}/Subtitles/${currentSubtrack}/Stream.vtt?api_key=${window.api.accessToken}`,
srcLang: "",
default: true,
mode: "showing",
},
],
},
}}
playbackRate={availableSpeeds[speed]}
Expand Down

0 comments on commit ce4b635

Please sign in to comment.