Skip to content

Commit 9ee25a1

Browse files
authored
1 parent 35426ec commit 9ee25a1

File tree

2 files changed

+52
-2
lines changed

2 files changed

+52
-2
lines changed

pages/tickets/error.tsx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import styled from "@emotion/styled";
2+
import { ErrorComponent } from "../../src/Components/ErrorComponent";
3+
import { TicketsLayout } from "../../src/Components/Layouts/TicketsLayout";
4+
import { TicketsQueryQuery } from "../../src/graphql/tickets.generated";
5+
import { ParseQuery } from "../../src/helpers/types";
6+
import { ViewportSizes } from "../../styles/theme";
7+
8+
type Page = ParseQuery<TicketsQueryQuery["page"]>;
9+
10+
export interface PageProps {
11+
seo: Page["seo"];
12+
}
13+
14+
export const Container = styled.div`
15+
display: flex;
16+
flex-direction: column;
17+
padding-top: 8rem;
18+
padding-bottom: 8rem;
19+
gap: 3rem;
20+
transition: gap 250ms ease-in-out;
21+
@media (max-width: ${ViewportSizes.Phone}px) {
22+
gap: 4rem;
23+
}
24+
@media (min-width: ${ViewportSizes.TabletLandscape}px) {
25+
gap: 6rem;
26+
}
27+
@media (min-width: ${ViewportSizes.Desktop}px) {
28+
gap: 6rem;
29+
}
30+
`;
31+
32+
export default function Tickets(props: PageProps) {
33+
return (
34+
<Container>
35+
<ErrorComponent
36+
errorMessage={`No se pudo completar el pago de tu(s) ticket(s). Puede ser que tu tarjeta fuese declinada o que el procesador de pagos no pudiese comunicarse con tu institución bancaria. Porfavor intenta nuevamente. Si aun no funciona, ponte en contacto con nosotros.`}
37+
mainText="Algo salio mal"
38+
textoDelBoton="Navegar a /tickets"
39+
url="/tickets"
40+
/>
41+
</Container>
42+
);
43+
}
44+
45+
Tickets.getLayout = TicketsLayout;

src/Components/ErrorComponent/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const ImageWrapper = styled.section`
3939
`;
4040
const H1404 = styled(H1)`
4141
font-size: 70px;
42+
text-align: center;
4243
@media (min-width: ${ViewportSizes.Phone}px) {
4344
font-size: 120px;
4445
}
@@ -67,10 +68,14 @@ const Wrapper = styled.div`
6768

6869
export const ErrorComponent = ({
6970
errorMessage,
71+
textoDelBoton = "Volver al home",
72+
mainText = "OOPS!",
7073
url = "/",
7174
}: {
7275
errorMessage: string;
76+
mainText?: string;
7377
url?: string;
78+
textoDelBoton?: string;
7479
}) => {
7580
return (
7681
<StyledBlackWrapp>
@@ -80,10 +85,10 @@ export const ErrorComponent = ({
8085
alt=""
8186
/>
8287
</ImageWrapper>
83-
<H1404>OOPS!</H1404>
88+
<H1404>{mainText}</H1404>
8489
<Wrapper>
8590
<P>{errorMessage}</P>
86-
<PrimaryStyledLink href={url}>Volver al home</PrimaryStyledLink>
91+
<PrimaryStyledLink href={url}>{textoDelBoton}</PrimaryStyledLink>
8792
</Wrapper>
8893
</StyledBlackWrapp>
8994
);

0 commit comments

Comments
 (0)