From cc09b88e8d535103cd55f5558987b2c9f34004c0 Mon Sep 17 00:00:00 2001 From: felipe torres Date: Tue, 9 Jul 2024 06:56:24 -0700 Subject: [PATCH] transition and url name change --- app/api/gql/gql.ts | 8 +-- app/api/gql/graphql.ts | 10 +-- .../{MyTickets => MyEvents}/MyTicketsList.tsx | 6 +- .../MyTicketsLoadingSkeleton.tsx | 0 .../graphql/myEvents.generated.tsx} | 68 +++++++++---------- .../graphql/myEvents.gql} | 2 +- app/components/Navbar/index.tsx | 2 +- app/root.tsx | 22 +++++- .../{tickets => my-events}/index.tsx | 4 +- app/utils/urls.ts | 6 +- 10 files changed, 72 insertions(+), 56 deletions(-) rename app/components/{MyTickets => MyEvents}/MyTicketsList.tsx (90%) rename app/components/{MyTickets => MyEvents}/MyTicketsLoadingSkeleton.tsx (100%) rename app/components/{MyTickets/graphql/myTickets.generated.tsx => MyEvents/graphql/myEvents.generated.tsx} (64%) rename app/components/{MyTickets/graphql/myTickets.gql => MyEvents/graphql/myEvents.gql} (97%) rename app/routes/_authenticated/{tickets => my-events}/index.tsx (83%) diff --git a/app/api/gql/gql.ts b/app/api/gql/gql.ts index 541bf6a..8f691e1 100644 --- a/app/api/gql/gql.ts +++ b/app/api/gql/gql.ts @@ -15,8 +15,8 @@ import type { TypedDocumentNode as DocumentNode } from "@graphql-typed-document- const documents = { "query FetchExampleEvents($input: PaginatedInputEventsSearchInput!) {\n searchEvents(input: $input) {\n data {\n id\n description\n community {\n id\n name\n }\n tags {\n id\n name\n description\n }\n }\n }\n}": types.FetchExampleEventsDocument, - "query myTickets($input: PaginatedInputEventsSearchInput!, $userTicketSearchInput: EventsTicketsSearchInput) {\n searchEvents(input: $input) {\n data {\n id\n name\n description\n startDateTime\n community {\n id\n name\n }\n status\n usersTickets(input: $userTicketSearchInput) {\n id\n approvalStatus\n paymentStatus\n redemptionStatus\n ticketTemplate {\n description\n id\n }\n }\n }\n pagination {\n currentPage\n pageSize\n totalPages\n totalRecords\n }\n }\n}": - types.MyTicketsDocument, + "query myEvents($input: PaginatedInputEventsSearchInput!, $userTicketSearchInput: EventsTicketsSearchInput) {\n searchEvents(input: $input) {\n data {\n id\n name\n description\n startDateTime\n community {\n id\n name\n }\n status\n usersTickets(input: $userTicketSearchInput) {\n id\n approvalStatus\n paymentStatus\n redemptionStatus\n ticketTemplate {\n description\n id\n }\n }\n }\n pagination {\n currentPage\n pageSize\n totalPages\n totalRecords\n }\n }\n}": + types.MyEventsDocument, "mutation createPurchaseOrder($input: TicketClaimInput!) {\n claimUserTicket(input: $input) {\n __typename\n ... on PurchaseOrder {\n __typename\n id\n currency {\n id\n }\n finalPrice\n paymentLink\n status\n tickets {\n id\n approvalStatus\n redemptionStatus\n paymentStatus\n }\n }\n ... on RedeemUserTicketError {\n __typename\n error\n errorMessage\n }\n }\n}": types.CreatePurchaseOrderDocument, "fragment EventTicketFragment on Ticket {\n id\n name\n description\n quantity\n isFree\n startDateTime\n status\n isUnlimited\n prices {\n id\n amount\n currency {\n currency\n id\n }\n }\n}": @@ -49,8 +49,8 @@ export function graphql( * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function graphql( - source: "query myTickets($input: PaginatedInputEventsSearchInput!, $userTicketSearchInput: EventsTicketsSearchInput) {\n searchEvents(input: $input) {\n data {\n id\n name\n description\n startDateTime\n community {\n id\n name\n }\n status\n usersTickets(input: $userTicketSearchInput) {\n id\n approvalStatus\n paymentStatus\n redemptionStatus\n ticketTemplate {\n description\n id\n }\n }\n }\n pagination {\n currentPage\n pageSize\n totalPages\n totalRecords\n }\n }\n}", -): (typeof documents)["query myTickets($input: PaginatedInputEventsSearchInput!, $userTicketSearchInput: EventsTicketsSearchInput) {\n searchEvents(input: $input) {\n data {\n id\n name\n description\n startDateTime\n community {\n id\n name\n }\n status\n usersTickets(input: $userTicketSearchInput) {\n id\n approvalStatus\n paymentStatus\n redemptionStatus\n ticketTemplate {\n description\n id\n }\n }\n }\n pagination {\n currentPage\n pageSize\n totalPages\n totalRecords\n }\n }\n}"]; + source: "query myEvents($input: PaginatedInputEventsSearchInput!, $userTicketSearchInput: EventsTicketsSearchInput) {\n searchEvents(input: $input) {\n data {\n id\n name\n description\n startDateTime\n community {\n id\n name\n }\n status\n usersTickets(input: $userTicketSearchInput) {\n id\n approvalStatus\n paymentStatus\n redemptionStatus\n ticketTemplate {\n description\n id\n }\n }\n }\n pagination {\n currentPage\n pageSize\n totalPages\n totalRecords\n }\n }\n}", +): (typeof documents)["query myEvents($input: PaginatedInputEventsSearchInput!, $userTicketSearchInput: EventsTicketsSearchInput) {\n searchEvents(input: $input) {\n data {\n id\n name\n description\n startDateTime\n community {\n id\n name\n }\n status\n usersTickets(input: $userTicketSearchInput) {\n id\n approvalStatus\n paymentStatus\n redemptionStatus\n ticketTemplate {\n description\n id\n }\n }\n }\n pagination {\n currentPage\n pageSize\n totalPages\n totalRecords\n }\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/app/api/gql/graphql.ts b/app/api/gql/graphql.ts index 3a6214c..ea766f5 100644 --- a/app/api/gql/graphql.ts +++ b/app/api/gql/graphql.ts @@ -873,12 +873,12 @@ export type FetchExampleEventsQuery = { }; }; -export type MyTicketsQueryVariables = Exact<{ +export type MyEventsQueryVariables = Exact<{ input: PaginatedInputEventsSearchInput; userTicketSearchInput?: InputMaybe; }>; -export type MyTicketsQuery = { +export type MyEventsQuery = { searchEvents: { data: Array<{ id: string; @@ -1127,13 +1127,13 @@ export const FetchExampleEventsDocument = { FetchExampleEventsQuery, FetchExampleEventsQueryVariables >; -export const MyTicketsDocument = { +export const MyEventsDocument = { kind: "Document", definitions: [ { kind: "OperationDefinition", operation: "query", - name: { kind: "Name", value: "myTickets" }, + name: { kind: "Name", value: "myEvents" }, variableDefinitions: [ { kind: "VariableDefinition", @@ -1310,7 +1310,7 @@ export const MyTicketsDocument = { }, }, ], -} as unknown as DocumentNode; +} as unknown as DocumentNode; export const CreatePurchaseOrderDocument = { kind: "Document", definitions: [ diff --git a/app/components/MyTickets/MyTicketsList.tsx b/app/components/MyEvents/MyTicketsList.tsx similarity index 90% rename from app/components/MyTickets/MyTicketsList.tsx rename to app/components/MyEvents/MyTicketsList.tsx index 5df07bc..d792c40 100644 --- a/app/components/MyTickets/MyTicketsList.tsx +++ b/app/components/MyEvents/MyTicketsList.tsx @@ -1,13 +1,13 @@ import { formatDistanceToNow, subDays, format } from "date-fns"; import { ArrowRight } from "lucide-react"; -import { useMyTicketsSuspenseQuery } from "~/components/MyTickets/graphql/myTickets.generated"; +import { useMyEventsSuspenseQuery } from "~/components/MyEvents/graphql/myEvents.generated"; import { Button } from "~/components/ui/button"; import { Card, CardTitle } from "~/components/ui/card"; import { urls } from "~/utils/urls"; export const MyTicketsList = () => { - const { data } = useMyTicketsSuspenseQuery({ + const { data } = useMyEventsSuspenseQuery({ variables: { input: { search: { @@ -53,7 +53,7 @@ export const MyTicketsList = () => {