Skip to content

Commit

Permalink
Merge pull request #75 from Etherna/fix/EWEB-88-brand-kit
Browse files Browse the repository at this point in the history
fix brandkit logos not showing
  • Loading branch information
mattiaz9 authored Jul 10, 2024
2 parents d8396bf + 105e981 commit d04451f
Show file tree
Hide file tree
Showing 9 changed files with 11,916 additions and 8,455 deletions.
2 changes: 1 addition & 1 deletion apps/cms/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ declare global {
name: string
sort: number | null
brand_id: UUID | Brand
variants: BrandLogoVariant[]
logo_variants: BrandLogoVariant[]
}

interface BrandLogoVariant {
Expand Down
5 changes: 5 additions & 0 deletions apps/web/.astro/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"_variables": {
"lastUpdateCheck": 1720610588124
}
}
8 changes: 4 additions & 4 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@directus/sdk": "14.0.0",
"@headlessui/react": "1.7.17",
"@tippyjs/react": "4.2.6",
"astro": "4.2.3",
"astro": "4.11.5",
"axios": "1.6.2",
"blurhash": "2.0.5",
"clsx": "2.0.0",
Expand All @@ -41,8 +41,8 @@
"zod": "3.22.4"
},
"devDependencies": {
"@astrojs/react": "3.0.9",
"@astrojs/sitemap": "3.0.5",
"@astrojs/react": "3.6.0",
"@astrojs/sitemap": "3.1.6",
"@tailwindcss/typography": "0.5.10",
"@total-typescript/ts-reset": "0.5.1",
"@types/color-convert": "2.0.3",
Expand All @@ -59,7 +59,7 @@
"autoprefixer": "10.4.16",
"eslint-config-custom": "workspace:*",
"postcss": "8.4.31",
"prettier-plugin-astro": "0.12.2",
"prettier-plugin-astro": "0.14.0",
"prettier-plugin-tailwindcss": "0.5.7",
"sharp": "0.33.2",
"tailwindcss": "3.3.5",
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/queries/fetch-brand-kit-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function fetchBrandKitData() {
logos: [
"name",
{
variants: [
logo_variants: [
"id",
"variant_name",
"style",
Expand Down Expand Up @@ -43,7 +43,7 @@ export async function fetchBrandKitData() {
(brandResult.logos ?? []).map(async logo => ({
name: logo.name,
variants: await Promise.all(
(logo.variants ?? []).map(async variant => ({
(logo.logo_variants ?? []).map(async variant => ({
id: variant.id,
variantName: variant.variant_name,
style: variant.style,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/utils/data-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export const resolveSlateContent = async (
imagePromises.push(loadImage(child as unknown as ImageElement, path, opts))
}
if (Element.isElement(child)) {
walkChildren(child.children as SlateDescendant[], [...path, i])
walkChildren(child.children, [...path, i])
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/utils/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ export function getImagePixels(imageData: ArrayBuffer) {
const format = detectImageFormat(imageData)
switch (format) {
case "png":
return getPNGPixels(imageData)
return getPNGPixels(imageData).catch(() => getJPEGPixels(imageData).catch(() => null))
case "jpg":
case "jpeg":
return getJPEGPixels(imageData)
return getJPEGPixels(imageData).catch(() => getPNGPixels(imageData).catch(() => null))
// case "svg":
// return getSVGPixels(imageData)
default:
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"type": "git",
"url": "https://github.com/Etherna/etherna-website"
},
"packageManager": "[email protected]",
"scripts": {
"build": "turbo run build",
"build:cms": "turbo run build:cms",
Expand Down
2 changes: 1 addition & 1 deletion packages/astro-plugin-dynamic-base/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import baseHead from "./dynamic-base-head.html"

import type { AstroIntegration } from "astro"

export default function files(): AstroIntegration {
export default function dynamicBase(): AstroIntegration {
return {
name: "astro-plugin-dynamic-base",
hooks: {
Expand Down
Loading

0 comments on commit d04451f

Please sign in to comment.