Skip to content

Commit

Permalink
fix: standardize casing for setIsGift
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitb35 committed Nov 14, 2024
1 parent ed270b3 commit dd2b8e3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function index({
setSelectedProjects,
loadselectedProjects,
setGiftDetails,
setisGift,
setIsGift,
setpaymentSetup,
setcurrency,
setContactDetails,
Expand Down Expand Up @@ -131,7 +131,7 @@ function index({
// If gift details are present, initialize gift in context
if (giftDetails && isGift) {
setGiftDetails(giftDetails);
setisGift(true);
setIsGift(true);
}
}, []);

Expand Down
2 changes: 1 addition & 1 deletion src/Common/Types/QueryParamContextInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { Dispatch, SetStateAction } from "react";

export default interface QueryParamContextInterface {
isGift: boolean;
setisGift: Dispatch<SetStateAction<boolean>>;
setIsGift: Dispatch<SetStateAction<boolean>>;
giftDetails: GiftDetails | NoGift;
setGiftDetails: Dispatch<SetStateAction<GiftDetails | NoGift>>;
contactDetails: ContactDetails;
Expand Down
4 changes: 2 additions & 2 deletions src/Donations/Micros/GiftForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const EMPTY_GIFT_DETAILS: Readonly<NoGift> = {
export default function GiftForm(): ReactElement {
const { t } = useTranslation("common");
const [showEmail, setShowEmail] = React.useState(false);
const { giftDetails, setGiftDetails, isGift, setisGift, projectDetails } =
const { giftDetails, setGiftDetails, isGift, setIsGift, projectDetails } =
React.useContext(QueryParamContext);

const defaultDetails: GiftFormData = {
Expand Down Expand Up @@ -80,7 +80,7 @@ export default function GiftForm(): ReactElement {
name="show-gift-form-toggle"
checked={isGift}
onChange={() => {
setisGift((isGift) => !isGift);
setIsGift((isGift) => !isGift);
}}
id="show-gift-form-toggle"
/>
Expand Down
4 changes: 2 additions & 2 deletions src/Donations/Micros/PaymentStatus/FailedDonation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function FailedDonation({
setprojectDetails,
setquantity,
setContactDetails,
setisGift,
setIsGift,
setGiftDetails,
setfrequency,
setdonationStep,
Expand Down Expand Up @@ -70,7 +70,7 @@ function FailedDonation({
setcurrency(donation.currency);
if (donation.giftRequest) {
const { giftRequest } = donation;
setisGift(giftRequest.recipientName ? true : false);
setIsGift(giftRequest.recipientName ? true : false);

const _giftDetails: GiftDetails = {
...(giftRequest.type === "invitation"
Expand Down
4 changes: 2 additions & 2 deletions src/Layout/QueryParamContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const QueryParamProvider: FC = ({ children }) => {
const [quantity, setquantity] = useState(50);
const [frequency, setfrequency] = useState<string>("once");

const [isGift, setisGift] = useState<boolean>(false);
const [isGift, setIsGift] = useState<boolean>(false);
const [giftDetails, setGiftDetails] = useState<GiftDetails | NoGift>({
recipientName: "",
recipientEmail: "",
Expand Down Expand Up @@ -522,7 +522,7 @@ const QueryParamProvider: FC = ({ children }) => {
<QueryParamContext.Provider
value={{
isGift,
setisGift,
setIsGift,
giftDetails,
setGiftDetails,
contactDetails,
Expand Down

0 comments on commit dd2b8e3

Please sign in to comment.