Skip to content

Commit

Permalink
fix usermenu path & breadcrumb (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucanis authored Oct 11, 2024
1 parent a06b39c commit d73fbff
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 20 deletions.
4 changes: 2 additions & 2 deletions components/Layout/CrossSelling/CrossSelling.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

{% set button = button|default(null) %}



{% if this.products is not empty %}
<div class="pt-[56px] pb-[68px] pl-[24px] md:pl-[48px] xl:pt-[68px] xl:pb-[104px] lg:px-0 lg:container lg:mx-auto">
<div class='pb-6 text-black h2'>{{ title }}</div>
<div class='CrossSelling slider'>
Expand All @@ -17,3 +16,4 @@
</div>
{% endif %}
</div>
{% endif %}
14 changes: 12 additions & 2 deletions components/Molecules/Breadcrumb/Breadcrumb.html.twig
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
{% set classes = classes|default('') %}
{% set items = items|default([]) %}
{% set backIcon = backIcon|default(false) %}


{% if items is not empty %}
<nav class="Breadcrumb{{ classes }}" aria-label="Fil d'Ariane">
<ol class="Breadcrumb-list" itemscope itemtype="https://schema.org/BreadcrumbList">
{% if items.length > 3 %}
{% if backIcon %}
<li class="Breadcrumb-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<span class="w-5 h-5">{{ ux_icon('chevron-left') }}</span>
</li>
{% endif %}

{% if items|length > 3 %}
<li id="Breadcrumb-compressed" class="Breadcrumb-item Breadcrumb-item--isLink">
<button class="Breadcrumb-item-link Breadcrumb-compressed">...</button>
</li>
{% endif %}

{% for item in items %}
<li class="Breadcrumb-item{% if item.href %} Breadcrumb-item--isLink{% endif %}{% if loop.index <= (items.length - 3) %} hide{% endif %}" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<li class="Breadcrumb-item{% if item.href %} Breadcrumb-item--isLink{% endif %}{% if loop.index <= (items|length - 3) %} hide{% endif %}" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
{% if item.href %}
<a class="Breadcrumb-item-link" href="{{ item.href }}" itemprop="item">
<span itemprop="name">{{ item.label }}</span>
Expand All @@ -26,3 +35,4 @@
{% endfor %}
</ol>
</nav>
{% endif %}
15 changes: 13 additions & 2 deletions components/Molecules/Breadcrumb/Breadcrumb.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ export default {
export const Base = {
render: (args) => Breadcrumb(args),
args: {
backIcon: false,
items: [
{ label: 'Page parante', href: '#' },
{ label: 'Page parente', href: '#' },
{ label: 'Page mère', href: '#' },
{ label: 'Page actuelle' }
]
},
argTypes: {
backIcon: {
control: { type: 'boolean' }
}
}
};

Expand All @@ -25,9 +31,14 @@ export const Lengthy = {
items: [
{ label: 'Non visible', href: '#' },
{ label: 'Non visible', href: '#' },
{ label: 'Page parante', href: '#' },
{ label: 'Page parente', href: '#' },
{ label: 'Page mère', href: '#' },
{ label: 'Page actuelle' }
]
},
argTypes: {
backIcon: {
control: { type: 'boolean' }
}
}
};
8 changes: 4 additions & 4 deletions components/Molecules/Breadcrumb/breadcrumb.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
display: flex;
gap: rem-convert(8px);

&--isLink {
&::after {
&--isLink + .Breadcrumb-item--isLink {
&::before {
content: '/';
font-size: rem-convert(10px);
}
Expand All @@ -27,7 +27,7 @@
color: var(--grey);
}

&:focus-visible{
&:focus-visible {
background-color: var(--theme-light);
}
}
Expand All @@ -43,7 +43,7 @@
text-decoration: none;
margin-top: rem-convert(2px);

&:focus-visible{
&:focus-visible {
background-color: var(--grey-lightest);
border: solid 1px var(--theme-medium);
}
Expand Down
File renamed without changes.
24 changes: 14 additions & 10 deletions product.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@
{% set product = resources('/api/front/products/' ~ productId) %}
{% set productCategory = product.productCategories|filter(c => c.defaultCategory)|first.category %}

{% dump(product) %}
{% block body %}
<div class="px-6 lg:px-[120px] py-6">
<div class="lg:justify-between lg:items-center mb-[29px] lg:flex">
<a href="#" class="flex gap-3 typo-button-medium">
{{ ux_icon('chevron-left', {class: 'w-5 h-5'}) }} {{ productCategory.i18ns.title }}
</a>
</div>

<div class="px-6 lg:px-[120px] py-6">
<div class="lg:justify-between lg:items-center mb-[29px] lg:flex">
{{ component('Molecules:Breadcrumb:Breadcrumb', {
items: [
{ href: productCategory.publicUrl|default('#'), label:productCategory.i18ns.title},
],
backIcon: true
}) }}

</div>

<div class="lg:container lg:w-full md:w-[540px] sm:w-[340px] w-full mx-auto">
<div class="lg:flex lg:justify-between gap-[46px]">
Expand Down Expand Up @@ -112,7 +116,7 @@
</div>
</div>

<div class="bg-theme-lighter">
{{ component('Flexy:CrossSelling', {categoryId: 1, title: 'Last seen products' | trans}) }}
</div>
<div class="bg-theme-lighter">
{{ component('Flexy:CrossSelling', {categoryId: productCategory.id, title: 'Last seen products' | trans}) }}
</div>
{% endblock %}

0 comments on commit d73fbff

Please sign in to comment.