-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
removed SSR trpc calls instead SPA for logged in pages #6936
Changes from 16 commits
19e31d8
13403f1
c940183
2475c4b
4535777
85f28a4
d78ed0b
58024dc
e2dc7d5
db25dc9
50c388f
eb0464c
2656988
4d59472
d3d5521
751b9ae
d4454bb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,5 +1,4 @@ | ||||||
import { useAutoAnimate } from "@formkit/auto-animate/react"; | ||||||
import type { GetServerSidePropsContext } from "next"; | ||||||
import Link from "next/link"; | ||||||
import { useRouter } from "next/router"; | ||||||
import type { FC } from "react"; | ||||||
|
@@ -60,8 +59,6 @@ import { HttpError } from "@lib/core/http/error"; | |||||
import { EmbedButton, EmbedDialog } from "@components/Embed"; | ||||||
import SkeletonLoader from "@components/eventtype/SkeletonLoader"; | ||||||
|
||||||
import { ssrInit } from "@server/lib/ssr"; | ||||||
|
||||||
type EventTypeGroups = RouterOutputs["viewer"]["eventTypes"]["getByViewer"]["eventTypeGroups"]; | ||||||
type EventTypeGroupProfile = EventTypeGroups[number]["profile"]; | ||||||
|
||||||
|
@@ -128,17 +125,11 @@ const Item = ({ type, group, readOnly }: { type: EventType; group: EventTypeGrou | |||||
data-testid={"event-type-title-" + type.id}> | ||||||
{type.title} | ||||||
</span> | ||||||
{group.profile.slug ? ( | ||||||
<small | ||||||
className="hidden font-normal leading-4 text-gray-600 sm:inline" | ||||||
data-testid={"event-type-slug-" + type.id}> | ||||||
{`/${group.profile.slug}/${type.slug}`} | ||||||
</small> | ||||||
) : ( | ||||||
<></> | ||||||
)} | ||||||
<small | ||||||
className="hidden font-normal leading-4 text-gray-600 sm:inline" | ||||||
data-testid={"event-type-slug-" + type.id}>{`/${group.profile.slug}/${type.slug}`}</small> | ||||||
{readOnly && ( | ||||||
<span className="inline items-center rounded-sm bg-gray-100 px-1.5 py-0.5 text-xs font-medium text-gray-800 ltr:ml-2 ltr:mr-2 rtl:ml-2"> | ||||||
<span className="rtl:ml-2inline items-center rounded-sm bg-gray-100 px-1.5 py-0.5 text-xs font-medium text-gray-800 ltr:ml-2 ltr:mr-2"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here. also typo
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the span tag is already inline, it is redundant |
||||||
{t("readonly")} | ||||||
</span> | ||||||
)} | ||||||
|
@@ -564,18 +555,6 @@ const EventTypeListHeading = ({ | |||||
membershipCount, | ||||||
teamId, | ||||||
}: EventTypeListHeadingProps): JSX.Element => { | ||||||
const { t } = useLocale(); | ||||||
const router = useRouter(); | ||||||
|
||||||
const publishTeamMutation = trpc.viewer.teams.publish.useMutation({ | ||||||
onSuccess(data) { | ||||||
router.push(data.url); | ||||||
}, | ||||||
onError: (error) => { | ||||||
showToast(error.message, "error"); | ||||||
}, | ||||||
}); | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also not by me There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
return ( | ||||||
<div className="mb-4 flex items-center space-x-2"> | ||||||
<Avatar | ||||||
|
@@ -607,13 +586,6 @@ const EventTypeListHeading = ({ | |||||
</Link> | ||||||
)} | ||||||
</div> | ||||||
{!profile?.slug && !!teamId && ( | ||||||
<button onClick={() => publishTeamMutation.mutate({ teamId })}> | ||||||
<Badge variant="gray" className="mb-1 -ml-2"> | ||||||
{t("upgrade")} | ||||||
</Badge> | ||||||
</button> | ||||||
)} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this change intended for this PR¡ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no not from me There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
</div> | ||||||
); | ||||||
}; | ||||||
|
@@ -695,14 +667,4 @@ const EventTypesPage = () => { | |||||
); | ||||||
}; | ||||||
|
||||||
export const getServerSideProps = async (context: GetServerSidePropsContext) => { | ||||||
const ssr = await ssrInit(context); | ||||||
|
||||||
return { | ||||||
props: { | ||||||
trpcState: ssr.dehydrate(), | ||||||
}, | ||||||
}; | ||||||
}; | ||||||
|
||||||
export default EventTypesPage; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export { getServerSideProps } from "./[category]"; | ||
export { default } from "./[category]"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not from me :o
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before we merge can we undo this? i dont know where this came from @zomars @roae