Skip to content

Commit

Permalink
Merge pull request #277 from TokenScript/release/3.2.0
Browse files Browse the repository at this point in the history
fix to passive ux.
  • Loading branch information
nicktaras authored Oct 31, 2023
2 parents 1916c9f + a18bbfb commit 9beb09d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,28 @@
top: 37px;
text-align: center;
height: 100px;
max-height: 272px;
animation: fadeInSlide 1s;
overflow: scroll;
}
.discountTicketContainer, .discountAppliedContainer {
.discountTicketContainer {
max-height: 272px;
animation: fadeIn 1s;
overflow: scroll;
}

@keyframes fadeIn {
0% { opacity: 0; }
50% { opacity: 0; }
50% { opacity: 0; }
100% { opacity: 1; }
}

@keyframes fadeInSlide {
0% { opacity: 0; transform: translateY(-100%); }
50% { opacity: 0; }
100% { opacity: 1; transform: translateY(0); }
}

.smallCopy {
font-weight: 500;
text-align: center;
Expand All @@ -60,6 +70,10 @@
transform: scale(0.9);
}

.ticketWrapper {
transform: scale(0.9);
}

/* override Google Material */

.MuiDialogActions-root {
Expand Down
32 changes: 21 additions & 11 deletions hotel-bogota-passive-negotiation-website/src/BookingModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default function BookingModal({
}) {
// Modal State (open boolean)
const [open, setOpen] = React.useState(false);
const [loading, setLoading] = React.useState(true);

// Form state.
const [formInput, setFormInput] = useReducer(
Expand Down Expand Up @@ -74,8 +75,13 @@ export default function BookingModal({
localStorage.removeItem("booking-room-type");
setOpen(true);
}
setTimeout(() => {
setLoading(false);
}, 2000);
}, [discount]);



return (
<div>
<Button size="small" color="primary" onClick={handleClickOpen}>
Expand Down Expand Up @@ -127,15 +133,17 @@ export default function BookingModal({
{discount.value ? `🎉 ${discount.value}% discount has been applied to your hotel booking 🎉` : ""}
</DialogTitle>
}
{!discount.value &&
{!discount.value && loading === false &&
<div style={{ paddingTop: "20px" }}>
{tokens.length > 0 && (
<p className="smallCopy">
select token(s) to apply discount:
</p>
)}
</div>
}
{!discount.value && loading === false &&
<div className="discountTicketContainer">
<div style={{ paddingTop: "20px" }}>
{tokens.length > 0 && (
<p className="smallCopy">
select token(s) to apply discount:
</p>
)}
</div>
<div className="ticketWrapper">
{tokens?.map((token, index) => (
<div key={index}>
Expand All @@ -153,11 +161,13 @@ export default function BookingModal({
</div>
))}
</div>
<Button className="applyDiscount" disabled={!selectedPendingTokenInstances.length} onClick={applyDiscount} color="primary" variant="contained">
Apply Discount
</Button>
</div>
}
{!discount.value && loading === false &&
<Button className="applyDiscount" disabled={!selectedPendingTokenInstances.length} onClick={applyDiscount} color="primary" variant="contained">
Apply Discount
</Button>
}
<div className="divider"></div>
<TextField
id="booking-name"
Expand Down

0 comments on commit 9beb09d

Please sign in to comment.