Skip to content

Commit

Permalink
Revert "feat(client): pwa download button (#19)" (#20)
Browse files Browse the repository at this point in the history
This reverts commit 940f469.
  • Loading branch information
junglesub authored Oct 9, 2024
1 parent 940f469 commit 481982b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 127 deletions.
74 changes: 0 additions & 74 deletions src/main/front/src/components/MainDrawer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import ListItemText from "@mui/material/ListItemText";
import InboxIcon from "@mui/icons-material/MoveToInbox";
import FavoriteIcon from "@mui/icons-material/Favorite";
import ViewListIcon from "@mui/icons-material/ViewList";
import DownloadIcon from "@mui/icons-material/Download";

import {
Badge,
BottomNavigation,
Expand All @@ -23,7 +21,6 @@ import {
import { Link, useLocation, useNavigate } from "react-router-dom";
import MyAppbar from "./MyAppbar";
import { useFeedCount } from "../hooks/useFeed";
import useDownloadPWA from "../hooks/useDownloadPWA";

const drawerWidth = 240;

Expand Down Expand Up @@ -85,8 +82,6 @@ const Drawer = styled(MuiDrawer, {

export default function MainDrawer() {
const navigate = useNavigate();
const handleDownload = useDownloadPWA();

// eslint-disable-next-line unused-imports/no-unused-vars
const [open, setOpen] = React.useState(false);
const location = useLocation();
Expand Down Expand Up @@ -217,75 +212,6 @@ export default function MainDrawer() {
</ListItem>
</Tooltip>
))}
<Tooltip
title="Download APP"
placement="right"
arrow
slotProps={{
popper: {
modifiers: [
{
name: "offset",
options: {
offset: [0, -14],
},
},
],
},
}}
>
<ListItem disablePadding sx={{ display: "block" }}>
<ListItemButton
onClick={() => {
handleDownload();
}}
sx={[
{
minHeight: 48,
px: 2.5,
my: 1.1,
},
open
? {
justifyContent: "initial",
}
: {
justifyContent: "center",
},
]}
>
<ListItemIcon
sx={[
{
minWidth: 0,
justifyContent: "center",
},
open
? {
mr: 3,
}
: {
mr: "auto",
},
]}
>
<DownloadIcon />
</ListItemIcon>
<ListItemText
primary="Download APP"
sx={[
open
? {
opacity: 1,
}
: {
opacity: 0,
},
]}
/>
</ListItemButton>
</ListItem>
</Tooltip>
</List>
</Box>
</Drawer>
Expand Down
21 changes: 7 additions & 14 deletions src/main/front/src/components/MyAppbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import Menu from "@mui/material/Menu";
import Container from "@mui/material/Container";
import MenuItem from "@mui/material/MenuItem";
import FeedIcon from "@mui/icons-material/Feed";
import { IconButton, Slide, Tooltip, useScrollTrigger } from "@mui/material";
import DownloadIcon from "@mui/icons-material/Download";
import useDownloadPWA from "../hooks/useDownloadPWA";
import { Slide, useScrollTrigger } from "@mui/material";

const settings = ["Profile", "Account", "Dashboard", "Logout"];

Expand All @@ -31,7 +29,6 @@ function HideOnScroll(props) {

function MyAppbar() {
const [anchorElUser, setAnchorElUser] = useState(null);
const handleDownload = useDownloadPWA();

// eslint-disable-next-line unused-imports/no-unused-vars
const handleOpenUserMenu = (event) => {
Expand Down Expand Up @@ -83,16 +80,12 @@ function MyAppbar() {
},
}}
></Box> */}
<Box sx={{ flexGrow: 0, position: "absolute", right: 0 }}>
<Tooltip title="Download PWA">
<IconButton
color="inherit"
onClick={handleDownload}
aria-label="download app"
>
<DownloadIcon />
</IconButton>
</Tooltip>
<Box sx={{ flexGrow: 0 }}>
{/* <Tooltip title="Open settings">
<IconButton onClick={handleOpenUserMenu} sx={{ p: 0 }}>
<Avatar alt="Remy Sharp" src="/static/images/avatar/2.jpg" />
</IconButton>
</Tooltip> */}
<Menu
sx={{ mt: "45px" }}
id="menu-appbar"
Expand Down
39 changes: 0 additions & 39 deletions src/main/front/src/hooks/useDownloadPWA.js

This file was deleted.

0 comments on commit 481982b

Please sign in to comment.