Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds terms and conditions acceptance to checkout #71

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 42 additions & 12 deletions app/components/TicketsSaleFlow/Stepper.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { useState } from "react";

import { Button } from "~/components/ui/button";
import {
Popover,
Expand All @@ -12,18 +14,46 @@ export const SecondStepFooter = ({
onClickNext,
isDisabled,
popoverContent,
}: SecondStepFooterProps) => (
<div className="mt-2 flex justify-end gap-2 text-right">
<Button variant="outline" onClick={onClickPrevious}>
Atras
</Button>
<ConditionalPopoverWrapper popoverContent={popoverContent}>
<Button disabled={isDisabled} onClick={onClickNext}>
Pagar
</Button>
</ConditionalPopoverWrapper>
</div>
);
}: SecondStepFooterProps) => {
const [acceptTerms, setAcceptTerms] = useState(false);

return (
<>
<div className="ml-auto">
<label className="ms-2 flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-gray-300">
<input
type="checkbox"
className="size-4"
checked={acceptTerms}
onChange={() => setAcceptTerms((prev) => !prev)}
/>
<div>
Estoy de acuerdo con los{" "}
<a
href="https://legal.jsconf.cl/terminos_de_compra_e_imagen/"
className="text-blue-600 hover:underline dark:text-blue-500"
target="_blank"
rel="noreferrer"
>
términos y condiciones
</a>
.
</div>
</label>
</div>
<div className="mt-2 flex justify-end gap-2 text-right">
<Button variant="outline" onClick={onClickPrevious}>
Atras
</Button>
<ConditionalPopoverWrapper popoverContent={popoverContent}>
<Button disabled={isDisabled || !acceptTerms} onClick={onClickNext}>
Pagar
</Button>
</ConditionalPopoverWrapper>
</div>
</>
);
};

const ConditionalPopoverWrapper = ({
popoverContent,
Expand Down
Loading