Skip to content
Merged
Show file tree
Hide file tree
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
38 changes: 38 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"react-dom": "^18.2.0",
"react-feather": "^2.0.10",
"react-hook-form": "^7.32.0",
"react-hot-toast": "^2.4.0",
"react-markdown": "^8.0.3",
"react-portal": "^4.2.2",
"react-qr-code": "^2.0.8",
Expand Down
1 change: 1 addition & 0 deletions pages/p/ticket/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const TicketPage = ({ ticket }: { ticket: PublicTicket }) => {
ticketType={ticket.ticketType}
ticketSeason={ticket.ticketSeason}
fadeIn
showGetTicket
/>
</div>
);
Expand Down
6 changes: 6 additions & 0 deletions pages/tickets/success.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ export default function Tickets(props: PageProps) {
fadeIn
/>
) : null}
{(latestTickets?.length ?? 0) > 1 ? (
<Paragraph>
(Sabemos que tienes {latestTickets?.length} tickets pero no
podemos mostrar tantos en esta pantalla)
</Paragraph>
) : null}
<Paragraph>
Tu compra fue exitosa. Siempre podrás ver los tickets en{" "}
<Link href={"/mytickets"} passHref>
Expand Down
40 changes: 30 additions & 10 deletions src/Components/Ticket/Ticket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@ import Atropos from "atropos/react";
import { AnimatePresence, motion, MotionProps } from "framer-motion";
import { useEffect, useState } from "react";
import { Facebook, Linkedin, Twitter, Copy } from "react-feather";
import toast, { Toaster } from "react-hot-toast";

import { jsconfTheme, ViewportSizes } from "../../../styles/theme";
import { GenericLink } from "../TicketSection/shared";

const SharingInfo = styled.div`
text-align: center;
margin-bottom: 64px;
`;

const GetTicket = styled.div`
text-align: center;
margin-bottom: 64px;
`;

const AtroposContainer = styled.div`
overflow: hidden;
`;
Expand Down Expand Up @@ -139,6 +147,7 @@ const TicketHeader = styled.div`
display: flex;
align-items: center;
`;

const StyledTr = styled.div`
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -268,9 +277,9 @@ const SocialButton = styled.button(({ theme }) => [
width: "100%",
transform: "scaleX(0)",
height: "4px",
bottom: 0,
bottom: "-8px",
left: 0,
backgroundColor: theme.colors.social.twitter,
backgroundColor: "#fff",
transformOrigin: "bottom right",
transition: "transform 0.25s ease-out",
},
Expand All @@ -294,7 +303,7 @@ const SocialAnchor = styled.a<{ type: "twitter" | "facebook" | "linkedin" }>(
width: "100%",
transform: "scaleX(0)",
height: "4px",
bottom: 0,
bottom: "-8px",
left: 0,
backgroundColor: theme.colors.social[type],
transformOrigin: "bottom right",
Expand Down Expand Up @@ -333,6 +342,7 @@ export const Ticket = ({
ticketSeason,
userTicketStatus,
fadeIn,
showGetTicket = false,
}: {
userTicketId: string;
userPhoto: string | null;
Expand All @@ -343,6 +353,7 @@ export const Ticket = ({
ticketSeason: string;
userTicketStatus: string;
fadeIn: boolean;
showGetTicket?: boolean;
}) => {
const [loaded, setLoaded] = useState(!fadeIn);
const animation = useAnimation();
Expand Down Expand Up @@ -429,33 +440,42 @@ export const Ticket = ({
)}`}
target="_blank"
rel="noreferrer"
type="twitter"
type="facebook"
>
<Facebook size={32} />
</SocialAnchor>
<SocialAnchor
href={`https://www.linkedin.com/sharing/share-offsite?url=${publicUrl}`}
target="_blank"
rel="noreferrer"
type="twitter"
type="linkedin"
>
<Linkedin size={32} />
</SocialAnchor>
<SocialButton
onClick={() => {
/* eslint-disable @typescript-eslint/no-floating-promises */
navigator.clipboard.writeText(publicUrl).then(() => {
console.log(1);
});
navigator.clipboard
.writeText(publicUrl)
.then(() => {
toast.success("Enlace copiado con éxito!");
})
.catch(() => {
toast.error("Hubo un error, intentalo nuevamente!");
});
}}
>
<Copy size={32} />
</SocialButton>
<Toaster />
</SharingInfo>
{showGetTicket ? (
<GetTicket>
<GenericLink href="/tickets">Obtener Tickets</GenericLink>
</GetTicket>
) : null}
</MotionContainer>
)}
</AnimatePresence>

{/* <AnimatePresence mode="popLayout" initial={false}> */}
</AtroposContainer>
);
Expand Down
42 changes: 42 additions & 0 deletions src/Components/TicketSection/shared.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,48 @@ export const GenericBtn = styled(motion.button)`
}
`;

export const GenericLink = styled(motion.a)`
border-color: ${({ theme }) => theme.colors.jsconfYellow};
color: ${({ theme }) => theme.colors.jsconfYellow};
border-width: 2px;
border-style: solid;
font-weight: 700;
padding-left: 1rem;
padding-right: 1rem;
display: inline-flex;
gap: 0.5rem;
justify-content: center;
align-items: center;
line-height: 0;
height: 50px;
transition-duration: 250ms;
transition-property: all;
cursor: pointer;
&:active,
&:focus,
&:hover {
box-shadow: 0 0.5em 0.5em -0.4em ${({ theme }) => theme.colors.jsconfRed};
border-color: ${({ theme }) => theme.colors.jsconfRed};
color: ${({ theme }) => theme.colors.jsconfRed};
}
&:focus,
&:hover {
transform: translateY(-0.25em);
}
&:active {
box-shadow: none;
transform: translateY(0em);
}
&:disabled,
&:disabled:hover {
border-color: ${({ theme }) => transparentize(0.78)(theme.colors.white)};
color: ${({ theme }) => transparentize(0.75)(theme.colors.white)};
box-shadow: none;
cursor: not-allowed;
transform: translateY(0em);
}
`;

export const Container = styled.div`
display: flex;
flex-direction: column;
Expand Down