Skip to content

Commit

Permalink
Merge pull request #10 from deco-sites/feature/28745/faq
Browse files Browse the repository at this point in the history
Feature/28745/faq
  • Loading branch information
gsbenevides2 authored Dec 13, 2024
2 parents 53095b7 + fc4eab0 commit 7b49f07
Show file tree
Hide file tree
Showing 12 changed files with 443 additions and 297 deletions.
135 changes: 135 additions & 0 deletions .deco/blocks/pages-D%25C3%25BAvidas%2520fequentes-845579.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"name": "Dúvidas fequentes",
"path": "/duvidas-frequentes",
"sections": [
{
"__resolveType": "website/sections/Rendering/Lazy.tsx",
"section": {
"__resolveType": "Header"
}
},
{
"__resolveType": "site/sections/BreadcrumbInstitucional/Breadcrumb.tsx",
"root": "HOME",
"showText": true,
"path": "Ajuda",
"route": "Dúvidas frequentes"
},
{
"__resolveType": "site/sections/DuvidasFrequentes/DuvidasFrequentes.tsx",
"Menu": {
"__resolveType": "site/sections/MenuInstitucional/MenuInstitucional.tsx",
"institutionalLinks": [
{
"label": "Políticas de privacidade",
"route": "/politicas-de-privacidade"
},
{
"label": "Troca e devolução",
"route": "/troca-e-devolucao"
},
{
"label": "Termos e condições",
"route": "/termos-e-condicoes"
},
{
"label": "Formas de pagamento",
"route": "/formas-de-pagamento"
},
{
"route": "/formas-de-entrega",
"label": "Formas de entrega"
}
],
"supportLinks": [
{
"label": "Fale conosco",
"route": "/fale-conosco"
},
{
"route": "/duvidas-frequentes",
"label": "Dúvidas frequentes"
}
],
"links": [
{
"route": "/politicas-de-privacidade",
"label": "Políticas de privacidade"
},
{
"route": "/troca-e-devolucao",
"label": "Troca e devolução"
},
{
"route": "/termos-e-condicoes",
"label": "Termos e condições"
},
{
"route": "/formas-de-pagamento",
"label": "Formas de pagamento"
},
{
"route": "/formas-de-entrega",
"label": "Formas de entrega"
},
{
"route": "/fale-conosco",
"label": "Fale conosco"
},
{
"route": "/duvidas-frequentes",
"label": "Dúvidas frequentes"
}
],
"institutionalTitle": "Ajuda",
"supportTitle": "Fale conosco"
},
"Question": {
"__resolveType": "site/sections/Content/FAQ.tsx",
"title": "Dúvidas frequentes",
"description": "<p><span>Ainda está com dúvida? Nos mande um e-mail e logo entraremos em contato com você o mais rápido possível. </span><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"/central-atendimento\"><span>Fale conosco!</span></a></p>",
"enableJSONLD": true,
"questions": [
{
"title": "Pedido veio com embalagem aberta, posso trocar?",
"description": "<p>Lorem ipsum dolor sit amet consectetur. Nulla ultrices tortor id quis sit varius risus. Ut commodo urna rhoncus nisl. Enim eget lobortis elit at sed viverra. Et integer augue mauris duis massa dignissim tortor. Lorem ipsum dolor sit amet consectetur. Nulla ultrices tortor id quis sit varius risus. Ut commodo urna rhoncus nisl. Enim eget lobortis elit at sed viverra. Et integer augue mauris duis massa dignissim tortor.</p>"
},
{
"title": "Quais os métodos de pagamento?",
"description": "<p>Lorem ipsum dolor sit amet consectetur. Nulla ultrices tortor id quis sit varius risus. Ut commodo urna rhoncus nisl. Enim eget lobortis elit at sed viverra. Et integer augue mauris duis massa dignissim tortor. Lorem ipsum dolor sit amet consectetur. Nulla ultrices tortor id quis sit varius risus. Ut commodo urna rhoncus nisl. Enim eget lobortis elit at sed viverra. Et integer augue mauris duis massa dignissim tortor.</p>"
},
{
"title": "Comprei o produto errado, posso realizar a troca?",
"description": "<p>Lorem ipsum dolor sit amet consectetur. Nulla ultrices tortor id quis sit varius risus. Ut commodo urna rhoncus nisl. Enim eget lobortis elit at sed viverra. Et integer augue mauris duis massa dignissim tortor. Lorem ipsum dolor sit amet consectetur. Nulla ultrices tortor id quis sit varius risus. Ut commodo urna rhoncus nisl. Enim eget lobortis elit at sed viverra. Et integer augue mauris duis massa dignissim tortor.</p>"
},
{
"title": "Comprar com o combo saí mais barato?",
"description": "<p>Lorem ipsum dolor sit amet consectetur. Nulla ultrices tortor id quis sit varius risus. Ut commodo urna rhoncus nisl. Enim eget lobortis elit at sed viverra. Et integer augue mauris duis massa dignissim tortor. Lorem ipsum dolor sit amet consectetur. Nulla ultrices tortor id quis sit varius risus. Ut commodo urna rhoncus nisl. Enim eget lobortis elit at sed viverra. Et integer augue mauris duis massa dignissim tortor.</p>"
},
{
"title": "Ganho descontos se comprar mais de um?",
"description": "<p>Lorem ipsum dolor sit amet consectetur. Nulla ultrices tortor id quis sit varius risus. Ut commodo urna rhoncus nisl. Enim eget lobortis elit at sed viverra. Et integer augue mauris duis massa dignissim tortor. Lorem ipsum dolor sit amet consectetur. Nulla ultrices tortor id quis sit varius risus. Ut commodo urna rhoncus nisl. Enim eget lobortis elit at sed viverra. Et integer augue mauris duis massa dignissim tortor.</p>"
},
{
"title": "Como utilizo meu código promocional?",
"description": "<p>Lorem ipsum dolor sit amet consectetur. Nulla ultrices tortor id quis sit varius risus. Ut commodo urna rhoncus nisl. Enim eget lobortis elit at sed viverra. Et integer augue mauris duis massa dignissim tortor. Lorem ipsum dolor sit amet consectetur. Nulla ultrices tortor id quis sit varius risus. Ut commodo urna rhoncus nisl. Enim eget lobortis elit at sed viverra. Et integer augue mauris duis massa dignissim tortor.</p>"
},
{
"title": "Posso tomar todos os dias?",
"description": "<p>Lorem ipsum dolor sit amet consectetur. Nulla ultrices tortor id quis sit varius risus. Ut commodo urna rhoncus nisl. Enim eget lobortis elit at sed viverra. Et integer augue mauris duis massa dignissim tortor. Lorem ipsum dolor sit amet consectetur. Nulla ultrices tortor id quis sit varius risus. Ut commodo urna rhoncus nisl. Enim eget lobortis elit at sed viverra. Et integer augue mauris duis massa dignissim tortor.</p>"
}
]
}
},
{
"__resolveType": "website/sections/Rendering/Lazy.tsx",
"section": {
"__resolveType": "Footer"
}
}
],
"seo": {
"__resolveType": "website/sections/Seo/SeoV2.tsx"
},
"__resolveType": "website/pages/Page.tsx"
}
3 changes: 0 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,5 @@
},
"files.associations": {
"*.svg": "html"
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
}
}
4 changes: 2 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"@deco/deco": "jsr:@deco/[email protected]",
"simple-git": "npm:simple-git@^3.25.0",
"std/": "https://deno.land/[email protected]/",
"deco/": "https://cdn.jsdelivr.net/gh/deco-cx/[email protected].2/",
"apps/": "https://cdn.jsdelivr.net/gh/deco-cx/[email protected].4/",
"deco/": "https://cdn.jsdelivr.net/gh/deco-cx/[email protected].1/",
"apps/": "https://cdn.jsdelivr.net/gh/deco-cx/[email protected].2/",
"@preact/signals": "https://esm.sh/*@preact/[email protected]",
"@preact/signals-core": "https://esm.sh/*@preact/[email protected]",
"daisyui": "npm:[email protected]",
Expand Down
87 changes: 44 additions & 43 deletions islands/MenuInstitutionalMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,56 @@ import { useState } from "preact/hooks";
import Icon from "site/components/ui/Icon.tsx";

interface MenuProps {
links: LinkProps[];
label: string;
links: LinkProps[];
label: string;
}

interface LinkProps {
/**@title Rota */
route: string;
/**@title Rota */
label: string;
/**@title Rota */
route: string;
/**@title Rota */
label: string;
}

export default function MenuInstitutionalMobile({ links, label }: MenuProps) {
const [navigation, setNavigation] = useState(false);
const [navigation, setNavigation] = useState(false);

return (
<div class="hidden z-10 mobile:flex flex-col bg-[#FFFFFF] rounded-[5px]">
<button
class="hidden text-left mobile:flex container justify-between items-center h-[44px] py-[13px] font-bold text-[12px] leading-[18px] text-[#676767] rounded-[4px] border border-[#F7E0BF]"
onClick={() => setNavigation(!navigation)}
>
{label}{" "}
<Icon
id="chevron-right-institutional"
width="16"
height="16"
style={{
transform: navigation
? "rotate(90deg)"
: "rotate(0deg)",
transition: "transform 0.3s",
}}
class="text-[#D6DE23]"
/>
</button>
{navigation && (
<div className="flex flex-col absolute mt-[44px] items-center justify-start text-left w-[100%] bg-[#FFFFFF] py-0 px-[10px] rounded-b-[5px] border-b border-r border-l border-[#F7E0BF]">
{links &&
links.map((link, index) => (
<a
className={`text-left text-[12px] text-[#676767] font-medium w-full h-[44px] ${index === 0 ? "first:mt-[10px]" : ""
}`}
key={index}
href={link.route}
>
{link.label}
</a>
))}
return (
<div class="hidden z-10 mobile:flex flex-col bg-[#FFFFFF] rounded-[5px]">
<button
class="hidden text-left mobile:flex container justify-between items-center h-[44px] py-[13px] font-bold text-[12px] leading-[18px] text-[#676767] rounded-[4px] border border-[#F7E0BF]"
onClick={() => setNavigation(!navigation)}
>
{label}{" "}
<Icon
id="chevron-right-institutional"
width="16"
height="16"
style={{
transform: navigation
? "rotate(90deg)"
: "rotate(0deg)",
transition: "transform 0.3s",
}}
class="text-[#D6DE23]"
/>
</button>
{navigation && (
<div className="flex flex-col absolute mt-[44px] items-center justify-start text-left w-[100%] bg-[#FFFFFF] py-0 px-[10px] rounded-b-[5px] border-b border-r border-l border-[#F7E0BF]">
{links &&
links.map((link, index) => (
<a
className={`text-left text-[12px] text-[#676767] font-medium w-full h-[44px] ${
index === 0 ? "first:mt-[10px]" : ""
}`}
key={index}
href={link.route}
>
{link.label}
</a>
))}
</div>
)}
</div>
)}
</div>
);
);
}
46 changes: 23 additions & 23 deletions islands/ScrollButton.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import { useEffect, useState } from "preact/hooks";
import { useState, useEffect } from "preact/hooks";
import Icon from "site/components/ui/Icon.tsx";

export default function ScrollButton() {
const [isVisible, setisVisible] = useState(false)
const [isVisible, setisVisible] = useState(false)

useEffect(() => {
const activateButton = () => {
if (window.scrollY > 375) {
setisVisible(true)
} else {
setisVisible(false)
}
}
useEffect(() => {
const activateButton = () => {
if(window.scrollY > 375){
setisVisible(true)
} else {
setisVisible(false)
}
}

self.addEventListener('scroll', activateButton)
return () => removeEventListener('scroll', activateButton)
}, [])
self.addEventListener('scroll', activateButton)
return () => removeEventListener('scroll', activateButton)
}, [])

const scroll = () => {
window.scrollTo({ top: 0, behavior: 'smooth' })
}
const scroll = () => {
window.scrollTo({top: 0, behavior: 'smooth'})
}

return (
<div>
{isVisible &&
<button class="fixed z-10 top-[80%] right-[40px] w-[40px] h-[40px] rounded-[50%] bg-[#D6DE23] border-0 p-[8px]" onClick={scroll}><Icon id="chevron-up" /></button>
}
</div>
)
return(
<div>
{isVisible &&
<button class="fixed z-10 top-[80%] right-[40px] w-[40px] h-[40px] rounded-[50%] bg-[#D6DE23] border-0 p-[8px]" onClick={scroll}><Icon id="chevron-up"/></button>
}
</div>
)
}
Loading

0 comments on commit 7b49f07

Please sign in to comment.