feat: add faqs section

Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
Chloe
2024-06-14 16:50:46 +07:00
parent a27b02f953
commit c5af5b3069
8 changed files with 59 additions and 44 deletions

View File

@@ -1,16 +1,13 @@
import { PhoneIcon } from '@heroicons/react/24/outline';
import { getMetaobject } from 'lib/shopify';
import kebabCase from 'lodash.kebabcase';
import Image from 'next/image';
import { Suspense } from 'react';
import AccordionBlock from './page/accordion-block';
import Tag from './tag';
const { SITE_NAME } = process.env;
const FAQ = async () => {
const FAQ = async ({ handle }: { handle: string }) => {
const faqs = await getMetaobject({
handle: { handle: `${kebabCase(SITE_NAME)}-faqs`, type: 'accordion' }
handle: { handle, type: 'accordion' }
});
if (!faqs) return null;

View File

@@ -1,15 +1,13 @@
import DisplayTabs from 'components/display-tabs';
import RichTextDisplay from 'components/page/rich-text-display';
import { getMetaobject, getMetaobjectsByIds } from 'lib/shopify';
import kebabCase from 'lodash.kebabcase';
import Image from 'next/image';
import Tag from '../tag';
import ButtonLink from './button-link';
const { SITE_NAME } = process.env;
const About = async () => {
const aboutUs = await getMetaobject({
handle: { type: 'about_us', handle: `${kebabCase(SITE_NAME)}-about` }
handle: { type: 'about_us', handle: 'about-us' }
});
if (!aboutUs) return null;

View File

@@ -1,14 +1,13 @@
import ImageDisplay from 'components/page/image-display';
import RichTextDisplay from 'components/page/rich-text-display';
import { getMetaobject, getMetaobjectsByIds } from 'lib/shopify';
import kebabCase from 'lodash.kebabcase';
import { Suspense } from 'react';
import Tag from '../tag';
const { SITE_NAME } = process.env;
const WhyChoose = async () => {
const whyChooseContent = await getMetaobject({
handle: { type: 'why_choose', handle: `${kebabCase(SITE_NAME)}-why-choose` }
handle: { type: 'why_choose', handle: 'why-choose' }
});
if (!whyChooseContent || !whyChooseContent.items) return null;