diff --git a/next.config.ts b/next.config.ts index e9ffa30..cd4f6f0 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,7 +1,8 @@ +import { withPayload } from "@payloadcms/next/withPayload"; import type { NextConfig } from "next"; const nextConfig: NextConfig = { /* config options here */ }; -export default nextConfig; +export default withPayload(nextConfig); diff --git a/package.json b/package.json index d39522b..66b26e6 100644 --- a/package.json +++ b/package.json @@ -2,14 +2,26 @@ "name": "dynamic-realty-next", "version": "0.1.0", "private": true, + "type": "module", "scripts": { "dev": "next dev --turbopack", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "payload:generate:types": "payload generate:types", + "payload:generate:importMap": "payload generate:importMap" }, "dependencies": { + "@payloadcms/db-postgres": "^3.35.1", + "@payloadcms/next": "^3.35.1", + "@payloadcms/payload-cloud": "^3.35.1", + "@payloadcms/richtext-lexical": "^3.35.1", + "@payloadcms/storage-s3": "^3.35.1", + "dayjs": "^1.11.13", + "graphql": "^16.8.1", "next": "15.3.0", + "payload": "^3.35.1", + "qs-esm": "^7.0.2", "react": "^19.0.0", "react-dom": "^19.0.0", "swiper": "^11.2.6" diff --git a/public/css/style.css b/public/css/style.css index b5d9de5..9b91adc 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -3751,8 +3751,7 @@ html .page .divider-secondary::after { .button-primary:hover, .button-primary:active { color: #151515; - background-color: #fdde52; - border-color: #fdde52; + opacity: 0.8; } .button-primary.button-ujarak::before { @@ -3789,8 +3788,7 @@ html .page .divider-secondary::after { .button-primary:hover, .button-primary:active { color: #151515; - background-color: #fdde52; - border-color: #fdde52; + opacity: 0.8; } .button-primary.button-ujarak::before { @@ -4159,7 +4157,8 @@ input:-webkit-autofill ~ .form-validation { -webkit-appearance: none; transition: .3s ease-in-out; letter-spacing: 0; - /* border: 1px solid #f3f4f9; */ + border: 1px solid #f3f4f9; + border-color: #f3f4f9!; } .form-input:focus { diff --git a/public/images/blog-04-736x540.jpg b/public/images/blog-04-736x540.jpg index 62fd77c..5437676 100644 Binary files a/public/images/blog-04-736x540.jpg and b/public/images/blog-04-736x540.jpg differ diff --git a/public/images/breadcrumbs-bg-05-1922x441.jpg b/public/images/breadcrumbs-bg-05-1922x441.jpg index eae1c16..a13bc88 100644 Binary files a/public/images/breadcrumbs-bg-05-1922x441.jpg and b/public/images/breadcrumbs-bg-05-1922x441.jpg differ diff --git a/public/images/favicon.ico b/public/images/favicon.ico deleted file mode 100644 index 15808ab..0000000 Binary files a/public/images/favicon.ico and /dev/null differ diff --git a/public/js/script.js b/public/js/script.js index a24670f..54c4c26 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -1084,91 +1084,91 @@ $(function () { } // RD Search - if (plugins.search.length || plugins.searchResults) { - var handler = "bat/rd-search.php"; - var defaultTemplate = '
#{title}
' + - '

...#{token}...

' + - '

Terms matched: #{count} - URL: #{href}

'; - var defaultFilter = '*.html'; + // if (plugins.search.length || plugins.searchResults) { + // var handler = "bat/rd-search.php"; + // var defaultTemplate = '
#{title}
' + + // '

...#{token}...

' + + // '

Terms matched: #{count} - URL: #{href}

'; + // var defaultFilter = '*.html'; - if (plugins.search.length) { - for (var i = 0; i < plugins.search.length; i++) { - var searchItem = $(plugins.search[i]), - options = { - element: searchItem, - filter: (searchItem.attr('data-search-filter')) ? searchItem.attr('data-search-filter') : defaultFilter, - template: (searchItem.attr('data-search-template')) ? searchItem.attr('data-search-template') : defaultTemplate, - live: (searchItem.attr('data-search-live')) ? searchItem.attr('data-search-live') : false, - liveCount: (searchItem.attr('data-search-live-count')) ? parseInt(searchItem.attr('data-search-live'), 10) : 4, - current: 0, processed: 0, timer: {} - }; + // if (plugins.search.length) { + // for (var i = 0; i < plugins.search.length; i++) { + // var searchItem = $(plugins.search[i]), + // options = { + // element: searchItem, + // filter: (searchItem.attr('data-search-filter')) ? searchItem.attr('data-search-filter') : defaultFilter, + // template: (searchItem.attr('data-search-template')) ? searchItem.attr('data-search-template') : defaultTemplate, + // live: (searchItem.attr('data-search-live')) ? searchItem.attr('data-search-live') : false, + // liveCount: (searchItem.attr('data-search-live-count')) ? parseInt(searchItem.attr('data-search-live'), 10) : 4, + // current: 0, processed: 0, timer: {} + // }; - var $toggle = $('.rd-navbar-search-toggle'); - if ($toggle.length) { - $toggle.on('click', (function (searchItem) { - return function () { - if (!($(this).hasClass('active'))) { - searchItem.find('input').val('').trigger('propertychange'); - } - } - })(searchItem)); - } + // var $toggle = $('.rd-navbar-search-toggle'); + // if ($toggle.length) { + // $toggle.on('click', (function (searchItem) { + // return function () { + // if (!($(this).hasClass('active'))) { + // searchItem.find('input').val('').trigger('propertychange'); + // } + // } + // })(searchItem)); + // } - if (options.live) { - var clearHandler = false; + // if (options.live) { + // var clearHandler = false; - searchItem.find('input').on("input propertychange", $.proxy(function () { - this.term = this.element.find('input').val().trim(); - this.spin = this.element.find('.input-group-addon'); + // searchItem.find('input').on("input propertychange", $.proxy(function () { + // this.term = this.element.find('input').val().trim(); + // this.spin = this.element.find('.input-group-addon'); - clearTimeout(this.timer); + // clearTimeout(this.timer); - if (this.term.length > 2) { - this.timer = setTimeout(liveSearch(this), 200); + // if (this.term.length > 2) { + // this.timer = setTimeout(liveSearch(this), 200); - if (clearHandler === false) { - clearHandler = true; + // if (clearHandler === false) { + // clearHandler = true; - $body.on("click", function (e) { - if ($(e.toElement).parents('.rd-search').length === 0) { - $('#rd-search-results-live').addClass('cleared').html(''); - } - }) - } + // $body.on("click", function (e) { + // if ($(e.toElement).parents('.rd-search').length === 0) { + // $('#rd-search-results-live').addClass('cleared').html(''); + // } + // }) + // } - } else if (this.term.length === 0) { - $('#' + this.live).addClass('cleared').html(''); - } - }, options, this)); - } + // } else if (this.term.length === 0) { + // $('#' + this.live).addClass('cleared').html(''); + // } + // }, options, this)); + // } - searchItem.submit($.proxy(function () { - $('').attr('type', 'hidden') - .attr('name', "filter") - .attr('value', this.filter) - .appendTo(this.element); - return true; - }, options, this)) - } - } + // searchItem.submit($.proxy(function () { + // $('').attr('type', 'hidden') + // .attr('name', "filter") + // .attr('value', this.filter) + // .appendTo(this.element); + // return true; + // }, options, this)) + // } + // } - if (plugins.searchResults.length) { - var regExp = /\?.*s=([^&]+)\&filter=([^&]+)/g; - var match = regExp.exec(location.search); + // if (plugins.searchResults.length) { + // var regExp = /\?.*s=([^&]+)\&filter=([^&]+)/g; + // var match = regExp.exec(location.search); - if (match !== null) { - $.get(handler, { - s: decodeURI(match[1]), - dataType: "html", - filter: match[2], - template: defaultTemplate, - live: '' - }, function (data) { - plugins.searchResults.html(data); - }) - } - } - } + // if (match !== null) { + // $.get(handler, { + // s: decodeURI(match[1]), + // dataType: "html", + // filter: match[2], + // template: defaultTemplate, + // live: '' + // }, function (data) { + // plugins.searchResults.html(data); + // }) + // } + // } + // } // Swiper function makeInterLeaveEffectOptions(interleaveOffset) { diff --git a/src/app/(main)/blog/[slug]/page.tsx b/src/app/(main)/blog/[slug]/page.tsx new file mode 100644 index 0000000..81a72ae --- /dev/null +++ b/src/app/(main)/blog/[slug]/page.tsx @@ -0,0 +1,190 @@ +import HeroImage from "@/components/HeroImage"; +import { getDefaultMetadata } from "@/utils/metadata"; +import { Metadata } from "next"; + +const metaDesc = + "Explore the latest insights, news, and resources on the Dynamic Realty blog. Read our articles today."; + +export async function generateMetadata(): Promise { + const metadata = await getDefaultMetadata(); + metadata.title = `Blog - ${metadata.openGraph?.siteName}`; + metadata.description = metaDesc; + + return metadata; +} + +export default function BlogDetail() { + return ( + <> + + +
+
+
+
+
+
+

+ Showcasing a warm, traditional-style exterior and the highest caliber of contemporary European + finishes throughout, towering glass doors open to grand-scale living spaces. +

+
+ +
+
+ +
+
+
    +
  • + Share this post +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
+
+
+
+
+
Recent Posts
+
+
+ +
+
+
+ + {/* Sidebar */} + +
+
+
+ + ); +} diff --git a/src/app/(main)/blog/page.tsx b/src/app/(main)/blog/page.tsx new file mode 100644 index 0000000..f1d6f75 --- /dev/null +++ b/src/app/(main)/blog/page.tsx @@ -0,0 +1,47 @@ +import ListOfBlog from "@/components/blogs/ListOfBlog"; +import HeroImage from "@/components/HeroImage"; +import { getDefaultMetadata } from "@/utils/metadata"; +import { Metadata } from "next"; + +const metaDesc = + "Explore the latest insights, news, and resources on the Dynamic Realty blog. Read our articles today."; + +export async function generateMetadata(): Promise { + const metadata = await getDefaultMetadata(); + metadata.title = `Blog - ${metadata.openGraph?.siteName}`; + metadata.description = metaDesc; + + return metadata; +} + +export default async function Blog({ searchParams }: { searchParams?: Promise<{ s?: string }> }) { + const params = await searchParams; + + return ( + <> + +
+
+
+
+
+ +
+ +
+
+ + +
+
+ + ); +} diff --git a/src/app/globals.css b/src/app/(main)/globals.css similarity index 51% rename from src/app/globals.css rename to src/app/(main)/globals.css index 0fd081d..b45db09 100644 --- a/src/app/globals.css +++ b/src/app/(main)/globals.css @@ -12,22 +12,26 @@ --font-mono: var(--font-geist-mono); --font-montserrat: var(--font-montserrat); --font-playfairdisplay: var(--font-playfairdisplay); - --color-colorExt1: #0a0a0a; - --color-colorExt2: #ffffff; - --color-colorExt3: #967244; - --color-colorext4: #bc986b; - --color-colorExt5: #1d1d1d; - --color-colorHeader: var(--color-colorExt1); - --color-colorHeaderText: var(--color-colorExt2); - --color-colorHeaderTextHover: var(--color-colorext4); - --color-colorFooter: var(--color-colorExt1); - --color-colorFooter2: var(--color-colorExt5); - --color-colorFooterText: var(--color-colorExt2); - --color-colorFooterTextHover: var(--color-colorExt3); - --color-colorFormInput: var(--color-colorExt2); - --color-colorContactForm: var(--color-colorExt5); - --color-colorText1: var(--color-colorExt1); - --color-colorText2: var(--color-colorExt2); + --color-colorExt10: #0a0a0a; + --color-colorExt20: #ffffff; + --color-colorExt21: #f3f4f9; + --color-colorExt30: #967244; + --color-colorext40: #bc986b; + --color-colorExt50: #1d1d1d; + --color-colorSection1: var(--color-colorExt20); + --color-colorSection2: var(--color-colorExt21); + --color-colorHeader: var(--color-colorExt10); + --color-colorHeaderText: var(--color-colorExt20); + --color-colorHeaderTextHover: var(--color-colorext40); + --color-colorHeroOverlay: var(--color-colorExt50); + --color-colorFooter: var(--color-colorExt10); + --color-colorFooter2: var(--color-colorExt50); + --color-colorFooterText: var(--color-colorExt20); + --color-colorFooterTextHover: var(--color-colorExt30); + --color-colorFormInput: var(--color-colorExt20); + --color-colorContactForm: var(--color-colorExt50); + --color-colorText1: var(--color-colorExt10); + --color-colorText2: var(--color-colorExt20); } @layer components { diff --git a/src/app/layout.tsx b/src/app/(main)/layout.tsx similarity index 90% rename from src/app/layout.tsx rename to src/app/(main)/layout.tsx index 876ad84..5c816da 100644 --- a/src/app/layout.tsx +++ b/src/app/(main)/layout.tsx @@ -43,15 +43,14 @@ export default function RootLayout({ - - - - + + + You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today. -
+
@@ -122,7 +122,7 @@ export default function Home() { -
+

@@ -200,7 +200,7 @@ export default function Home() {

-
+

Find Us diff --git a/src/app/(payload)/admin/[[...segments]]/not-found.tsx b/src/app/(payload)/admin/[[...segments]]/not-found.tsx new file mode 100644 index 0000000..6410836 --- /dev/null +++ b/src/app/(payload)/admin/[[...segments]]/not-found.tsx @@ -0,0 +1,24 @@ +/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ +/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ +import type { Metadata } from 'next' + +import config from '@payload-config' +import { NotFoundPage, generatePageMetadata } from '@payloadcms/next/views' +import { importMap } from '../importMap' + +type Args = { + params: Promise<{ + segments: string[] + }> + searchParams: Promise<{ + [key: string]: string | string[] + }> +} + +export const generateMetadata = ({ params, searchParams }: Args): Promise => + generatePageMetadata({ config, params, searchParams }) + +const NotFound = ({ params, searchParams }: Args) => + NotFoundPage({ config, params, searchParams, importMap }) + +export default NotFound diff --git a/src/app/(payload)/admin/[[...segments]]/page.tsx b/src/app/(payload)/admin/[[...segments]]/page.tsx new file mode 100644 index 0000000..0de685c --- /dev/null +++ b/src/app/(payload)/admin/[[...segments]]/page.tsx @@ -0,0 +1,24 @@ +/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ +/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ +import type { Metadata } from 'next' + +import config from '@payload-config' +import { RootPage, generatePageMetadata } from '@payloadcms/next/views' +import { importMap } from '../importMap' + +type Args = { + params: Promise<{ + segments: string[] + }> + searchParams: Promise<{ + [key: string]: string | string[] + }> +} + +export const generateMetadata = ({ params, searchParams }: Args): Promise => + generatePageMetadata({ config, params, searchParams }) + +const Page = ({ params, searchParams }: Args) => + RootPage({ config, params, searchParams, importMap }) + +export default Page diff --git a/src/app/(payload)/admin/importMap.js b/src/app/(payload)/admin/importMap.js new file mode 100644 index 0000000..bbadadb --- /dev/null +++ b/src/app/(payload)/admin/importMap.js @@ -0,0 +1,53 @@ +import { RscEntryLexicalCell as RscEntryLexicalCell_44fe37237e0ebf4470c9990d8cb7b07e } from '@payloadcms/richtext-lexical/rsc' +import { RscEntryLexicalField as RscEntryLexicalField_44fe37237e0ebf4470c9990d8cb7b07e } from '@payloadcms/richtext-lexical/rsc' +import { LexicalDiffComponent as LexicalDiffComponent_44fe37237e0ebf4470c9990d8cb7b07e } from '@payloadcms/richtext-lexical/rsc' +import { InlineToolbarFeatureClient as InlineToolbarFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { HorizontalRuleFeatureClient as HorizontalRuleFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { UploadFeatureClient as UploadFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { BlockquoteFeatureClient as BlockquoteFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { RelationshipFeatureClient as RelationshipFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { LinkFeatureClient as LinkFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { ChecklistFeatureClient as ChecklistFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { OrderedListFeatureClient as OrderedListFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { UnorderedListFeatureClient as UnorderedListFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { IndentFeatureClient as IndentFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { AlignFeatureClient as AlignFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { HeadingFeatureClient as HeadingFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { ParagraphFeatureClient as ParagraphFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { InlineCodeFeatureClient as InlineCodeFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { SuperscriptFeatureClient as SuperscriptFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { SubscriptFeatureClient as SubscriptFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { StrikethroughFeatureClient as StrikethroughFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { UnderlineFeatureClient as UnderlineFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { BoldFeatureClient as BoldFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { ItalicFeatureClient as ItalicFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { default as default_aa89fa9464216e16b81a3e716c94a23a } from '../../../components/LogoAdmin' +import { S3ClientUploadHandler as S3ClientUploadHandler_f97aa6c64367fa259c5bc0567239ef24 } from '@payloadcms/storage-s3/client' + +export const importMap = { + "@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell": RscEntryLexicalCell_44fe37237e0ebf4470c9990d8cb7b07e, + "@payloadcms/richtext-lexical/rsc#RscEntryLexicalField": RscEntryLexicalField_44fe37237e0ebf4470c9990d8cb7b07e, + "@payloadcms/richtext-lexical/rsc#LexicalDiffComponent": LexicalDiffComponent_44fe37237e0ebf4470c9990d8cb7b07e, + "@payloadcms/richtext-lexical/client#InlineToolbarFeatureClient": InlineToolbarFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#HorizontalRuleFeatureClient": HorizontalRuleFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#UploadFeatureClient": UploadFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#BlockquoteFeatureClient": BlockquoteFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#RelationshipFeatureClient": RelationshipFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#LinkFeatureClient": LinkFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#ChecklistFeatureClient": ChecklistFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#OrderedListFeatureClient": OrderedListFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#UnorderedListFeatureClient": UnorderedListFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#IndentFeatureClient": IndentFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#AlignFeatureClient": AlignFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#HeadingFeatureClient": HeadingFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#ParagraphFeatureClient": ParagraphFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#InlineCodeFeatureClient": InlineCodeFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#SuperscriptFeatureClient": SuperscriptFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#SubscriptFeatureClient": SubscriptFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#StrikethroughFeatureClient": StrikethroughFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#UnderlineFeatureClient": UnderlineFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#BoldFeatureClient": BoldFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#ItalicFeatureClient": ItalicFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "/components/LogoAdmin#default": default_aa89fa9464216e16b81a3e716c94a23a, + "@payloadcms/storage-s3/client#S3ClientUploadHandler": S3ClientUploadHandler_f97aa6c64367fa259c5bc0567239ef24 +} diff --git a/src/app/(payload)/api/[...slug]/route.ts b/src/app/(payload)/api/[...slug]/route.ts new file mode 100644 index 0000000..e58c50f --- /dev/null +++ b/src/app/(payload)/api/[...slug]/route.ts @@ -0,0 +1,19 @@ +/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ +/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ +import config from '@payload-config' +import '@payloadcms/next/css' +import { + REST_DELETE, + REST_GET, + REST_OPTIONS, + REST_PATCH, + REST_POST, + REST_PUT, +} from '@payloadcms/next/routes' + +export const GET = REST_GET(config) +export const POST = REST_POST(config) +export const DELETE = REST_DELETE(config) +export const PATCH = REST_PATCH(config) +export const PUT = REST_PUT(config) +export const OPTIONS = REST_OPTIONS(config) diff --git a/src/app/(payload)/api/graphql-playground/route.ts b/src/app/(payload)/api/graphql-playground/route.ts new file mode 100644 index 0000000..17d2954 --- /dev/null +++ b/src/app/(payload)/api/graphql-playground/route.ts @@ -0,0 +1,7 @@ +/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ +/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ +import config from '@payload-config' +import '@payloadcms/next/css' +import { GRAPHQL_PLAYGROUND_GET } from '@payloadcms/next/routes' + +export const GET = GRAPHQL_PLAYGROUND_GET(config) diff --git a/src/app/(payload)/api/graphql/route.ts b/src/app/(payload)/api/graphql/route.ts new file mode 100644 index 0000000..2069ff8 --- /dev/null +++ b/src/app/(payload)/api/graphql/route.ts @@ -0,0 +1,8 @@ +/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ +/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ +import config from '@payload-config' +import { GRAPHQL_POST, REST_OPTIONS } from '@payloadcms/next/routes' + +export const POST = GRAPHQL_POST(config) + +export const OPTIONS = REST_OPTIONS(config) diff --git a/src/app/(payload)/custom.scss b/src/app/(payload)/custom.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/(payload)/layout.tsx b/src/app/(payload)/layout.tsx new file mode 100644 index 0000000..8df141a --- /dev/null +++ b/src/app/(payload)/layout.tsx @@ -0,0 +1,31 @@ +/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ +/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ +import config from '@payload-config' +import '@payloadcms/next/css' +import type { ServerFunctionClient } from 'payload' +import { handleServerFunctions, RootLayout } from '@payloadcms/next/layouts' +import React from 'react' + +import { importMap } from './admin/importMap.js' +import './custom.scss' + +type Args = { + children: React.ReactNode +} + +const serverFunction: ServerFunctionClient = async function (args) { + 'use server' + return handleServerFunctions({ + ...args, + config, + importMap, + }) +} + +const Layout = ({ children }: Args) => ( + + {children} + +) + +export default Layout diff --git a/src/app/blog/page.tsx b/src/app/blog/page.tsx deleted file mode 100644 index 752cb7f..0000000 --- a/src/app/blog/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function Blog() { - return <>; -} diff --git a/src/app/page.backup.tsx b/src/app/page.backup.tsx deleted file mode 100644 index e68abe6..0000000 --- a/src/app/page.backup.tsx +++ /dev/null @@ -1,103 +0,0 @@ -import Image from "next/image"; - -export default function Home() { - return ( - - ); -} diff --git a/src/collections/BlogCategories.ts b/src/collections/BlogCategories.ts new file mode 100644 index 0000000..1f31904 --- /dev/null +++ b/src/collections/BlogCategories.ts @@ -0,0 +1,39 @@ +import formatSlug from "@/utils/payload/formatSlug"; +import type { CollectionConfig } from "payload"; + +export const BlogCategories: CollectionConfig = { + slug: "blogCategories", + labels: { plural: "Categories", singular: "Category" }, + fields: [ + { + name: "name", + type: "text", + required: true, + }, + { + name: "slug", + type: "text", + admin: { + position: "sidebar", + }, + hooks: { + beforeValidate: [formatSlug("name")], + }, + }, + { + name: "parent_category", + label: "Parent Category", + type: "relationship", + relationTo: "blogCategories", + }, + { + name: "description", + type: "textarea", + }, + ], + admin: { + hideAPIURL: true, + group: "Blogs", + useAsTitle: "name", + }, +}; diff --git a/src/collections/BlogTags.ts b/src/collections/BlogTags.ts new file mode 100644 index 0000000..a7d623b --- /dev/null +++ b/src/collections/BlogTags.ts @@ -0,0 +1,32 @@ +import formatSlug from "@/utils/payload/formatSlug"; +import type { CollectionConfig } from "payload"; + +export const BlogTags: CollectionConfig = { + slug: "blogTags", + labels: { plural: "Tags", singular: "Tag" }, + fields: [ + { + name: "name", + type: "text", + required: true, + }, + { + name: "slug", + type: "text", + admin: { + position: "sidebar", + }, + hooks: { + beforeValidate: [formatSlug("name")], + }, + }, + { + name: "description", + type: "textarea", + }, + ], + admin: { + hideAPIURL: true, + group: "Blogs", + }, +}; diff --git a/src/collections/Blogs.ts b/src/collections/Blogs.ts new file mode 100644 index 0000000..6a7eea8 --- /dev/null +++ b/src/collections/Blogs.ts @@ -0,0 +1,107 @@ +import formatSlug from "@/utils/payload/formatSlug"; +import setAuthor from "@/utils/payload/setAuthor"; +import { lexicalEditor } from "@payloadcms/richtext-lexical"; +import type { CollectionConfig } from "payload"; + +export const Blogs: CollectionConfig = { + slug: "blogs", + labels: { plural: "Posts", singular: "Post" }, + versions: { + drafts: { + validate: true, + }, + }, + fields: [ + { + name: "title", + type: "text", + required: true, + }, + { + name: "slug", + type: "text", + hooks: { + beforeValidate: [formatSlug("title")], + }, + }, + { + name: "img", + label: "Image", + type: "upload", + relationTo: "media", + required: true, + }, + { + name: "content", + type: "richText", + required: true, + editor: lexicalEditor({}), + }, + { + name: "categories", + type: "relationship", + relationTo: "blogCategories", + hasMany: true, + }, + { + name: "tags", + type: "relationship", + relationTo: "blogTags", + hasMany: true, + }, + { + name: "meta", + label: "Page Meta", + type: "group", + fields: [ + { + name: "title", + label: "Title", + type: "text", + }, + { + name: "description", + label: "Description", + type: "textarea", + }, + { + name: "canonical_url", + label: "Canonical Url", + type: "text", + }, + ], + }, + { + name: "createdBy", + type: "relationship", + relationTo: "users", + hooks: { + beforeChange: [setAuthor], + }, + admin: { + hidden: true, + }, + }, + { + name: "updatedBy", + type: "relationship", + relationTo: "users", + hooks: { + beforeChange: [setAuthor], + }, + admin: { + hidden: true, + }, + }, + ], + admin: { + hideAPIURL: true, + group: "Blogs", + useAsTitle: "title", + }, + access: { + read: ({ req: { user } }) => { + return true; + }, + }, +}; diff --git a/src/collections/Media.ts b/src/collections/Media.ts new file mode 100644 index 0000000..2a5a07f --- /dev/null +++ b/src/collections/Media.ts @@ -0,0 +1,20 @@ +import type { CollectionConfig } from "payload"; + +export const Media: CollectionConfig = { + slug: "media", + access: { + read: () => true, + }, + fields: [ + { + name: "alt", + type: "text", + required: true, + }, + ], + upload: true, + admin: { + hideAPIURL: true, + group: "General", + }, +}; diff --git a/src/collections/Users.ts b/src/collections/Users.ts new file mode 100644 index 0000000..bcd1a61 --- /dev/null +++ b/src/collections/Users.ts @@ -0,0 +1,20 @@ +import type { CollectionConfig } from "payload"; + +export const Users: CollectionConfig = { + slug: "users", + admin: { + useAsTitle: "email", + hideAPIURL: true, + group: "Users", + }, + auth: true, + fields: [ + // Email added by default + // Add more fields as needed + { + name: "name", + label: "Name", + type: "text", + }, + ], +}; diff --git a/src/components/GoogleReviewBox.tsx b/src/components/GoogleReviewBox.tsx index 75fff99..dd5bcf3 100644 --- a/src/components/GoogleReviewBox.tsx +++ b/src/components/GoogleReviewBox.tsx @@ -1,6 +1,6 @@ export default function GoogleReviewBox() { return ( -
+

Making Moves, Building Trust diff --git a/src/components/HeroImage.tsx b/src/components/HeroImage.tsx new file mode 100644 index 0000000..c0627e8 --- /dev/null +++ b/src/components/HeroImage.tsx @@ -0,0 +1,26 @@ +import Image from "next/image"; + +type HeroImageProps = { + imgSrc?: string; +}; + +export default function HeroImage({ imgSrc = "/images/breadcrumbs-bg-05-1922x441.jpg" }: HeroImageProps) { + return ( +
+ Blog +
+
+

Blog

+
+
+ ); +} diff --git a/src/components/HeroSlider.tsx b/src/components/HeroSlider.tsx index a87b369..50575e2 100644 --- a/src/components/HeroSlider.tsx +++ b/src/components/HeroSlider.tsx @@ -52,7 +52,7 @@ export default function HeroSlider({ onClickBook }: HeroSliderProps) { objectFit: "cover", }} /> -
+
diff --git a/src/components/Loader.tsx b/src/components/Loader.tsx new file mode 100644 index 0000000..0807c0b --- /dev/null +++ b/src/components/Loader.tsx @@ -0,0 +1,17 @@ +export default function Loader() { + return ( +
+
+
+
+
+
+
+
+
+
+
+
+
+ ); +} diff --git a/src/components/LogoAdmin.tsx b/src/components/LogoAdmin.tsx new file mode 100644 index 0000000..dad523a --- /dev/null +++ b/src/components/LogoAdmin.tsx @@ -0,0 +1,5 @@ +import Image from "next/image"; + +export default function LogoAdmin() { + return Logo; +} diff --git a/src/components/blogs/CardBlog.tsx b/src/components/blogs/CardBlog.tsx new file mode 100644 index 0000000..6d8e299 --- /dev/null +++ b/src/components/blogs/CardBlog.tsx @@ -0,0 +1,36 @@ +import { BlogData } from "@/schema/blog"; +import Image from "next/image"; +import Link from "next/link"; + +type CardBlogProps = { + data: BlogData; +}; + +export default function CardBlog({ data }: CardBlogProps) { + return ( +
+ +
+ ); +} diff --git a/src/components/blogs/ListOfBlog.tsx b/src/components/blogs/ListOfBlog.tsx new file mode 100644 index 0000000..f979e1d --- /dev/null +++ b/src/components/blogs/ListOfBlog.tsx @@ -0,0 +1,47 @@ +"use client"; + +import Loader from "@/components/Loader"; +import { useBlogQuery } from "@/services/hooks/blog"; +import { useEffect, useRef } from "react"; +import CardBlog from "./CardBlog"; + +type ListOfBlogProps = { + searchKeyword?: string; +}; + +export default function ListOfBlog({ searchKeyword }: ListOfBlogProps) { + const pageRef = useRef(1); + const blogQuery = useBlogQuery(); + + useEffect(() => { + blogQuery._fetch({ + search: searchKeyword, + page: pageRef.current, + }); + }, []); + + function fetchMore() { + blogQuery._fetch({ + search: searchKeyword, + page: ++pageRef.current, + }); + } + + return ( + <> +
+ {blogQuery.data.map((blog) => ( + + ))} +
+
+ {blogQuery.isFetching && } + {blogQuery.hasNext && ( + + )} +
+ + ); +} diff --git a/src/components/layouts/Footer.tsx b/src/components/layouts/Footer.tsx index 6a8250c..a759460 100644 --- a/src/components/layouts/Footer.tsx +++ b/src/components/layouts/Footer.tsx @@ -10,7 +10,7 @@ export default function Footer() {

- +
@@ -25,7 +25,7 @@ export default function Footer() {
- +
diff --git a/src/components/layouts/Header.tsx b/src/components/layouts/Header.tsx index 7c2314f..98e75e4 100644 --- a/src/components/layouts/Header.tsx +++ b/src/components/layouts/Header.tsx @@ -75,20 +75,20 @@ export default function Header() { {/*

@@ -123,7 +123,7 @@ export default function Header() {
  • - + BLOGS
  • diff --git a/src/components/layouts/InitialScript.tsx b/src/components/layouts/InitialScript.tsx index 06dbc23..24dc411 100644 --- a/src/components/layouts/InitialScript.tsx +++ b/src/components/layouts/InitialScript.tsx @@ -5,8 +5,8 @@ import Script from "next/script"; export default function InitialScript() { return ( <> -