Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Soul VIBE #1669

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const LoginForm = () => {
<SubmitButton />
</FormSubmit>
<Link
className="mx-auto my-5 inline-flex items-center justify-start px-8 py-3 font-semibold text-primary hover:text-secondary md:mx-0 md:my-0"
className="hover:text-secondary mx-auto my-5 inline-flex items-center justify-start px-8 py-3 font-semibold text-primary md:mx-0 md:my-0"
href="/login/forgot-password"
>
{t('Form.forgotPassword')}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use server';

import { revalidatePath } from 'next/cache';
import { expirePath } from 'next/cache';
import { getTranslations } from 'next-intl/server';

import { getSessionCustomerAccessToken } from '~/auth';
Expand Down Expand Up @@ -50,7 +50,7 @@ export const deleteAddress = async (addressId: number): Promise<State> => {

const result = response.data.customer.deleteCustomerAddress;

revalidatePath('/account/addresses', 'page');
expirePath('/account/addresses', 'page');

if (result.errors.length === 0) {
return { status: 'success', message: t('success') };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use server';

import { revalidatePath } from 'next/cache';
import { expirePath } from 'next/cache';
import { getTranslations } from 'next-intl/server';

import { getSessionCustomerAccessToken } from '~/auth';
Expand Down Expand Up @@ -80,7 +80,7 @@ export const addAddress = async ({

const result = response.data.customer.addCustomerAddress;

revalidatePath('/account/addresses', 'page');
expirePath('/account/addresses', 'page');

if (result.errors.length === 0) {
return { status: 'success', message: t('success') };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use server';

import { revalidatePath } from 'next/cache';
import { expirePath } from 'next/cache';
import { getTranslations } from 'next-intl/server';

import { getSessionCustomerAccessToken } from '~/auth';
Expand Down Expand Up @@ -88,7 +88,7 @@ export const updateAddress = async ({

const result = response.data.customer.updateCustomerAddress;

revalidatePath('/account/addresses', 'page');
expirePath('/account/addresses', 'page');

if (result.errors.length === 0) {
return { status: 'success', message: t('success') };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use server';

import { revalidatePath } from 'next/cache';
import { expirePath } from 'next/cache';
import { getTranslations } from 'next-intl/server';

import { getSessionCustomerAccessToken } from '~/auth';
Expand Down Expand Up @@ -88,7 +88,7 @@ export const updateCustomer = async ({ formData, reCaptchaToken }: UpdateCustome
},
});

revalidatePath('/account/settings', 'page');
expirePath('/account/settings', 'page');

const result = response.data.customer.updateCustomer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ export const UpdateSettingsForm = ({
<Link href="/account">{t('cancel')}</Link>
</Button>
<Link
className="mt-2 w-fit font-semibold text-primary hover:text-secondary md:ms-auto md:mt-0"
className="hover:text-secondary mt-2 w-fit font-semibold text-primary md:ms-auto md:mt-0"
href="/account/settings/change-password"
>
{t('changePassword')}
Expand Down
4 changes: 2 additions & 2 deletions core/app/[locale]/(default)/cart/_actions/remove-item.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use server';

import { revalidateTag } from 'next/cache';
import { expireTag } from 'next/cache';
import { cookies } from 'next/headers';

import { getSessionCustomerAccessToken } from '~/auth';
Expand Down Expand Up @@ -61,7 +61,7 @@ export async function removeItem({
cookieStore.delete('cartId');
}

revalidateTag(TAGS.cart);
expireTag(TAGS.cart);

return { status: 'success', data: cart };
} catch (error: unknown) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use server';

import { revalidateTag } from 'next/cache';
import { expireTag } from 'next/cache';
import { z } from 'zod';

import { getSessionCustomerAccessToken } from '~/auth';
Expand Down Expand Up @@ -54,7 +54,7 @@ export const applyCouponCode = async (formData: FormData) => {
return { status: 'error', error: 'Coupon code is invalid.' };
}

revalidateTag(TAGS.checkout);
expireTag(TAGS.checkout);

return { status: 'success', data: checkout };
} catch (error: unknown) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use server';

import { revalidateTag } from 'next/cache';
import { expireTag } from 'next/cache';
import { z } from 'zod';

import { getSessionCustomerAccessToken } from '~/auth';
Expand Down Expand Up @@ -54,7 +54,7 @@ export const removeCouponCode = async (formData: FormData) => {
return { status: 'error', error: 'Error ocurred removing coupon.' };
}

revalidateTag(TAGS.checkout);
expireTag(TAGS.checkout);

return { status: 'success', data: checkout };
} catch (error: unknown) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use server';

import { revalidatePath } from 'next/cache';
import { expirePath } from 'next/cache';
import { cookies } from 'next/headers';

import { getSessionCustomerAccessToken } from '~/auth';
Expand Down Expand Up @@ -83,7 +83,7 @@ export async function updateItemQuantity({
return { status: 'error', error: 'Failed to change product quantity in Cart' };
}

revalidatePath('/cart');
expirePath('/cart');

return { status: 'success', data: cart };
} catch (error: unknown) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use server';

import { revalidateTag } from 'next/cache';
import { expireTag } from 'next/cache';
import { z } from 'zod';

import { getSessionCustomerAccessToken } from '~/auth';
Expand Down Expand Up @@ -119,7 +119,7 @@ export const submitShippingInfo = async (
return { status: 'error', error: 'Failed to submit shipping info.' };
}

revalidateTag(TAGS.checkout);
expireTag(TAGS.checkout);

return { status: 'success', data: result };
} catch (error: unknown) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use server';

import { revalidateTag } from 'next/cache';
import { expireTag } from 'next/cache';
import { z } from 'zod';

import { getSessionCustomerAccessToken } from '~/auth';
Expand Down Expand Up @@ -57,7 +57,7 @@ export const submitShippingCosts = async (
return { status: 'error', error: 'Failed to submit shipping cost.' };
}

revalidateTag(TAGS.checkout);
expireTag(TAGS.checkout);

return { status: 'success', data: shippingCost };
} catch (error: unknown) {
Expand Down
6 changes: 3 additions & 3 deletions core/app/[locale]/(default)/compare/_actions/add-to-cart.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use server';

import { revalidateTag } from 'next/cache';
import { expireTag } from 'next/cache';
import { cookies } from 'next/headers';

import { addCartLineItem } from '~/client/mutations/add-cart-line-item';
Expand Down Expand Up @@ -33,7 +33,7 @@ export const addToCart = async (data: FormData) => {
return { status: 'error', error: 'Failed to add product to cart.' };
}

revalidateTag(TAGS.cart);
expireTag(TAGS.cart);

return { status: 'success', data: cart };
}
Expand All @@ -53,7 +53,7 @@ export const addToCart = async (data: FormData) => {
path: '/',
});

revalidateTag(TAGS.cart);
expireTag(TAGS.cart);

return { status: 'success', data: cart };
} catch (error: unknown) {
Expand Down
2 changes: 2 additions & 0 deletions core/app/[locale]/(default)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ export default async function DefaultLayout({ params, children }: Props) {
</>
);
}

export const experimental_ppr = true;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use server';

import { removeEdgesAndNodes } from '@bigcommerce/catalyst-client';
import { revalidateTag } from 'next/cache';
import { expireTag } from 'next/cache';
import { cookies } from 'next/headers';

import { FragmentOf, graphql } from '~/client/graphql';
Expand Down Expand Up @@ -152,7 +152,7 @@ export async function handleAddToCart(
return { status: 'error', error: 'Failed to add product to cart.' };
}

revalidateTag(TAGS.cart);
expireTag(TAGS.cart);

return { status: 'success', data: cart };
}
Expand All @@ -179,7 +179,7 @@ export async function handleAddToCart(
path: '/',
});

revalidateTag(TAGS.cart);
expireTag(TAGS.cart);

return { status: 'success', data: cart };
} catch (error: unknown) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const ErrorMessage = ({ children }: { children: React.ReactNode }) => (
<p className="mt-2 text-xs font-normal text-error-secondary">{children}</p>
<p className="text-error-secondary mt-2 text-xs font-normal">{children}</p>
);
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const ProductForm = ({ data: product }: Props) => {
cartItems: quantity,
cartLink: (chunks) => (
<Link
className="font-semibold text-primary hover:text-secondary"
className="hover:text-secondary font-semibold text-primary"
href="/cart"
prefetch="viewport"
prefetchKind="full"
Expand Down
21 changes: 17 additions & 4 deletions core/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Analytics } from '@vercel/analytics/react';
import { SpeedInsights } from '@vercel/speed-insights/next';
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import { DM_Serif_Text, Inter, Roboto_Mono } from 'next/font/google';
import { NextIntlClientProvider } from 'next-intl';
import { getMessages, setRequestLocale } from 'next-intl/server';
import { PropsWithChildren } from 'react';
Expand All @@ -16,9 +16,22 @@ import { Notifications } from '../notifications';
import { Providers } from '../providers';

const inter = Inter({
display: 'swap',
subsets: ['latin'],
variable: '--font-family-body',
});

const dm_serif_text = DM_Serif_Text({
display: 'swap',
subsets: ['latin'],
weight: '400',
variable: '--font-family-heading',
});

const roboto_mono = Roboto_Mono({
subsets: ['latin'],
display: 'swap',
variable: '--font-inter',
variable: '--font-family-mono',
});

const RootLayoutMetadataQuery = graphql(`
Expand Down Expand Up @@ -94,8 +107,8 @@ export default async function RootLayout({ params, children }: Props) {
const messages = await getMessages();

return (
<html className={`${inter.variable} font-sans`} lang={locale}>
<body className="flex h-screen min-w-[375px] flex-col">
<html lang={locale}>
<body className={`${inter.variable} ${dm_serif_text.variable} ${roboto_mono.variable}`}>
<Notifications />
<NextIntlClientProvider locale={locale} messages={messages}>
<Providers>{children}</Providers>
Expand Down
2 changes: 1 addition & 1 deletion core/app/[locale]/maintenance/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default async function Maintenance({ params }: Props) {
<p className="flex items-center gap-2">
<Phone aria-hidden="true" />
<a
className="text-primary hover:text-secondary focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-primary/20"
className="hover:text-secondary text-primary focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-primary/20"
href={`tel:${contact.phone}`}
>
{contact.phone}
Expand Down
29 changes: 29 additions & 0 deletions core/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
--primary: 96 100% 68%;
--accent: 96 100% 88%;
--background: 0 0% 100%;
--foreground: 0 0% 7%;
--success: 116 78% 65%;
--error: 0 100% 60%;
--warning: 40 100% 60%;
--info: 220 70% 45%;
--contrast-100: 0 0% 93%;
--contrast-200: 0 0% 82%;
--contrast-300: 0 0% 70%;
--contrast-400: 0 0% 54%;
--contrast-500: 0 0% 34%;
--font-variation-settings-body: "slnt" 0;
--font-variation-settings-heading: "slnt" 0;
--font-size-xs: 0.75rem;
--font-size-sm: 0.875rem;
--font-size-base: 1rem;
--font-size-lg: 1.125rem;
--font-size-xl: 1.25rem;
--font-size-2xl: 1.5rem;
--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
--shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
5 changes: 1 addition & 4 deletions core/components/link/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ export const Link = forwardRef<ElementRef<'a'>, Props>(

return (
<NavLink
className={cn(
'hover:text-primary focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-primary/20',
className,
)}
className={cn(className)}
href={href}
locale={finalLocale}
onMouseEnter={prefetch === 'hover' ? triggerPrefetch : undefined}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use server';

import { revalidateTag } from 'next/cache';
import { expireTag } from 'next/cache';
import { cookies } from 'next/headers';

import { addCartLineItem } from '~/client/mutations/add-cart-line-item';
Expand Down Expand Up @@ -32,7 +32,7 @@ export const addToCart = async (data: FormData) => {
return { status: 'error', error: 'Failed to add product to cart.' };
}

revalidateTag(TAGS.cart);
expireTag(TAGS.cart);

return { status: 'success', data: cart };
}
Expand All @@ -52,7 +52,7 @@ export const addToCart = async (data: FormData) => {
path: '/',
});

revalidateTag(TAGS.cart);
expireTag(TAGS.cart);

return { status: 'success', data: cart };
} catch (error: unknown) {
Expand Down
2 changes: 1 addition & 1 deletion core/components/ui/accordions/accordions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const Accordions = ({ accordions, ...props }: Props) => {
{accordions.map((accordion, i) => (
<AccordionPrimitive.Item key={i} value={accordion.title}>
<AccordionPrimitive.Header className="flex">
<AccordionPrimitive.Trigger className="flex flex-1 items-center justify-between py-[9.5px] text-lg font-bold outline-none transition-all hover:text-secondary focus-visible:text-secondary [&[data-state=open]>svg]:rotate-180">
<AccordionPrimitive.Trigger className="hover:text-secondary focus-visible:text-secondary flex flex-1 items-center justify-between py-[9.5px] text-lg font-bold outline-none transition-all [&[data-state=open]>svg]:rotate-180">
{accordion.title}
<ChevronDown className="h-6 w-6 shrink-0 transition-transform duration-200" />
</AccordionPrimitive.Trigger>
Expand Down
Loading
Loading