Merged in feat/LOY-421-Next-Stay (pull request #3026)
Feat(LOY-421): Next Stay * feat(LOY-421): Next stay WIP * fix(LOY-421): clean upp css and jsx * chore(LOY-421): css cleanup * fix(LOY-421): fix test * only show button if isWebAppOrigin is true * chore(LOY-421): update section header component * chore(LOY-421): remove redundant test case Approved-by: Matilda Landström
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
|
||||
import { Section } from "@/components/Section"
|
||||
import { SectionHeader } from "@/components/Section/Header"
|
||||
import SectionLink from "@/components/Section/Link"
|
||||
|
||||
import NextStayContent from "./NextStayContent"
|
||||
|
||||
import styles from "./nextStay.module.css"
|
||||
|
||||
import type { NextStayProps } from "./types"
|
||||
|
||||
export default async function NextStay({ title, link }: NextStayProps) {
|
||||
const caller = await serverClient()
|
||||
const nextStay = await caller.user.stays.next()
|
||||
|
||||
if (!nextStay) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<Section className={styles.container}>
|
||||
{title && <SectionHeader heading={title} link={link} />}
|
||||
<NextStayContent nextStay={nextStay} />
|
||||
{link && <SectionLink link={link} variant="mobile" />}
|
||||
</Section>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user