Skip to content

Commit

Permalink
removido intercom e add crisp
Browse files Browse the repository at this point in the history
  • Loading branch information
01lexandre committed Jul 8, 2022
1 parent c481d7a commit cc69667
Show file tree
Hide file tree
Showing 11 changed files with 247 additions and 36 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"next-seo": "^5.4.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-icons": "^4.4.0",
"react-input-mask": "^2.0.4",
"react-lottie": "^1.2.3",
"react-select": "^5.3.2",
Expand Down
40 changes: 36 additions & 4 deletions public/sitemap-0.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url><loc>http://www.naweby.com.br</loc><lastmod>2022-06-09T18:56:22.580Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/cadastre-se-gratis</loc><lastmod>2022-06-09T18:56:22.580Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/termos-de-uso</loc><lastmod>2022-06-09T18:56:22.580Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/tudo-pronto</loc><lastmod>2022-06-09T18:56:22.580Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br</loc><lastmod>2022-07-01T22:31:49.944Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas</loc><lastmod>2022-07-01T22:31:49.944Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/cadastre-se-gratis</loc><lastmod>2022-07-01T22:31:49.944Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/termos-de-uso</loc><lastmod>2022-07-01T22:31:49.944Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/tudo-pronto</loc><lastmod>2022-07-01T22:31:49.944Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/1</loc><lastmod>2022-07-01T22:31:49.944Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/2</loc><lastmod>2022-07-01T22:31:49.944Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/3</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/4</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/5</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/6</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/7</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/8</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/9</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/10</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/11</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/12</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/13</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/14</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/15</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/16</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/17</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/18</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/19</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/20</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/21</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/22</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/23</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/24</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/25</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/26</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/27</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/28</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/29</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/30</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>http://www.naweby.com.br/buscar-pecas/fabricantes/31</loc><lastmod>2022-07-01T22:31:49.945Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
</urlset>
36 changes: 36 additions & 0 deletions src/Components/Header/DrawerExample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React from 'react';
import { Drawer, DrawerBody, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerContent,
DrawerCloseButton, Flex, Text
} from "@chakra-ui/react";
export default function DrawerExample({
p = 15,
placement = "right",
width,
isOpen,
children,
onClose,
btnRef,
title = "Menu",
footer,
}) {
return (
<Flex w={width}>
<Drawer
isOpen={isOpen}
placement={placement}
onClose={onClose}
finalFocusRef={btnRef}
>
<DrawerOverlay />
<DrawerContent alignItems="center">
<DrawerCloseButton alignSelf="end" mx={p} my={p} />
<DrawerHeader my={p}>
<Text as="p"> {title} </Text>
</DrawerHeader>
<DrawerBody>{children}</DrawerBody>
<DrawerFooter>{footer}</DrawerFooter>
</DrawerContent>
</Drawer>
</Flex>
);
}
51 changes: 51 additions & 0 deletions src/Components/Header/HeaderNav.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import {Image, Flex, Button, HStack, chakra, Box, useColorModeValue} from '@chakra-ui/react';
import data from './menu.data';
import React from "react";
import MobileDrawer from "./MobileDrawer";
import NextLink from "next/link";
import logoPrincipal from "../../assets/logo-princ.png";
import styles from "../../styles/css.module.scss";
const CTA = "Get Started"
export default function HeaderNav() {
return (
<chakra.div id="header" width={'100%'} bg={useColorModeValue('#F6F5FA', 'gray.900')}>
<Flex
w="100%"
px="6"
py="5"
align="center"
justify="space-between"
>
<Image
width={225}
height={'60px'}
src={logoPrincipal}
alt='Logo Naweby'
/>

<HStack as="nav" spacing="5" display={{ base: "none", md: "flex" }}>
{data().map((item, i) => (
<NextLink key={i} href={item.link} passHref>
<Button variant="nav"> {item.label} </Button>
</NextLink>
))}
</HStack>
<HStack>
<Box className={styles.navButton} display={{ base: "none", md: "flex" }}>
<NextLink href="https://web.naweby.com.br/" passHref>
<Button id={'bt_entrarNavTop'} variant='ghost' mr={5}>
Entrar
</Button>
</NextLink>
<NextLink href="https://www.naweby.com.br/cadastre-se-gratis" passHref>
<Button id={'bt_RegisterNavTop'} colorScheme='primary' variant='outline'>
Cadastre-se Grátis
</Button>
</NextLink>
</Box>
<MobileDrawer />
</HStack>
</Flex>
</chakra.div>
);
}
42 changes: 42 additions & 0 deletions src/Components/Header/MobileDrawer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { useDisclosure, Flex, Box, Button, VStack, Icon, HStack, Link as ChakraLink } from "@chakra-ui/react";
import DrawerExample from './DrawerExample';
import { IoMdMenu } from 'react-icons/io';
import data from './menu.data';
import React from "react";
import NextLink from "next/link";
import styles from "../../styles/css.module.scss";
export default function MobileDrawer() {
const { isOpen, onOpen, onClose } = useDisclosure();
const btnRef = React.useRef();
return (
<Flex display={{ base: "flex", md: "none" }}>
<Button ref={btnRef} onClick={onOpen}>
<IoMdMenu size="26px" />
</Button>

<DrawerExample
isOpen={isOpen}
onClose={onClose}
finalFocusRef={btnRef}
>
<VStack alignItems="left">
{data().map((item, i) => (
<NextLink key={i} href={item.link} passHref>
<Button variant='text' > {item.label} </Button>
</NextLink>
))}
<NextLink href="https://web.naweby.com.br/" passHref>
<Button id={'bt_entrarNavTop'} variant='ghost' mr={5}>
Entrar
</Button>
</NextLink>
<NextLink href="https://www.naweby.com.br/cadastre-se-gratis" passHref>
<Button id={'bt_RegisterNavTop'} colorScheme='primary' variant='outline'>
Cadastre-se Grátis
</Button>
</NextLink>
</VStack>
</DrawerExample>
</Flex>
);
};
16 changes: 16 additions & 0 deletions src/Components/Header/menu.data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default function data() {
return [
{
label: 'Home',
link: '/'
},
{
label: 'Funcionalidades',
link: '#funcionalidades'
},
{
label: 'Blog',
link: 'https://blog.naweby.com.br'
},
]
}
43 changes: 13 additions & 30 deletions src/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const theme = extendTheme(themeShema)
import { DefaultSeo } from 'next-seo';
import SEO from '../../next-seo.config';
import {useRouter} from "next/router";
import HeaderNav from "../Components/Header/HeaderNav";

// The handler to smoothly scroll the element into view
const handExitComplete = () => {
Expand Down Expand Up @@ -56,38 +57,20 @@ function MyApp({ Component, pageProps }) {
}
}}
/>
{/*<Script*/}
{/* id="crisp-widget"*/}
{/* strategy="afterInteractive"*/}
{/* dangerouslySetInnerHTML={{*/}
{/* __html: `*/}
{/* window.$crisp=[];*/}
{/* window.CRISP_WEBSITE_ID="b7324b94-13ef-446f-8896-4793887ea35f";*/}
{/* (function(){*/}
{/* const d = document;*/}
{/* const s = d.createElement("script");*/}
{/* s.src = "https://client.crisp.chat/l.js";*/}
{/* s.async = 1;*/}
{/* d.getElementsByTagName("head")[0].appendChild(s);*/}
{/* })();`,*/}
{/* }}*/}
{/*/>*/}
{/*intercom*/}
<Script
dangerouslySetInnerHTML={{
__html: `
window.intercomSettings = {
api_base: "https://api-iam.intercom.io",
app_id: "sk61703x"
};
`,
}}
/>
<Script
id="crisp-widget"
strategy="afterInteractive"
dangerouslySetInnerHTML={{
__html: `
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/sk61703x';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
`,
window.$crisp=[];
window.CRISP_WEBSITE_ID="b7324b94-13ef-446f-8896-4793887ea35f";
(function(){
const d = document;
const s = d.createElement("script");
s.src = "https://client.crisp.chat/l.js";
s.async = 1;
d.getElementsByTagName("head")[0].appendChild(s);
})();`,
}}
/>
<Script
Expand All @@ -111,7 +94,7 @@ function MyApp({ Component, pageProps }) {
</>
) : (
<>
<NavBar />
<HeaderNav/>
<Component {...pageProps}/>
<Footer />
</>
Expand Down
39 changes: 39 additions & 0 deletions src/pages/buscar-pecas/fabricantes/[slug].js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

export default function Fabricante({ posts }) {
return (
<div>
{typeof posts}
{JSON.stringify(posts)}
</div>
)
}

export async function getStaticProps({ params = {} } = {}) {
console.log(params, params?.slug)
const res = await fetch('https://62bf404c0bc9b125616a7feb.mockapi.io/v1/fabricantes/'+params?.slug)
const posts = await res.json()

return {
props: {
posts
},
revalidate: 10,
};
}
//
export async function getStaticPaths() {
const res = await fetch('https://62bf404c0bc9b125616a7feb.mockapi.io/v1/fabricantes')
const posts = await res.json()

const paths = posts.filter(({ slug }) => typeof slug === 'string')
.map(({ slug }) => ({
params: {
slug,
},
}));

return {
paths,
fallback: false,
};
}
6 changes: 6 additions & 0 deletions src/pages/buscar-pecas/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// https://mockapi.io/projects/62bf404c0bc9b125616a7fec
export default function BuscarPecas() {
return (
<h1>Buscar Peças</h1>
)
}
4 changes: 2 additions & 2 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default function Home() {
name={process.env.APP_NAME}
logo="https://www.example.com/photos/logo.jpg"
/>
<main>
<Box as={'main'}>
<Box as={'header'} className={styles.header} bg={useColorModeValue('#F6F5FA', 'gray.900')}>
<Box as={'section'} pt={'5rem'} textAlign={'center'}>
<Container maxW='container.sm' textAlign={'center'}>
Expand Down Expand Up @@ -170,7 +170,7 @@ export default function Home() {
</Box>
</Container>
</Box>
</main>
</Box>
</>
)
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2823,6 +2823,11 @@ [email protected]:
use-callback-ref "^1.2.5"
use-sidecar "^1.0.5"

react-icons@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.4.0.tgz#a13a8a20c254854e1ec9aecef28a95cdf24ef703"
integrity sha512-fSbvHeVYo/B5/L4VhB7sBA1i2tS8MkT0Hb9t2H1AVPkwGfVHLJCqyr2Py9dKMxsyM63Eng1GkdZfbWj+Fmv8Rg==

react-input-mask@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/react-input-mask/-/react-input-mask-2.0.4.tgz#9ade5cf8196f4a856dbf010820fe75a795f3eb14"
Expand Down

0 comments on commit cc69667

Please sign in to comment.