-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 8.1.0
- 8.0.4
- 8.0.3
- 8.0.2
- 8.0.1
- 8.0.0
- 7.4.7
- 7.4.6
- 7.4.5
- 7.4.4
- 7.4.3
- 7.4.2
- 7.4.1
- 7.4.0
- 7.3.3
- 7.3.2
- 7.3.1
- 7.3.0
- 7.2.5
- 7.2.4
- 7.2.3
- 7.2.2
- 7.2.1
- 7.2.0
- 7.1.0
- 7.0.8
- 7.0.7
- 7.0.6
- 7.0.5
- 7.0.4
- 7.0.3
- 7.0.2
- 7.0.1
- 7.0.0
- 6.1.4
- 6.1.3
- 6.1.2
- 6.1.1
- 6.1.0
- 6.0.0
- 5.5.9
- 5.5.8
- 5.5.7
- 5.5.6
- 5.5.5
- 5.5.4
- 5.5.3
- 5.5.2
- 5.5.1
- 5.5.0
- 5.4.8
- 5.4.7
- 5.4.6
- 5.4.5
- 5.4.4
- 5.4.3
- 5.4.2
- 5.4.1
- 5.4.0
- 5.3.4
- 5.3.3
- 5.3.2
- 5.3.1
- 5.2.3
- 5.2.2
- 5.2.1
- 5.2.0
- 5.1.3
- 5.1.2
- 5.1.1
- 5.1.0
- 5.0.6
- 5.0.5
- 5.0.4
- 5.0.3
- 5.0.2
- 5.0.1
- 3.2.15
- 3.2.14
- 3.2.13
- 3.2.12
- 3.2.11
- 3.2.10
- 3.2.9
- 3.2.8
- 3.2.7
- 3.2.6
- 3.2.5
- 3.2.4
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.4
- 3.1.3
1 parent
bf9f93f
commit 52caabc
Showing
3 changed files
with
121 additions
and
131 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import React, { useCallback } from "react" | ||
import { | ||
Modal, | ||
ModalBody, | ||
ModalHeader, | ||
Button, | ||
ButtonGroup, | ||
CardImg, | ||
CardBody, | ||
CardGroup, | ||
Card as CardComponent, | ||
} from "reactstrap" | ||
import { Card } from "../../model/Cards" | ||
import { Suit } from "../../model/Suit" | ||
|
||
interface ModalOpts { | ||
modalVisible: boolean | ||
cancelCallback: () => void | ||
continueCallback: () => void | ||
suit: Suit | ||
cards: Card[] | ||
} | ||
|
||
const ThrowCardsWarningModal: React.FC<ModalOpts> = ({ | ||
modalVisible, | ||
cancelCallback, | ||
continueCallback, | ||
suit, | ||
cards, | ||
}) => { | ||
const callContinue = useCallback( | ||
(event: React.SyntheticEvent<HTMLButtonElement>) => { | ||
event.preventDefault() | ||
continueCallback() | ||
}, | ||
[] | ||
) | ||
return ( | ||
<Modal | ||
fade={true} | ||
size="lg" | ||
toggle={() => cancelCallback()} | ||
isOpen={modalVisible} | ||
> | ||
<ModalHeader> | ||
<CardImg | ||
alt="Suit" | ||
src={`/cards/originals/${suit}_ICON.svg`} | ||
className="thumbnail_size_extra_small left-padding" | ||
/>{" "} | ||
Are you sure you want to throw these cards away? | ||
</ModalHeader> | ||
<ModalBody className="called-modal"> | ||
<CardGroup className="gameModalCardGroup"> | ||
<CardComponent | ||
className="p-6 tableCloth" | ||
style={{ backgroundColor: "#333", borderColor: "#333" }} | ||
> | ||
<CardBody className="cardArea"> | ||
{cards.map((card) => ( | ||
<img | ||
key={`deleteCardModal_${card.name}`} | ||
alt={card.name} | ||
src={`/cards/thumbnails/${card.name}.png`} | ||
className="thumbnail_size" | ||
/> | ||
))} | ||
</CardBody> | ||
|
||
<CardBody className="buttonArea"> | ||
<ButtonGroup size="lg"> | ||
<Button | ||
type="button" | ||
color="primary" | ||
onClick={() => cancelCallback()} | ||
> | ||
Cancel | ||
</Button> | ||
<Button type="button" color="primary" onClick={callContinue}> | ||
Throw Cards | ||
</Button> | ||
</ButtonGroup> | ||
</CardBody> | ||
</CardComponent> | ||
</CardGroup> | ||
</ModalBody> | ||
</Modal> | ||
) | ||
} | ||
|
||
export default ThrowCardsWarningModal |