diff --git a/src/app/(main)/coba/page.tsx b/src/app/(main)/coba/page.tsx index 0eab375..bd501c7 100644 --- a/src/app/(main)/coba/page.tsx +++ b/src/app/(main)/coba/page.tsx @@ -1,3 +1,3 @@ export default function CobaPage() { - return <>{/* */}; + return <>; } diff --git a/src/app/globals.css b/src/app/globals.css index d335ed0..b5e4dbf 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -3,12 +3,22 @@ @tailwind utilities; :root { + --ext-color-primary-1: #6ec2b6; + --ext-color-primary-2: #90d4c9; + --ext-color-primary-3: #2e2d51; + --ext-color-primary-4: #d4a187; + --ext-color-primary-5: #e7ccc0; --background: #ffffff; --foreground: #171717; } @media (prefers-color-scheme: dark) { :root { + --ext-color-primary-1: #6ec2b6; + --ext-color-primary-2: #90d4c9; + --ext-color-primary-3: #2e2d51; + --ext-color-primary-4: #d4a187; + --ext-color-primary-5: #e7ccc0; --background: #0a0a0a; --foreground: #ededed; } @@ -20,6 +30,24 @@ body { font-family: Arial, Helvetica, sans-serif; } +@layer components { + .ext-btn { + @apply py-2 px-4 rounded-full hover:opacity-95 hover:scale-95 transition-transform font-semibold no-underline; + } + + .ext-btn-primary { + @apply bg-extColorPrimary text-white; + } + + .ext-btn-primary2 { + @apply bg-extColorPrimary2 text-white; + } + + .ext-btn-primary3 { + @apply bg-extColorPrimary3 text-white; + } +} + .bg-gradient { background: linear-gradient(135deg, #6ec2b6, #90d4c9); position: relative; diff --git a/src/blocks/BoxMenuGrid.ts b/src/blocks/BoxMenuGrid.ts new file mode 100644 index 0000000..bd9700e --- /dev/null +++ b/src/blocks/BoxMenuGrid.ts @@ -0,0 +1,27 @@ +import { Block } from "payload"; + +export const BoxMenuGridBlock: Block = { + slug: "boxMenuGridBlock", + fields: [ + { + name: "boxMenuGridItem", + type: "array", + fields: [ + { + name: "title", + type: "text", + required: true, + }, + { + name: "description", + type: "text", + }, + { + name: "href", + type: "text", + required: true, + }, + ], + }, + ], +}; diff --git a/src/collections/Pages.ts b/src/collections/Pages.ts index 80ce9bb..a47de6d 100644 --- a/src/collections/Pages.ts +++ b/src/collections/Pages.ts @@ -1,4 +1,5 @@ import { BeforeFooterBlock } from "@/blocks/BeforeFooter"; +import { BoxMenuGridBlock } from "@/blocks/BoxMenuGrid"; import { ContentBlock } from "@/blocks/Content"; import { HorizontalImageContentBlock } from "@/blocks/HorizontalImageContent"; import { ImageSliderBlock } from "@/blocks/ImageSlider"; @@ -37,7 +38,14 @@ export const Pages: CollectionConfig = { label: "Page Layout", type: "blocks", minRows: 1, - blocks: [ContentBlock, BeforeFooterBlock, OurTeamBlock, HorizontalImageContentBlock, ImageSliderBlock], + blocks: [ + ContentBlock, + BeforeFooterBlock, + OurTeamBlock, + HorizontalImageContentBlock, + ImageSliderBlock, + BoxMenuGridBlock, + ], }, { name: "meta", diff --git a/src/components/Blocks/BoxMenuGrid/BoxMenu.tsx b/src/components/Blocks/BoxMenuGrid/BoxMenu.tsx new file mode 100644 index 0000000..d5117cc --- /dev/null +++ b/src/components/Blocks/BoxMenuGrid/BoxMenu.tsx @@ -0,0 +1,25 @@ +import Link from "next/link"; + +export interface BoxMenuProps { + title: string; + description?: string; + href: string; +} + +export default function BoxMenu({ title, description, href }: BoxMenuProps) { + return ( +
+ {title ?? ""} +
{description ?? ""}
+ + Learn More + +
+ ); +} + +function fixedHref(href: string) { + if (href.charAt(0) === "/") return href; + + return `/${href}`; +} diff --git a/src/components/Blocks/BoxMenuGrid/index.tsx b/src/components/Blocks/BoxMenuGrid/index.tsx new file mode 100644 index 0000000..1f4eb20 --- /dev/null +++ b/src/components/Blocks/BoxMenuGrid/index.tsx @@ -0,0 +1,40 @@ +import BoxMenu from "./BoxMenu"; + +type BoxMenuGridItem = { + id: string; + title: string; + description: string; + href: string; +}; + +export interface BoxMenuGridBlockProps { + boxMenuGridItem: BoxMenuGridItem[]; +} + +export function BoxMenuGridBlock({ boxMenuGridItem }: BoxMenuGridBlockProps) { + const dataLength = boxMenuGridItem.length ?? 0; + + return ( +
+ {dataLength === 1 && ( +
+
+ +
+
+ )} + {dataLength > 1 && ( +
+ {boxMenuGridItem.map((b, idx) => ( + + ))} +
+ )} +
+ ); +} diff --git a/src/components/Blocks/RenderBlocks.tsx b/src/components/Blocks/RenderBlocks.tsx index 646d7d1..99bcaf1 100644 --- a/src/components/Blocks/RenderBlocks.tsx +++ b/src/components/Blocks/RenderBlocks.tsx @@ -6,6 +6,7 @@ import { BeforeFooterBlock } from "./BeforeFooter"; import { OurTeamBlock } from "./OurTeam"; import { HorizontalImageContentBlock } from "./HorizontalImageContent"; import { ImageSliderBlock } from "./ImageSlider"; +import { BoxMenuGridBlock } from "./BoxMenuGrid"; const blockComponents = { contentBlock: ContentBlock, @@ -13,6 +14,7 @@ const blockComponents = { ourTeamBlock: OurTeamBlock, horizontalImageContentBlock: HorizontalImageContentBlock, imageSliderBlock: ImageSliderBlock, + boxMenuGridBlock: BoxMenuGridBlock, }; export const RenderBlocks: React.FC<{ diff --git a/src/components/Blogs/BlogCardItem.tsx b/src/components/Blogs/BlogCardItem.tsx index 46b4da6..3f3101f 100644 --- a/src/components/Blogs/BlogCardItem.tsx +++ b/src/components/Blogs/BlogCardItem.tsx @@ -1,4 +1,5 @@ import Image from "next/image"; +import Link from "next/link"; export interface BlogCardItemProps { data: { @@ -22,13 +23,13 @@ export function BlogCardItem({ data }: BlogCardItemProps) {
- + {data?.img?.alt

- {data.title} + {data.title}

{data.contentPreview}
diff --git a/src/components/HeaderNav.tsx b/src/components/HeaderNav.tsx index d19931f..4b70e22 100644 --- a/src/components/HeaderNav.tsx +++ b/src/components/HeaderNav.tsx @@ -57,16 +57,16 @@ export default function HeaderNav({ links, animateY = false }: any) { {Array.isArray(link?.child) && ( <> - { - e.preventDefault(); - toggleDropdown([link.text]); - }} + // onClick={(e) => { + // e.preventDefault(); + // toggleDropdown([link.text]); + // }} > {link.text} - +
    {link.child.map((subLink: any, subLinkIdx: number) => ( @@ -78,16 +78,16 @@ export default function HeaderNav({ links, animateY = false }: any) { )} {Array.isArray(subLink?.child) && ( <> - { - e.preventDefault(); - toggleDropdown([link.text, subLink.text]); - }} + // onClick={(e) => { + // e.preventDefault(); + // toggleDropdown([link.text, subLink.text]); + // }} > {subLink.text} - +
      {subLink.child.map((subLink2: any, subLinkIdx2: number) => ( diff --git a/src/payload-types.ts b/src/payload-types.ts index 450b276..96a0214 100644 --- a/src/payload-types.ts +++ b/src/payload-types.ts @@ -6,6 +6,60 @@ * and re-run `payload generate:types` to regenerate this file. */ +/** + * Supported timezones in IANA format. + * + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "supportedTimezones". + */ +export type SupportedTimezones = + | 'Pacific/Midway' + | 'Pacific/Niue' + | 'Pacific/Honolulu' + | 'Pacific/Rarotonga' + | 'America/Anchorage' + | 'Pacific/Gambier' + | 'America/Los_Angeles' + | 'America/Tijuana' + | 'America/Denver' + | 'America/Phoenix' + | 'America/Chicago' + | 'America/Guatemala' + | 'America/New_York' + | 'America/Bogota' + | 'America/Caracas' + | 'America/Santiago' + | 'America/Buenos_Aires' + | 'America/Sao_Paulo' + | 'Atlantic/South_Georgia' + | 'Atlantic/Azores' + | 'Atlantic/Cape_Verde' + | 'Europe/London' + | 'Europe/Berlin' + | 'Africa/Lagos' + | 'Europe/Athens' + | 'Africa/Cairo' + | 'Europe/Moscow' + | 'Asia/Riyadh' + | 'Asia/Dubai' + | 'Asia/Baku' + | 'Asia/Karachi' + | 'Asia/Tashkent' + | 'Asia/Calcutta' + | 'Asia/Dhaka' + | 'Asia/Almaty' + | 'Asia/Jakarta' + | 'Asia/Bangkok' + | 'Asia/Shanghai' + | 'Asia/Singapore' + | 'Asia/Tokyo' + | 'Asia/Seoul' + | 'Australia/Sydney' + | 'Pacific/Guam' + | 'Pacific/Noumea' + | 'Pacific/Auckland' + | 'Pacific/Fiji'; + export interface Config { auth: { users: UserAuthOperations; @@ -245,6 +299,19 @@ export interface Page { blockName?: string | null; blockType: 'imageSliderBlock'; } + | { + boxMenuGridItem?: + | { + title: string; + description?: string | null; + href: string; + id?: string | null; + }[] + | null; + id?: string | null; + blockName?: string | null; + blockType: 'boxMenuGridBlock'; + } )[] | null; meta?: { @@ -647,6 +714,20 @@ export interface PagesSelect { id?: T; blockName?: T; }; + boxMenuGridBlock?: + | T + | { + boxMenuGridItem?: + | T + | { + title?: T; + description?: T; + href?: T; + id?: T; + }; + id?: T; + blockName?: T; + }; }; meta?: | T diff --git a/tailwind.config.ts b/tailwind.config.ts index 109807b..ecba4b4 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -11,6 +11,10 @@ export default { colors: { background: "var(--background)", foreground: "var(--foreground)", + extColorPrimary: "var(--ext-color-primary-1)", + extColorPrimary2: "var(--ext-color-primary-2)", + extColorPrimary3: "var(--ext-color-primary-3)", + extColorPrimary4: "var(--ext-color-primary-4)", }, }, },