Last active
September 18, 2021 18:05
-
-
Save SafaElmali/6bf158b285edbead4791ee1b7109f4a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "../styles/productDetail.css"; | |
import { useState } from "react"; | |
import ModalWithPortal from "./ModalWithPortal"; | |
import ModalWithoutPortal from "./ModalWithoutPortal"; | |
const ProductDetail = () => { | |
const [isOpen, setIsOpen] = useState(false); | |
const [isOpenPortal, setIsOpenPortal] = useState(false); | |
const handleOpen = () => { | |
setIsOpen(true); | |
}; | |
const handleOpenPortal = () => { | |
setIsOpenPortal(true); | |
}; | |
return ( | |
<div className="product-container"> | |
.... | |
<div className="product-button-container"> | |
<button className="add-to-basket-button" onClick={handleOpenPortal}> | |
Sepete Ekle (Portal) | |
</button> | |
<button className="add-to-basket-button" onClick={handleOpen}> | |
Sepete Ekle (Portalsız) | |
</button> | |
</div> | |
</div> | |
<ModalWithPortal | |
isOpenPortal={isOpenPortal} | |
setIsOpenPortal={setIsOpenPortal} | |
productName={"Pubg"} | |
/> | |
<ModalWithoutPortal | |
isOpen={isOpen} | |
setIsOpen={setIsOpen} | |
productName={"Pubg"} | |
/> | |
</div> | |
); | |
}; | |
export default ProductDetail; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment