mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 15:36:58 +00:00
support multi brands site
Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
parent
68039b1a6e
commit
c188147bd9
@ -1,13 +1,20 @@
|
||||
import Image from 'next/image';
|
||||
|
||||
const { STORE_PREFIX } = process.env;
|
||||
export default function LogoSquare({ dark = false }: { dark?: boolean }) {
|
||||
return (
|
||||
<div className="h-12 md:h-[55px]">
|
||||
{dark ? (
|
||||
<Image src="/dark-logo.svg" alt="Logo" width={327} height={61} className="h-full w-full" />
|
||||
<Image
|
||||
src={`/${STORE_PREFIX}/dark-logo.svg`}
|
||||
alt="Logo"
|
||||
width={327}
|
||||
height={61}
|
||||
className="h-full w-full"
|
||||
/>
|
||||
) : (
|
||||
<Image
|
||||
src="/logo.svg"
|
||||
src={`/${STORE_PREFIX}/logo.svg`}
|
||||
alt="Logo"
|
||||
width={327}
|
||||
height={61}
|
||||
|
@ -16,6 +16,8 @@ const ManufacturersGrid = ({ manufacturers, variant = 'home' }: ManufacturersGri
|
||||
|
||||
return (
|
||||
<div className="h-auto max-h-[700px] w-full overflow-auto rounded px-10 py-6 shadow">
|
||||
{popularManufacturers.length ? (
|
||||
<>
|
||||
<p className="flex items-center gap-2">
|
||||
<StarIcon className="size-4" />
|
||||
<span className="font-medium text-blue-800">Popular Manufacturers</span>
|
||||
@ -28,15 +30,18 @@ const ManufacturersGrid = ({ manufacturers, variant = 'home' }: ManufacturersGri
|
||||
) : (
|
||||
<ManufacturerItem
|
||||
manufacturer={manufacturer}
|
||||
className={'rounded border border-primary px-2 py-1'}
|
||||
className={'border-primary rounded border px-2 py-1'}
|
||||
href={`/search/${variant}?${MAKE_FILTER_ID}=${manufacturer.id}`}
|
||||
/>
|
||||
)}
|
||||
{variant === 'home' && <ButtonGroup manufacturer={manufacturer} />}
|
||||
</div>
|
||||
))}
|
||||
))}{' '}
|
||||
</div>
|
||||
<hr className="my-10 w-full" />
|
||||
</>
|
||||
) : null}
|
||||
|
||||
<p className="flex items-center gap-2">
|
||||
<GlobeAltIcon className="size-4" />
|
||||
<span className="font-medium text-blue-800">All Manufacturers</span>
|
||||
@ -51,7 +56,7 @@ const ManufacturersGrid = ({ manufacturers, variant = 'home' }: ManufacturersGri
|
||||
) : (
|
||||
<ManufacturerItem
|
||||
manufacturer={manufacturer}
|
||||
className={'rounded border border-primary px-2 py-1'}
|
||||
className={'border-primary rounded border px-2 py-1'}
|
||||
href={`/search/${variant}?${MAKE_FILTER_ID}=${manufacturer.id}`}
|
||||
/>
|
||||
)}
|
||||
|
@ -1,4 +1,4 @@
|
||||
export const colors = {
|
||||
export const carPartPlanetColor = {
|
||||
primary: {
|
||||
DEFAULT: '#EF6C02',
|
||||
emphasis: '#C85900',
|
||||
@ -20,3 +20,26 @@ export const colors = {
|
||||
600: '#111C55'
|
||||
}
|
||||
};
|
||||
|
||||
export const remanTransmissionColor = {
|
||||
primary: {
|
||||
DEFAULT: '#1A99DE',
|
||||
emphasis: '#0073E6',
|
||||
muted: '#5BAFDD'
|
||||
},
|
||||
content: {
|
||||
subtle: '#9ca3af', // gray-400
|
||||
DEFAULT: '#6b7280', // gray-500
|
||||
emphasis: '#374151', // gray-700
|
||||
strong: '#111827', // gray-900
|
||||
inverted: '#ffffff' // white
|
||||
},
|
||||
dark: '#091242',
|
||||
secondary: '#1A99DE',
|
||||
blue: {
|
||||
800: '#1C1F35',
|
||||
200: '#666C89',
|
||||
500: '#2D3A7B',
|
||||
600: '#111C55'
|
||||
}
|
||||
};
|
||||
|
@ -16,6 +16,7 @@ export const ensureStartsWith = (stringToCheck: string, startsWith: string) =>
|
||||
export const validateEnvironmentVariables = () => {
|
||||
const requiredEnvironmentVariables = [
|
||||
'SHOPIFY_STORE_DOMAIN',
|
||||
'STORE_PREFIX',
|
||||
'SHOPIFY_STOREFRONT_ACCESS_TOKEN',
|
||||
'SHOPIFY_CUSTOMER_ACCOUNT_API_CLIENT_ID',
|
||||
'SHOPIFY_CUSTOMER_ACCOUNT_API_URL',
|
||||
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
21
public/reman-transmission/dark-logo.svg
Normal file
21
public/reman-transmission/dark-logo.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 34 KiB |
21
public/reman-transmission/logo.svg
Normal file
21
public/reman-transmission/logo.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 34 KiB |
@ -1,5 +1,12 @@
|
||||
const plugin = require('tailwindcss/plugin');
|
||||
import { colors } from './lib/styles.ts';
|
||||
import { carPartPlanetColor, remanTransmissionColor } from './lib/styles.ts';
|
||||
|
||||
const { STORE_PREFIX } = process.env;
|
||||
|
||||
const getCustomColors = {
|
||||
'car-part-planet': carPartPlanetColor,
|
||||
'reman-transmission': remanTransmissionColor
|
||||
};
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
@ -7,7 +14,7 @@ module.exports = {
|
||||
content: ['./app/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
|
||||
theme: {
|
||||
extend: {
|
||||
colors,
|
||||
colors: getCustomColors[STORE_PREFIX],
|
||||
fontFamily: {
|
||||
sans: ['var(--font-geist-sans)']
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user