turned template into create cli
This commit is contained in:
26
template/apps/client/src/app/page.tsx
Normal file
26
template/apps/client/src/app/page.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import { sanityFetch } from "@/sanity/live";
|
||||
import CTA from "@/components/section/cta";
|
||||
import { getImage, getImages } from "@/lib/asset-to-url";
|
||||
import { Home } from "@/sanity/sanity.types";
|
||||
|
||||
const HOME_QUERY = `*[_type == "home"][0]`;
|
||||
|
||||
export default async function IndexPage() {
|
||||
const { data: home }: { data: Home } = await sanityFetch({
|
||||
query: HOME_QUERY,
|
||||
});
|
||||
|
||||
const background = await getImage(
|
||||
home.headerSection?.backgroundImage?.asset?._ref
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<CTA
|
||||
cta={home.headerSection}
|
||||
background={background}
|
||||
textColor="text-white"
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user