Skip to content

Commit

Permalink
fix: fixes visible currency selector for non tree donations while dis…
Browse files Browse the repository at this point in the history
…playing gift form
  • Loading branch information
mohitb35 committed Nov 21, 2024
1 parent fb98cd9 commit bc4af28
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 28 deletions.
28 changes: 14 additions & 14 deletions src/Donations/Micros/DonationTypes/BouquetDonations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ function BouquetDonations({ setopenCurrencyModal }: Props): ReactElement {
// return Math.trunc(Math.ceil(cost/5)*5);
// }
return (
<>
<div
className={`funding-selection-options-container ${
isGift && giftDetails.recipientName === "" ? "display-none" : ""
}`}
>
<div
className={`bouquet-selection ${
isGift && giftDetails.recipientName === "" ? "display-none" : ""
}`}
>
<div className="bouquet-selection-options-container">
{paymentSetup &&
paymentSetup.frequencies &&
paymentSetup.frequencies[`${frequency}`].options.map(
Expand All @@ -149,14 +149,14 @@ function BouquetDonations({ setopenCurrencyModal }: Props): ReactElement {
setisCustomDonation(false);
setCustomInputValue("");
}}
className={`funding-selection-option ${
className={`bouquet-selection-option ${
approximatelyEqual(option.quantity, quantity) &&
!isCustomDonation
? "funding-selection-option-selected"
? "bouquet-selection-option-selected"
: ""
}`}
>
<div className="funding-selection-option-text m-10">
<div className="bouquet-selection-option-text m-10">
<span style={{ fontSize: "18px" }}>
{paymentSetup.purpose === "conservation"
? option.quantity
Expand All @@ -175,8 +175,8 @@ function BouquetDonations({ setopenCurrencyModal }: Props): ReactElement {
</div>
) : (
<div
className={`funding-selection-option custom ${
isCustomDonation ? "funding-selection-option-selected" : ""
className={`bouquet-selection-option custom ${
isCustomDonation ? "bouquet-selection-option-selected" : ""
}`}
onClick={() => {
setisCustomDonation(true);
Expand All @@ -197,7 +197,7 @@ function BouquetDonations({ setopenCurrencyModal }: Props): ReactElement {
: []}
</p>
<input
className={"funding-custom-tree-input"}
className={"bouquet-custom-tree-input"}
style={{ fontSize: "18px" }}
onInput={(e: ChangeEvent<HTMLInputElement>) => {
// replaces any character other than number to blank
Expand Down Expand Up @@ -239,7 +239,7 @@ function BouquetDonations({ setopenCurrencyModal }: Props): ReactElement {
</div>
) : (
<div
className="funding-selection-option-text"
className="bouquet-selection-option-text"
style={{ fontSize: "18px" }}
>
<p style={{ margin: "5px" }}>
Expand Down Expand Up @@ -299,7 +299,7 @@ function BouquetDonations({ setopenCurrencyModal }: Props): ReactElement {
<TreeCostLoader width={150} />
</div>
)}
</>
</div>
);
}

Expand Down
14 changes: 7 additions & 7 deletions src/Donations/Micros/DonationTypes/FundingDonations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ function FundingDonations({ setopenCurrencyModal }: Props): ReactElement {
const customInputRef = React.useRef<HTMLInputElement>(null);

return (
<>
<div
className={`funding-selection-options-container ${
isGift && giftDetails.recipientName === "" ? "display-none" : ""
}`}
>
<div
className={`funding-selection ${
isGift && giftDetails.recipientName === "" ? "display-none" : ""
}`}
>
<div className="funding-selection-options-container">
{paymentSetup &&
paymentSetup.frequencies &&
paymentSetup.frequencies[`${frequency}`] &&
Expand Down Expand Up @@ -280,7 +280,7 @@ function FundingDonations({ setopenCurrencyModal }: Props): ReactElement {
<TreeCostLoader width={150} />
</div>
)}
</>
</div>
);
}
function getPaymentOptionIcons(logoName: string) {
Expand Down
22 changes: 15 additions & 7 deletions styles/donations.scss
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,15 @@
width: 0px;
}
}
.funding-selection-options-container {
.funding-selection-options-container,
.bouquet-selection-options-container {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 10px;
.funding-selection-option {
.funding-selection-option,
.bouquet-selection-option {
width: 130px;
margin: 10px;
// height: 80px;
Expand All @@ -325,12 +327,14 @@
flex: calc(50% - 20px);
}
&.funding-selection-option-selected,
&.bouquet-selection-option-selected,
&:hover,
&:focus {
cursor: pointer;
background-color: $primaryColor;
border: 1px solid $primaryColor;
.funding-selection-option-text {
.funding-selection-option-text,
.bouquet-selection-option-text {
color: $primaryFontColor;
p,
span {
Expand All @@ -349,7 +353,8 @@
&:active {
transform: scale(0.98);
}
.funding-selection-option-text {
.funding-selection-option-text,
.bouquet-selection-option-text {
text-align: left;
line-height: 1;
// margin-left: 12px;
Expand Down Expand Up @@ -479,7 +484,8 @@
outline: 0px;
font-size: 16px;
}
.funding-custom-tree-input {
.funding-custom-tree-input,
.bouquet-custom-tree-input {
border: 0px;
border-bottom: 2px solid $activeGreenBgTextColor;
width: 100%;
Expand Down Expand Up @@ -751,9 +757,11 @@
width: 100px;
padding: 12px;
}
.funding-selection-options-container {
.funding-selection-options-container,
.bouquet-selection-options-container {
margin-top: 10px;
.funding-selection-option {
.funding-selection-option,
.bouquet-selection-option {
width: 160px;
&.monthly-option {
width: 100px;
Expand Down

0 comments on commit bc4af28

Please sign in to comment.