Skip to content

Commit

Permalink
fix(conflicts): fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
suleyunus committed Aug 28, 2024
1 parent 8d5b971 commit 8bea9b2
Show file tree
Hide file tree
Showing 29 changed files with 217 additions and 861 deletions.
2 changes: 1 addition & 1 deletion build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/><link rel="icon" href="data:," data-placeholder-favicon/><script defer="defer" src="/admin/styles.31f3d4bf2bbeae911e3f.js"></script><script defer="defer" src="/admin/main.20ce38cb5e6d1c7f3ceb.js"></script><link href="/admin/styles.7094867468f7520dadc8.css" rel="stylesheet"></head><body><div id="app"></div><div id="portal"></div></body></html>
<!doctype html><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/><link rel="icon" href="data:," data-placeholder-favicon/><script defer="defer" src="/admin/styles.31f3d4bf2bbeae911e3f.js"></script><script defer="defer" src="/admin/main.6e839b0314db5eebab2d.js"></script><link href="/admin/styles.7094867468f7520dadc8.css" rel="stylesheet"></head><body><div id="app"></div><div id="portal"></div></body></html>
84 changes: 84 additions & 0 deletions build/main.0e510f7943781f63534c.js

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions build/main.6e839b0314db5eebab2d.js

Large diffs are not rendered by default.

17 changes: 0 additions & 17 deletions src/app/(pages)/checkout/CheckoutForm/index.module.scss

This file was deleted.

165 changes: 0 additions & 165 deletions src/app/(pages)/checkout/CheckoutForm/index.tsx

This file was deleted.

1 change: 1 addition & 0 deletions src/app/(pages)/checkout/CheckoutItem/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
min-height: 80px;
padding: 8px;
background-color: var(--gray-4);
flex-grow: 1;
}

.media {
Expand Down
10 changes: 5 additions & 5 deletions src/app/(pages)/checkout/CheckoutItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ import classes from './index.module.scss'

export const CheckoutItem = ({ product, title, metaImage, quantity }) => {
return (
<li className="flex py-6">
<li className="flex gap-2 py-6">
<Link href={`/products/${product.slug}`} className={classes.mediaWrapper}>
{!metaImage && <span>No image</span>}
{metaImage && typeof metaImage !== 'string' && (
<Media className={classes.media} imgClassName={classes.image} resource={metaImage} fill />
)}
</Link>

<div className="ml-6 flex flex-1 flex-col">
<div className="flex">
<div className="flex flex-col">
<div className="flex py-2">
<div className="min-w-0 flex-1">
<h4 className="text-sm">
<h4 className="text-sm" style={{ lineHeight: 1 }}>
<Link
href={`/products/${product.slug}`}
className="font-medium text-gray-700 hover:text-gray-800"
Expand All @@ -28,7 +28,7 @@ export const CheckoutItem = ({ product, title, metaImage, quantity }) => {
</h4>
</div>

<div className="ml-4 flow-root flex-shrink-0 text-xs">
<div className="ml-4 flow-root flex-shrink-0 !text-xs">
<Price product={product} button={false} quantity={quantity} />
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/app/(pages)/checkout/CheckoutPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import Link from 'next/link'
import { useRouter } from 'next/navigation'

import { BCLocation } from '../../../../payload/bc/types/BCLocation'
import { createPayloadOrder } from '../../../../payload/collections/Orders/utils/createPayloadorder'
import { createPayloadOrder } from '../../../../payload/collections/Orders/utils/createPayloadOrder'
import { createPayloadPayment } from '../../../../payload/collections/Payments/utils/createPayloadPayment'
import { Settings } from '../../../../payload/payload-types'
import { submitPesapalOrderRequest } from '../../../../payload/pesapal/endpoints/submitPesapalOrderRequest'
import { submitPesapalOrderRequest } from '../../../../payload/pesapal/utils/submitPesapalOrderRequest'
import { Button } from '../../../_components/Button'
import { Input } from '../../../_components/Input'
import { useAuth } from '../../../_providers/Auth'
Expand All @@ -20,7 +20,7 @@ import { CheckoutItem } from '../CheckoutItem'

import classes from './index.module.scss'

type FormData = {
export type DeliveryInfo = {
Location_Code: string
Contact_Name: string
Contact_Phone_No: string
Expand Down Expand Up @@ -70,10 +70,10 @@ export const CheckoutPage: React.FC<{
register,
handleSubmit,
formState: { errors },
} = useForm<FormData>()
} = useForm<DeliveryInfo>()

const onSubmit = useCallback(
async (data: FormData) => {
async (data: DeliveryInfo) => {
setLoading(true)

const currency = 'KES'
Expand Down
24 changes: 8 additions & 16 deletions src/app/(pages)/create-account/CreateAccountForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,6 @@ const CreateAccountForm: React.FC = () => {
return (
<form onSubmit={handleSubmit(onSubmit)} className={classes.form}>
<Message error={error} success={success} className={classes.message} />
<Input
name="email"
label="Email Address"
required
register={register}
error={errors.email}
type="email"
placeholder="Enter your email"
pattern="^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"
/>
<Input
name="name"
label="Full Name"
Expand All @@ -107,15 +97,16 @@ const CreateAccountForm: React.FC = () => {
placeholder="Enter your full name"
pattern="^[a-zA-Z\s]+$"
/>

<Input
name="phoneNumber"
label="Phone Number"
name="email"
label="Email Address"
required
register={register}
error={errors.phoneNumber}
type="text"
placeholder="072200000"
pattern="^(07|01)\d{8}$"
error={errors.email}
type="email"
placeholder="Enter your email"
pattern="^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"
/>

<Input
Expand All @@ -128,6 +119,7 @@ const CreateAccountForm: React.FC = () => {
placeholder="Password must be at least 8 characters long"
pattern=".*" // Add the pattern property with a valid regular expression to enforce a password policy.
/>

<Input
name="passwordConfirm"
type="password"
Expand Down
31 changes: 11 additions & 20 deletions src/app/_components/Header/Nav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,23 @@ export const HeaderNav: React.FC<{ header: HeaderType }> = ({ header }) => {
.join(' ')}
>
{navItems.map(({ link }, i) => {
return <CMSLink key={i} {...link} appearance="none" className="hover:underline" />
return (
<CMSLink
key={i}
{...link}
appearance="none"
className="hover:underline !text-[var(--gray-12)]"
/>
)
})}
<CartLink className="hover:underline" />
<CartLink className="hover:underline !text-[var(--gray-12)]" />
{user && (
<Link href="/account" className="hover:underline">
<Link href="/account" className="hover:underline !text-[var(--gray-12)]">
Account
</Link>
)}
{!user && (
<>
<Button
el="link"
href="/login"
label="Login"
appearance="secondary"
className="capitalize"
/>

<Button
el="link"
href="/create-account"
label="Create Account"
appearance="primary"
className="capitalize"
/>
</>
<Button el="link" href="/login" label="Login" appearance="primary" className="capitalize" />
)}
</nav>
)
Expand Down
Loading

0 comments on commit 8bea9b2

Please sign in to comment.