Skip to content

Commit

Permalink
Merge pull request #565 from evershopcommerce/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
treoden authored Jun 12, 2024
2 parents f48a879 + 89393a8 commit 9b29d1d
Show file tree
Hide file tree
Showing 45 changed files with 115 additions and 222 deletions.
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
/*

# Except packages:
!/packages
!/packages
!/themes
!/extensions
4 changes: 2 additions & 2 deletions packages/evershop/bin/extension/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { getConfig } = require('@evershop/evershop/src/lib/util/getConfig');
const { getCoreModules } = require('@evershop/evershop/bin/lib/loadModules');
const { warning } = require('@evershop/evershop/src/lib/log/logger');

let extensions = [];
let extensions;

function loadExtensions() {
const coreModules = getCoreModules();
Expand Down Expand Up @@ -42,7 +42,7 @@ function loadExtensions() {
}

module.exports.getEnabledExtensions = function getEnabledExtensions() {
if (extensions.length === 0) {
if (extensions === undefined) {
extensions = loadExtensions();
}
return extensions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function AttributeFilter({
return (
<>
{availableAttributes.map((a) => (
<div key={a.attributeCode} className="attribute-filter mt-2">
<div key={a.attributeCode} className="attribute-filter mt-10">
<div className="filter-item-title">
<span className="font-medium">{a.attributeName}</span>
</div>
Expand All @@ -79,7 +79,7 @@ export function AttributeFilter({
);

return (
<li key={o.optionId} className="mt-05 mr-05">
<li key={o.optionId} className="mt-1 mr-1">
<a
href="#"
className="flex justify-start items-center"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function CategoryFilter({ currentFilters, categories, updateFilter }) {
}

return (
<div className="category-filter mt-2">
<div className="category-filter mt-10">
<div className="filter-item-title">
<span className="font-medium">{_('Category')}</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ export default function ProductList({ products = [], countPerRow = 3 }) {
let className;
switch (countPerRow) {
case 3:
className = 'grid grid-cols-2 md:grid-cols-3 gap-2';
className = 'grid grid-cols-2 md:grid-cols-3 gap-10';
break;
case 4:
className = 'grid grid-cols-2 md:grid-cols-4 gap-2';
className = 'grid grid-cols-2 md:grid-cols-4 gap-10';
break;
case 5:
className = 'grid grid-cols-2 md:grid-cols-5 gap-2';
className = 'grid grid-cols-2 md:grid-cols-5 gap-10';
break;
default:
className = 'grid grid-cols-2 md:grid-cols-3 gap-2';
className = 'grid grid-cols-2 md:grid-cols-3 gap-10';
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function Pagination({ total, limit, currentPage }) {

return (
<div className="products-pagination">
<ul className="pagination flex justify-center space-x-1">
<ul className="pagination flex justify-center space-x-5">
{currentPage > 1 && (
<li className="page-item prev self-center">
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ export default function Sorting() {
};

return (
<div className="product-sorting mb-1">
<div className="product-sorting-inner flex justify-end items-center space-x-05">
<div className="product-sorting mb-10">
<div className="product-sorting-inner flex justify-end items-center space-x-2">
<div>
<span>{_('Sort By')}:</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';

function Name({ name, url }) {
return (
<div className="product-name product-list-name mt-1 mb-025">
<div className="product-name product-list-name mt-5 mb-1">
<a href={url} className="font-bold hover:underline h5">
<span>{name}</span>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ export function Empty() {
<div className="text-center">
<h2>{_('Shopping cart')}</h2>
</div>
<div className="mt-2 text-center">
<div className="mt-10 text-center">
<span>{_('Your cart is empty!')}</span>
</div>
<div className="flex justify-center mt-2">
<div className="flex justify-center mt-5">
<Button
url="/"
title={
<span className="flex space-x-1">
<span className="flex space-x-3">
<span className="self-center">{_('CONTINUE SHOPPING')}</span>{' '}
<svg
className="self-center"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function ItemOptions({ options = [] }) {
const language = get(useAppState(), 'language', 'en');

return (
<div className="cart-item-options mt-05">
<div className="cart-item-options mt-2">
<ul className="list-basic">
{options.map((o, i) => (
// eslint-disable-next-line react/no-array-index-key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function ItemVariantOptions({ options = [] }) {
}

return (
<div className="cart-item-variant-options mt-05">
<div className="cart-item-variant-options mt-2">
<ul>
{options.map((o, i) => (
// eslint-disable-next-line react/no-array-index-key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function Items({ items, setting: { displayCheckoutPriceIncludeTax } }) {
// eslint-disable-next-line react/no-array-index-key
<tr key={index}>
<td>
<div className="flex justify-start space-x-1 product-info">
<div className="flex justify-start space-x-5 product-info">
<div className="product-image flex justify-center items-center">
{item.thumbnail && (
<img
Expand Down Expand Up @@ -85,14 +85,14 @@ function Items({ items, setting: { displayCheckoutPriceIncludeTax } }) {
<ItemVariantOptions
options={JSON.parse(item.variantOptions || '[]')}
/>
<div className="mt-05">
<div className="mt-2">
<a
onClick={async (e) => {
e.preventDefault();
await removeItem(item);
}}
href="#"
className="text-textSubdued underline"
className="underline text-gray-500"
>
<span>{_('Remove')}</span>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ export function StepContent({

if (fetching) {
return (
<div className="flex justify-center items-center p-3">
<div className="flex justify-center items-center p-5">
<Spinner width={25} height={25} />
</div>
);
}
if (error) {
return <div className="p-2 text-critical">{error.message}</div>;
return <div className="p-5 text-red-700">{error.message}</div>;
}
return (
<div>
Expand All @@ -100,7 +100,7 @@ export function StepContent({
submitBtn={false}
isJSON
>
<h4 className="mb-1 mt-3">{_('Billing Address')}</h4>
<h4 className="mb-3 mt-7">{_('Billing Address')}</h4>
<BillingAddress
useShippingAddress={useShippingAddress}
setUseShippingAddress={setUseShippingAddress}
Expand All @@ -123,16 +123,16 @@ export function StepContent({
</div>
)}

<h4 className="mb-1 mt-3">{_('Payment Method')}</h4>
<h4 className="mb-3 mt-7">{_('Payment Method')}</h4>
{paymentMethods && paymentMethods.length > 0 && (
<>
<div className="divide-y border rounded border-divider px-2 mb-2">
<div className="divide-y border rounded border-divider p-5 mb-5">
{paymentMethods.map((method) => (
<div
key={method.code}
className="border-divider payment-method-list"
>
<div className="py-2">
<div className="py-5">
<Area id={`checkoutPaymentMethod${method.code}`} />
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function ItemVariantOptions({ options = [] }) {
}

return (
<div className="cart-item-variant-options mt-05">
<div className="cart-item-variant-options mt-2">
<ul>
{options.map((o, i) => (
// eslint-disable-next-line react/no-array-index-key
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.product-thumbnail {
position: relative;
width: 6rem;
height: 6rem;
display: flex;
justify-content: center;
border: 1px solid var(--divider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ export function Edit({

return (
<div className="">
<h4 className="mb-1 mt-1">{_('Contact information')}</h4>
<h4 className="mb-3 mt-3">{_('Contact information')}</h4>
{!customer && (
<div className="mb-1">
<div className="mb-3">
<span>{_('Already have an account?')}</span>{' '}
<a className="text-interactive hover:underline" href={loginUrl}>
<a className="text-blue-500 hover:underline" href={loginUrl}>
{_('Login')}
</a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export default function CheckoutForm({ stripePublishableKey }) {

if (result.error) {
return (
<div className="flex p-2 justify-center items-center text-critical">
<div className="flex p-5 justify-center items-center text-red-700">
{error.message}
</div>
);
Expand Down Expand Up @@ -197,7 +197,7 @@ export default function CheckoutForm({ stripePublishableKey }) {
</div>
{/* Show any error that happens when processing the payment */}
{error && (
<div className="card-error text-critical mb-2" role="alert">
<div className="card-error text-red-700 mb-2" role="alert">
{error}
</div>
)}
Expand All @@ -208,7 +208,7 @@ export default function CheckoutForm({ stripePublishableKey }) {
validationRules={[
{
rule: 'notEmpty',
message: 'Please complete the card information'
message: _('Please complete the card information')
}
]}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function TestCards({ showTestCard, testSuccess, testFailure }) {
<div className="text-sm text-gray-600">
Test card number: 4242 4242 4242 4242
</div>
<div className="text-sm text-gray-600">Test card expiry: 04/24</div>
<div className="text-sm text-gray-600">Test card expiry: 04/29</div>
<div className="text-sm text-gray-600">Test card CVC: 242</div>
</div>
)}
Expand All @@ -34,7 +34,7 @@ function TestCards({ showTestCard, testSuccess, testFailure }) {
<div className="text-sm text-gray-600">
Test card number: 4000 0000 0000 9995
</div>
<div className="text-sm text-gray-600">Test card expiry: 04/24</div>
<div className="text-sm text-gray-600">Test card expiry: 04/29</div>
<div className="text-sm text-gray-600">Test card CVC: 242</div>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
The `Category` type represents a category object.
"""
type Category {
categoryId: ID!
categoryId: Int!
uuid: String!
name: String!
status: Int!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
The `Collection` type represents a product collection.
"""
type Collection {
collectionId: ID!
collectionId: Int!
uuid: String!
name: String!
description: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Area from '@components/common/Area';

export default function CategoryView() {
return (
<div className="page-width grid grid-cols-1 md:grid-cols-4 gap-2">
<div className="page-width grid grid-cols-1 md:grid-cols-4 gap-10">
<Area id="leftColumn" className="md:col-span-1" />
<Area id="rightColumn" className="md:col-span-3" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import Button from '@components/frontStore/cms/Button';

export default function FeaturedCategories() {
return (
<div className="mt-15">
<div className="grid grid-cols-1 md:grid-cols-3 gap-2 page-width">
<div className="mt-12">
<div className="grid grid-cols-1 md:grid-cols-3 gap-10 page-width">
<div>
<div className="text-center">
<img src="/assets/homepage/banner/men-shoes.jpeg" alt="" />
</div>
<h3 className="h4 uppercase mt-1 mb-1">Men shoes collection</h3>
<div className="mb-1">
<h3 className="h4 uppercase mt-5 mb-5">Men shoes collection</h3>
<div className="mb-5">
<p>
Constructed from luxury nylons, leathers, and custom hardware,
featuring sport details such as hidden breathing vents, waterproof
Expand All @@ -23,8 +23,8 @@ export default function FeaturedCategories() {
<div>
<img src="/assets/homepage/banner/women-shoes.jpeg" alt="" />
</div>
<h3 className="h4 uppercase mt-1 mb-1">Women shoes collection</h3>
<div className="mb-1">
<h3 className="h4 uppercase mt-5 mb-5">Women shoes collection</h3>
<div className="mb-5">
<p>
Constructed from luxury nylons, leathers, and custom hardware,
featuring sport details such as hidden breathing vents, waterproof
Expand All @@ -37,8 +37,8 @@ export default function FeaturedCategories() {
<div>
<img src="/assets/homepage/banner/kid-shoes.jpeg" alt="" />
</div>
<h3 className="h4 uppercase mt-1 mb-1">Men shoes collection</h3>
<div className="mb-1">
<h3 className="h4 uppercase mt-5 mb-5">Men shoes collection</h3>
<div className="mb-5">
<p>
Constructed from luxury nylons, leathers, and custom hardware,
featuring sport details such as hidden breathing vents, waterproof
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export default function FeaturedProducts({ collection }) {
return null;
}
return (
<div className="pt-3">
<div className="pt-10">
<div className="page-width">
<h3 className="mt-3 mb-3 text-center uppercase h5 tracking-widest">
<h3 className="mt-20 mb-10 text-center uppercase h5 tracking-widest">
{collection.name}
</h3>
<ProductList products={collection.products.items} countPerRow={4} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ ToastMessage.propTypes = {

function AddToCart({ stockAvaibility, loading = false, error }) {
return (
<div className="add-to-cart mt-2">
<div className="add-to-cart mt-10">
<div style={{ width: '8rem' }}>
<Field
type="text"
Expand All @@ -98,8 +98,8 @@ function AddToCart({ stockAvaibility, loading = false, error }) {
formId="productForm"
/>
</div>
{error && <div className="text-critical mt-1">{error}</div>}
<div className="mt-1">
{error && <div className="text-red-700 mt-5">{error}</div>}
<div className="mt-5">
{stockAvaibility === true && (
<Button
title={_('ADD TO CART')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function GeneralInfo({ product }) {
return (
<Area
id="productViewGeneralInfo"
className="flex flex-col gap-1"
className="flex flex-col gap-5"
coreComponents={[
{
component: { default: Name },
Expand Down
Loading

0 comments on commit 9b29d1d

Please sign in to comment.