Skip to content

Commit a97f038

Browse files
authored
Merge pull request #12 from Igorcbraz/New-Design
New design
2 parents 86199d6 + dfda268 commit a97f038

27 files changed

+730
-402
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
REACT_APP_GA_TRACKING_ID=

.eslintrc.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
"react/react-in-jsx-scope": "off",
2121
"quotes": ["error", "single"],
2222
"jsx-quotes": ["error", "prefer-single"],
23-
"indent": ["error", 2]
23+
"indent": ["error", 2],
24+
"semi": ["error", "never"]
25+
},
26+
"globals": {
27+
"process": true,
28+
"module": true
2429
}
2530
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
# production
1212
/build
13+
.env
1314

1415
# misc
1516
.DS_Store

netlify.toml

Lines changed: 0 additions & 4 deletions
This file was deleted.

package-lock.json

Lines changed: 120 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,22 @@
88
"@testing-library/jest-dom": "^5.16.5",
99
"@testing-library/react": "^13.4.0",
1010
"@testing-library/user-event": "^13.5.0",
11+
"@vercel/speed-insights": "^1.1.0",
1112
"react": "^18.2.0",
1213
"react-dom": "^18.2.0",
14+
"react-ga4": "^2.1.0",
15+
"react-lazy-load-image-component": "^1.6.3",
1316
"react-router-dom": "^6.6.1",
1417
"react-scripts": "5.0.1",
18+
"react-waypoint": "^10.3.0",
1519
"web-vitals": "^2.1.4"
1620
},
1721
"scripts": {
1822
"start": "react-scripts start",
1923
"build": "react-scripts build",
2024
"test": "react-scripts test",
21-
"eject": "react-scripts eject"
25+
"eject": "react-scripts eject",
26+
"lint": "eslint . --ext .js,.jsx --fix"
2227
},
2328
"eslintConfig": {
2429
"extends": [

src/App.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
import { Routes, Route } from 'react-router-dom'
2+
import { SpeedInsights } from '@vercel/speed-insights/react'
3+
4+
import { MapProvider } from './context/MapContext'
5+
import { usePageViewTracker } from './hooks/usePageViewTracker'
26

37
import { Home } from './pages/Home'
48

59
function App() {
10+
usePageViewTracker()
11+
612
return (
7-
<div className='App'>
13+
<MapProvider>
814
<Routes>
915
<Route path='/' element={ <Home/> } />
1016
</Routes>
11-
</div>
12-
);
17+
<SpeedInsights/>
18+
</MapProvider>
19+
)
1320
}
1421

15-
export default App;
22+
export default App

src/assets/images/carrousel2.jpg

557 KB
Loading

src/assets/images/monge.png

-141 KB
Binary file not shown.

src/components/AddressMap/index.jsx

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
1-
import PropTypes from 'prop-types';
1+
import PropTypes from 'prop-types'
2+
import { useEffect } from 'react'
3+
import { useMap } from '../../context/MapContext'
24

35
export const AddressMap = ({ className = 'w-full h-full' }) => {
4-
return (
5-
<iframe
6-
src='https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3652.0478203500575!2d-46.86826018509086!3d-23.745674074309456!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x94cfb27e5a744885%3A0x333b13f0aa6db8b5!2sTemplo%20Enkoji!5e0!3m2!1spt-BR!2sbr!4v1672166189508!5m2!1spt-BR!2sbr'
7-
className={className}
8-
style={{ border:0 }}
9-
allowFullScreen=''
10-
loading='lazy'
11-
referrerPolicy='no-referrer-when-downgrade'
12-
/>
13-
)
6+
const { mapIframe, setMapIframe } = useMap()
7+
8+
useEffect(() => {
9+
if (!mapIframe) {
10+
const iframe = (
11+
<iframe
12+
src='https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3652.0478203500575!2d-46.86826018509086!3d-23.745674074309456!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x94cfb27e5a744885%3A0x333b13f0aa6db8b5!2sTemplo%20Enkoji!5e0!3m2!1spt-BR!2sbr!4v1672166189508!5m2!1spt-BR!2sbr'
13+
className={className}
14+
style={{ border: 0 }}
15+
allowFullScreen=''
16+
loading='lazy'
17+
referrerPolicy='no-referrer-when-downgrade'
18+
/>
19+
)
20+
setMapIframe(iframe)
21+
}
22+
}, [mapIframe, setMapIframe, className])
23+
24+
return mapIframe
1425
}
1526

1627
AddressMap.propTypes = {

src/components/Animation/index.jsx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { useState } from 'react'
2+
import PropTypes from 'prop-types'
3+
4+
import { Waypoint } from 'react-waypoint'
5+
import { useSpring, animated } from '@react-spring/web'
6+
7+
import { animationOptions } from '../../constants/animationOptions'
8+
9+
export const Animation = ({
10+
children,
11+
type,
12+
delay,
13+
containerClass,
14+
id,
15+
}) => {
16+
const [inView, setInview] = useState(false)
17+
const { to, from, ...animation } = animationOptions[type]
18+
19+
const animationStyle = useSpring({
20+
to: inView ? to : from,
21+
delay: delay || animation.delay,
22+
...animation
23+
})
24+
25+
return (
26+
<Waypoint
27+
onEnter={() => setInview(true)}
28+
onLeave={() => setInview(false)}
29+
>
30+
<animated.div style={animationStyle} className={containerClass} id={id}>
31+
{children}
32+
</animated.div>
33+
</Waypoint>
34+
)
35+
}
36+
37+
Animation.propTypes = {
38+
children: PropTypes.node.isRequired,
39+
type: PropTypes.string.isRequired,
40+
delay: PropTypes.number,
41+
containerClass: PropTypes.string,
42+
id: PropTypes.string
43+
}

src/components/Badge/index.jsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import PropTypes from 'prop-types'
2+
3+
export const Badge = ({
4+
children
5+
}) => {
6+
return (
7+
<span
8+
className='inline-block mb-3 sm:mb-0 shadow-sm shadow-primary-500 px-5 py-2 rounded-full text-xs md:text-sm font-body text-white transition border-primary-300 border-[1px] bg-primary-400 capitalize'
9+
>
10+
{children}
11+
</span>
12+
)
13+
}
14+
15+
Badge.propTypes = {
16+
children: PropTypes.node
17+
}

0 commit comments

Comments
 (0)