Skip to content

Commit

Permalink
Merge pull request #33 from 4lysson-a/dev
Browse files Browse the repository at this point in the history
refactor(frontend): Remove unused Cart component and update Cart
  • Loading branch information
4lysson-a committed Aug 26, 2024
2 parents 54689ff + 2e70cc9 commit 70a357e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
1 change: 0 additions & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
<div id="pay-modal"></div>
<div id="preview-img"></div>
<div id="block-page"></div>
<div class="z-50 relative" id="cart"></div>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
Expand Down
7 changes: 1 addition & 6 deletions frontend/src/pages/Menu/Cart/index.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { useBackButton } from "@/hooks/useBackButton";
import React from "react";
import { createPortal } from "react-dom";
import FloatBtn from "./FloatBtn";
import CartModal from "./Modal";

function Cart() {
export default function Cart() {
const [isClose, setIsClose] = React.useState(true);

useBackButton(() => {
Expand All @@ -25,8 +24,4 @@ function Cart() {
<FloatBtn onClick={() => setIsClose(!isClose)} />
</div>
);
}

export default function CartWithPortal() {
return createPortal(<Cart />, document.getElementById("cart"));
}

0 comments on commit 70a357e

Please sign in to comment.