Skip to content

Commit

Permalink
remove sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
DakotahGodfrey committed Sep 17, 2024
1 parent f0fc371 commit 1883d93
Show file tree
Hide file tree
Showing 6 changed files with 195 additions and 188 deletions.
4 changes: 0 additions & 4 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { draftMode } from "next/headers"
import LoadingWidget from "components/common/LoadingWidget"
import PreviewBar from "components/common/PreviewBar"
import SiteFooter from "components/common/SiteFooter"
import SiteHeader from "components/common/SiteHeader"
Expand All @@ -12,8 +11,6 @@ import "/styles/globals.css"

import { getHeaderContent } from "lib/cms-content/getHeaderContent"
import { redirect } from "next/navigation"
import { NextRequest } from "next/server"
import Script from "next/script"

const inter = Inter({
subsets: ["latin"],
Expand Down Expand Up @@ -63,7 +60,6 @@ export default async function RootLayout({
</div>
</div>
</body>
<Script src="https://unpkg.com/@agility/web-studio-sdk@latest/dist/index.js" />
</html>
)
}
7 changes: 2 additions & 5 deletions components/agility-components/Heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@ const Heading = async ({ module, languageCode }: UnloadedModuleProps) => {
})

return (
<div className="relative px-8" data-agility-component={contentID}>
<div className="relative px-8">
<div className="max-w-screen-xl mx-auto my-12 md:mt-18 lg:mt-20">
<h1
data-agility-field={"title"}
className="font-display text-secondary-500 text-4xl font-black tracking-wide"
>
<h1 className="font-display text-secondary-500 text-4xl font-black tracking-wide">
{fields.title}
</h1>
</div>
Expand Down
20 changes: 4 additions & 16 deletions components/agility-components/PostDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ const PostDetails = async ({ dynamicPageItem }: UnloadedModuleProps) => {

return (
<>
<div className="relative px-8" data-agility-component={contentID}>
<div className="relative px-8">
<div className="max-w-screen-xl mx-auto">
<div className="h-64 md:h-96 lg:h-[480px] relative overflow-hidden rounded-lg">
<AgilityPic
data-agility-field="image"
image={post.image}
alt={post.image.label}
className="w-full"
Expand All @@ -41,28 +40,17 @@ const PostDetails = async ({ dynamicPageItem }: UnloadedModuleProps) => {
/>
</div>
<div className="max-w-2xl mx-auto mt-4">
<div
data-agility-field="category"
className="uppercase text-primary-500 text-xs font-bold tracking-widest leading-loose"
>
<div className="uppercase text-primary-500 text-xs font-bold tracking-widest leading-loose">
{category}
</div>
<div className="border-b-2 border-primary-500 w-8"></div>
<div
data-agility-field="date"
className="mt-4 uppercase text-gray-600 italic font-semibold text-xs"
>
<div className="mt-4 uppercase text-gray-600 italic font-semibold text-xs">
{dateStr}
</div>
<h1
data-agility-field="title"
className="font-display text-4xl font-bold my-6 text-secondary-500"
>
<h1 className="font-display text-4xl font-bold my-6 text-secondary-500">
{post.title}
</h1>
<div
data-agility-field="content"
data-agility-html="true"
className="prose max-w-full mb-20"
dangerouslySetInnerHTML={renderHTML(post.content)}
/>
Expand Down
44 changes: 21 additions & 23 deletions components/agility-components/RichTextArea.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
import {renderHTML, Module, UnloadedModuleProps} from "@agility/nextjs"
import {getContentItem} from "lib/cms/getContentItem"
import { renderHTML, Module, UnloadedModuleProps } from "@agility/nextjs"
import { getContentItem } from "lib/cms/getContentItem"

interface RichText {
textblob: string
textblob: string
}

const RichTextArea = async ({module, languageCode}: UnloadedModuleProps) => {
const {
fields: {textblob},
contentID,
} = await getContentItem<RichText>({
contentID: module.contentid,
languageCode,
})
const RichTextArea = async ({ module, languageCode }: UnloadedModuleProps) => {
const {
fields: { textblob },
contentID,
} = await getContentItem<RichText>({
contentID: module.contentid,
languageCode,
})

return (
<section id={`${contentID}`} className="relative px-8" data-agility-component={contentID}>
<div className="max-w-2xl mx-auto my-12 md:mt-18 lg:mt-20">
<div
data-agility-field="textblob"
data-agility-html
className="my-6 prose prose-sm sm:prose lg:prose-lg xl:prose-xl max-w-full"
dangerouslySetInnerHTML={renderHTML(textblob)}
></div>
</div>
</section>
)
return (
<section id={`${contentID}`} className="relative px-8">
<div className="max-w-2xl mx-auto my-12 md:mt-18 lg:mt-20">
<div
className="my-6 prose prose-sm sm:prose lg:prose-lg xl:prose-xl max-w-full"
dangerouslySetInnerHTML={renderHTML(textblob)}
></div>
</div>
</section>
)
}

export default RichTextArea
24 changes: 5 additions & 19 deletions components/agility-components/TextBlockWithImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const TextBlockWithImage = async ({
if (isUrlAbsolute(url) === false) {
return (
<Link
data-agility-field="primaryButton"
href={url}
title={text}
target={target}
Expand All @@ -59,7 +58,6 @@ const TextBlockWithImage = async ({
// else use anchor tag
return (
<a
data-agility-field="primaryButton"
href={url}
title={text}
target={target}
Expand All @@ -75,12 +73,9 @@ const TextBlockWithImage = async ({
const priority = fields.highPriority === "true"

return (
<div className="relative px-8" data-agility-component={contentID}>
<div className="relative px-8">
<div className="flex flex-col md:flex-row justify-between max-w-screen-xl mx-auto py-20 md:py-24 items-center">
<div
className="md:w-6/12 flex-shrink-0 relative "
data-agility-field="image"
>
<div className="md:w-6/12 flex-shrink-0 relative ">
{fields.primaryButton ? (
<Link href={fields.primaryButton.href} className="relative">
<AgilityPic
Expand Down Expand Up @@ -122,23 +117,14 @@ const TextBlockWithImage = async ({
>
<div className="g:py-8 text-center md:text-left">
{fields.tagline && (
<div
data-agility-field="tagline"
className="font-bold text-primary-500 text-sm text-center md:text-left uppercase py-1"
>
<div className="font-bold text-primary-500 text-sm text-center md:text-left uppercase py-1">
{fields.tagline}
</div>
)}
<h2
data-agility-field="title"
className="font-display text-4xl font-black text-secondary-500 md:text-3xl lg:text-5xl tracking-wide text-center mt-4 lg:leading-tight md:text-left"
>
<h2 className="font-display text-4xl font-black text-secondary-500 md:text-3xl lg:text-5xl tracking-wide text-center mt-4 lg:leading-tight md:text-left">
{fields.title}
</h2>
<p
data-agility-field="content"
className="mt-4 text-center md:text-left text-sm md:text-base lg:text-lg font-medium leading-relaxed text-secondary-200"
>
<p className="mt-4 text-center md:text-left text-sm md:text-base lg:text-lg font-medium leading-relaxed text-secondary-200">
{fields.content}
</p>
{fields.primaryButton &&
Expand Down
Loading

0 comments on commit 1883d93

Please sign in to comment.