mirror of
https://github.com/vercel/commerce.git
synced 2025-05-13 13:17:51 +00:00
fix: remove unused code and trustpilot
Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
parent
578822d428
commit
d1546a36ef
@ -2,7 +2,6 @@ import Banner from 'components/banner';
|
||||
import Navbar from 'components/layout/navbar';
|
||||
import { GeistSans } from 'geist/font/sans';
|
||||
import { ensureStartsWith } from 'lib/utils';
|
||||
import Script from 'next/script';
|
||||
import { ReactNode, Suspense } from 'react';
|
||||
import './globals.css';
|
||||
|
||||
@ -37,11 +36,6 @@ export default async function RootLayout({ children }: { children: ReactNode })
|
||||
return (
|
||||
<html lang="en" className={GeistSans.variable}>
|
||||
<body className="bg-neutral-50 text-black selection:bg-teal-300 dark:bg-neutral-900 dark:text-white dark:selection:bg-pink-500 dark:selection:text-white">
|
||||
<Script
|
||||
src="//widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js"
|
||||
async
|
||||
type="text/javascript"
|
||||
/>
|
||||
<header>
|
||||
<Banner />
|
||||
<Navbar />
|
||||
|
@ -4,7 +4,6 @@ import { Suspense } from 'react';
|
||||
import HomePageFilters, { HomePageFiltersPlaceholder } from './filters/hompage-filters';
|
||||
import DynamicHeroIcon from './hero-icon';
|
||||
import ImageDisplay from './page/image-display';
|
||||
import TrustPilot from './trust-pilot';
|
||||
|
||||
const Hero = async () => {
|
||||
const [offers, heroImage] = await Promise.all([
|
||||
@ -66,17 +65,12 @@ const Hero = async () => {
|
||||
</div>
|
||||
<div aria-hidden="true" className="absolute inset-0 bg-dark opacity-80" />
|
||||
<div className="flex flex-col gap-10 px-6 py-32 text-center sm:py-64 lg:px-0">
|
||||
<div className="mx-auto hidden max-w-[800px] items-center justify-between gap-10 md:flex">
|
||||
<div className="relative flex items-center">
|
||||
<Image src="/best-price.svg" alt="Best Price" width={100} height={90} />
|
||||
<div className="ml-4 text-left text-white">
|
||||
<p className="tracking-wide">Best Price Guarantee</p>
|
||||
<p className="max-w-[200px] text-sm tracking-wide">
|
||||
We will match or beat any competitor's pricing.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<TrustPilot />
|
||||
<div className="relative mx-auto hidden flex-col items-center justify-center text-white md:flex">
|
||||
<Image src="/best-price.svg" alt="Best Price" width={100} height={90} />
|
||||
<p className="tracking-wide">Best Price Guarantee</p>
|
||||
<p className="text-sm tracking-wide">
|
||||
We will match or beat any competitor's pricing.
|
||||
</p>
|
||||
</div>
|
||||
<div className="relative mx-auto flex max-w-4xl flex-col items-center ">
|
||||
<Suspense fallback={<HomePageFiltersPlaceholder />}>
|
||||
|
@ -1,19 +0,0 @@
|
||||
import { getPage } from 'lib/shopify';
|
||||
import PageContent from './page/page-content';
|
||||
|
||||
const HomePageContent = async () => {
|
||||
const page = await getPage('home-page');
|
||||
return (
|
||||
<div className="mx-auto max-w-7xl py-6 sm:px-6 lg:px-8">
|
||||
<div className="flex flex-col space-y-16">
|
||||
{page.metaobjects?.map((content) => (
|
||||
<div key={content.id}>
|
||||
<PageContent block={content} />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default HomePageContent;
|
@ -1,34 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect, useRef } from 'react';
|
||||
|
||||
const TrustPilot = () => {
|
||||
const ref = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
// @ts-ignore
|
||||
if (window.Trustpilot) {
|
||||
// @ts-ignore
|
||||
window.Trustpilot.loadFromElement(ref.current);
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={ref}
|
||||
data-locale="en-US"
|
||||
data-template-id="53aa8807dec7e10d38f59f32"
|
||||
data-businessunit-id="58af38df0000ff00059d3de2"
|
||||
data-style-height="120px"
|
||||
data-style-width="100%"
|
||||
data-style-font-size="10px"
|
||||
data-theme="dark"
|
||||
>
|
||||
<a href="https://www.trustpilot.com/review/carpartplanet.com" target="_blank" rel="noopener">
|
||||
Trustpilot
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default TrustPilot;
|
Loading…
x
Reference in New Issue
Block a user