Skip to content

Commit

Permalink
feat: wip multi-language (#3)
Browse files Browse the repository at this point in the history
* feat: wip multi-language

* recreating lost files

* fix: request

* improve home

---------

Co-authored-by: guitavano <[email protected]>
  • Loading branch information
marcoferreiradev and guitavano authored Nov 6, 2024
1 parent c2b3fad commit c89a172
Show file tree
Hide file tree
Showing 39 changed files with 1,396 additions and 572 deletions.
23 changes: 23 additions & 0 deletions .deco/blocks/Global%20Language%20Options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"__resolveType": "site/loaders/languages.ts",
"langs": [
{
"label": "EN",
"value": "en",
"flag": "https://deco-sites-assets.s3.sa-east-1.amazonaws.com/journeys/f5044d94-348f-4a63-aa15-76949855d78d/us-flag.webp",
"alt": "United States"
},
{
"alt": "Canada",
"flag": "https://deco-sites-assets.s3.sa-east-1.amazonaws.com/journeys/d83429c1-3a7a-4751-8056-e26c7f33bd0a/ca-flag.webp",
"value": "en-ca",
"label": "EN"
},
{
"label": "FR",
"value": "fr-ca",
"flag": "https://deco-sites-assets.s3.sa-east-1.amazonaws.com/journeys/d83429c1-3a7a-4751-8056-e26c7f33bd0a/ca-flag.webp",
"alt": "Canada - French"
}
]
}
7 changes: 6 additions & 1 deletion .deco/blocks/Header.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,10 @@
"itemUrl": "/kidz"
}
],
"loading": "eager"
"loading": "eager",
"preheader": {
"langs": {
"__resolveType": "Global Language Options"
}
}
}
4 changes: 4 additions & 0 deletions .deco/blocks/Matcher%20%20-%20Canada%2FFrench.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"__resolveType": "site/matchers/language.ts",
"language": "fr-ca"
}
4 changes: 4 additions & 0 deletions .deco/blocks/Matcher%20-%20Canada.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"__resolveType": "site/matchers/language.ts",
"language": "en-ca"
}
257 changes: 247 additions & 10 deletions .deco/blocks/pages-home-c4bcbfb771e9.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,238 @@
"name": "Home Page",
"sections": [
{
"__resolveType": "website/sections/Rendering/Lazy.tsx",
"section": {
"__resolveType": "Header"
}
"__resolveType": "website/flags/multivariate/section.ts",
"variants": [
{
"value": {
"__resolveType": "Header"
},
"rule": {
"__resolveType": "Matcher - Canada"
}
},
{
"value": {
"__resolveType": "site/sections/Header/Header.tsx",
"searchbar": {
"placeholder": "What are you looking for?",
"loader": {
"__resolveType": "resolved",
"data": null
}
},
"alerts": [
"<p>Get 10% off today: <strong>NEW10</strong></p>"
],
"logo": {
"src": "https://deco-sites-assets.s3.sa-east-1.amazonaws.com/journeys/4da000a7-5db9-40c4-8766-2d9d0504d6ea/journeys-logo.webp",
"alt": "Deco Storefront",
"width": 160,
"height": 40
},
"navItems": [
{
"children": [
{
"image": [],
"children": [],
"name": "Hello"
},
{
"image": [],
"children": [],
"name": "World"
}
],
"@type": "SiteNavigationElement",
"subItems": [
{
"name": "ADIDAS",
"url": "",
"isBrand": true,
"subItemUrl": "/adidas"
},
{
"name": "CONVERSE",
"url": "",
"isBrand": true,
"subItemUrl": "/converse"
},
{
"name": "NEW BALANCE",
"url": "",
"isBrand": true,
"subItemUrl": "/new-balance"
},
{
"name": "BIRKENSTOCK",
"url": "/birkenstock",
"isBrand": true,
"subItemUrl": "/birkenstock"
},
{
"name": "VANS",
"url": "",
"isBrand": true,
"subItemUrl": "/vans"
},
{
"name": "CROCS",
"url": "",
"isBrand": true,
"subItemUrl": "/crocs"
}
],
"item": "Marques",
"itemUrl": "/"
},
{
"@type": "SiteNavigationElement",
"subItems": [
{
"name": "SHOP BY SHOE SIZE",
"url": "#"
},
{
"name": "SHOES",
"url": "#"
},
{
"name": "CLOTHING",
"url": "#"
},
{
"name": "ACCESSORIES",
"url": "#"
},
{
"name": "COLLECTIONS",
"url": "#"
}
],
"item": "Femmes"
},
{
"@type": "SiteNavigationElement",
"subItems": [
{
"name": "SHOP BY SHOE SIZE",
"url": "#"
},
{
"name": "SHOES",
"url": "#"
},
{
"name": "CLOTHING",
"url": "#"
},
{
"name": "ACCESSORIES",
"url": "#"
},
{
"name": "COLLECTIONS",
"url": "#"
}
],
"item": "Hommes"
},
{
"@type": "SiteNavigationElement",
"subItems": [],
"item": "Enfants",
"itemUrl": "/kidz"
},
{
"subItems": [],
"item": "Soled",
"itemUrl": "/"
},
{
"subItems": [],
"item": "Nouveautés",
"itemUrl": "/"
},
{
"subItems": [],
"item": "Cadeaux",
"itemUrl": "/"
}
],
"loading": "eager",
"preheader": {
"langs": {
"__resolveType": "Global Language Options"
}
}
},
"rule": {
"__resolveType": "Matcher - Canada/French"
}
},
{
"value": {
"__resolveType": "Header"
},
"rule": {
"__resolveType": "website/matchers/always.ts"
}
}
]
},
{
"__resolveType": "site/sections/Content/TextBar.tsx",
"text": "Get $10 off $75 + Free Shipping with Journeys All Access!",
"linkBar": "#",
"linkText": "Sign Up",
"linkUrl": "#"
"__resolveType": "website/flags/multivariate/section.ts",
"variants": [
{
"value": {
"__resolveType": "site/sections/Content/TextBar.tsx",
"text": "Get $10 off $75 + Free Shipping with",
"linkBar": "#",
"linkText": "Journeys All Access! Sign Up Now!",
"linkUrl": "#"
},
"rule": {
"__resolveType": "website/matchers/multi.ts",
"op": "or",
"matchers": [
{
"__resolveType": "Matcher - Canada"
}
]
}
},
{
"value": {
"__resolveType": "site/sections/Content/TextBar.tsx",
"text": "Obtiens 10$ de rabais sur 75$ d’achat et la livraison",
"linkBar": "#",
"linkText": "gratuite avec Journeys All Access! Inscris-toi!",
"linkUrl": "#"
},
"rule": {
"__resolveType": "website/matchers/multi.ts",
"op": "or",
"matchers": [
{
"__resolveType": "Matcher - Canada/French"
}
]
}
},
{
"value": {
"__resolveType": "site/sections/Content/TextBar.tsx",
"text": "Get $10 off $75 + Free Shipping with Journeys All Access!",
"linkBar": "#",
"linkText": "Sign Up",
"linkUrl": "#"
},
"rule": {
"__resolveType": "website/matchers/always.ts"
}
}
]
},
{
"__resolveType": "site/sections/Images/Carousel.tsx",
Expand Down Expand Up @@ -71,7 +292,23 @@
"__resolveType": "website/sections/Rendering/Lazy.tsx",
"section": {
"__resolveType": "site/sections/Product/ProductShelf.tsx",
"title": "Featured Products",
"title": {
"__resolveType": "website/flags/multivariate/message.ts",
"variants": [
{
"value": "Nouveautés",
"rule": {
"__resolveType": "Matcher - Canada/French"
}
},
{
"value": "New Arrivals",
"rule": {
"__resolveType": "website/matchers/always.ts"
}
}
]
},
"cta": "/mono",
"products": {
"__resolveType": "vtex/loaders/legacy/productList.ts",
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deco-deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Deploy
on:
push:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ _docker_deps.ts
.metadata/*
.deco/metadata/*

# Local env
.env

# Deno files
deno.*.tmp

# Tailwind file
static/tailwind.css
2 changes: 1 addition & 1 deletion apps/deco/vtex.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default } from "apps/vtex/mod.ts";
export * from "apps/vtex/mod.ts";
export * from "apps/vtex/mod.ts";
8 changes: 7 additions & 1 deletion components/Session.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,13 @@ export default function Session(
type="module"
dangerouslySetInnerHTML={{ __html: useScript(sdk) }}
/>
<script src="https://kit.fontawesome.com/b5e84d0a6b.js" crossorigin="anonymous"></script>
{
/* <script
src="https://kit.fontawesome.com/b5e84d0a6b.js"
crossorigin="anonymous"
>
</script> */
}
</Head>
<div hx-trigger="load" hx-post={useComponent(import.meta.url)} />
</>
Expand Down
6 changes: 5 additions & 1 deletion components/header/Bag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ function Bag() {
const id = useId();
return (
<>
<label class="indicator items-baseline" for={MINICART_DRAWER_ID} aria-label="open cart">
<label
class="indicator items-baseline"
for={MINICART_DRAWER_ID}
aria-label="open cart"
>
<span class="flex items-center justify-center size-6">
<Icon id="shopping-bag" size={17} />
</span>
Expand Down
Loading

0 comments on commit c89a172

Please sign in to comment.