Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base PR: Projects Redesign #2149

Merged
merged 365 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
365 commits
Select commit Hold shift + click to select a range
6ecd57e
feat: refactor, integrate site drop down component
sunilsabatp Aug 30, 2024
d0426f2
feat: render satellite layer for satellite view
sunilsabatp Sep 1, 2024
eeae6e6
fix: minor ui bugs of site drop down, render a toggle to switch betwe…
sunilsabatp Sep 2, 2024
a9c7a01
fix: use correct dependency for geojson feature collection
sunilsabatp Sep 2, 2024
cb7c3ed
feat: add site query
sunilsabatp Sep 3, 2024
d4d68c7
feat; add site id query
sunilsabatp Sep 3, 2024
1ffdf1a
refactor: remove unused import
sunilsabatp Sep 3, 2024
3a90306
refactor: merge base branch, resolve merge conflict
sunilsabatp Sep 3, 2024
39124a7
Merge branch 'projects-redesign/project-details' into projects-redesi…
sunilsabatp Sep 3, 2024
a161b16
refactor: update `hasMoreThanOneSite` logic to use `projectSites` for…
sunilsabatp Sep 3, 2024
3fae756
refactor: minor code clean up
sunilsabatp Sep 3, 2024
677c4e9
Merge branch 'develop' of https://github.com/Plant-for-the-Planet-org…
sunilsabatp Sep 4, 2024
8e460a9
Merge branch 'develop' into feature/projects-redesign
sunilsabatp Sep 4, 2024
eb8a6d3
Merge branch 'feature/projects-redesign' of https://github.com/Plant-…
sunilsabatp Sep 4, 2024
0d24297
Merge branch 'feature/projects-redesign' into projects-redesign/list-…
sunilsabatp Sep 4, 2024
fd2b629
refactor: merge base branch, resolve conflicts
sunilsabatp Sep 4, 2024
e82aab6
Merge branch 'projects-redesign/project-details' into projects-redesi…
sunilsabatp Sep 4, 2024
cc2b52b
refactor: minor refactor
sunilsabatp Sep 4, 2024
a297bb6
Merge pull request #2164 from Plant-for-the-Planet-org/projects-redes…
mariahosfeld Sep 4, 2024
ff4f53a
feat: implement helper function for zoom to plant location
sunilsabatp Sep 5, 2024
014e46a
address the ui issues
sunilsabatp Sep 8, 2024
dca0da8
feat: implements mobile UI for MapFeatureExplorer
mohitb35 Sep 9, 2024
9a535a2
refactor: resolve merge conflicts
sunilsabatp Sep 9, 2024
fe9bda3
docs: adds documentation for `mapOptions`
mohitb35 Sep 9, 2024
caf5cac
fix: ui adjustment for impersonation mode for mobile version
sunilsabatp Sep 10, 2024
3180513
marge base branch,resolve merge conflict
sunilsabatp Sep 11, 2024
68aef19
refactor: remove duplicate prop
sunilsabatp Sep 11, 2024
eca1253
feat: add dummy img
sunilsabatp Sep 11, 2024
170220d
refactor: create seprate component to group all map related controls
sunilsabatp Sep 12, 2024
94541f9
refactor: minor ui adjustment
sunilsabatp Sep 12, 2024
3c9f725
refactor: update story
sunilsabatp Sep 12, 2024
0664474
Merge pull request #2213 from Plant-for-the-Planet-org/projects-redes…
sunilsabatp Sep 12, 2024
ab48e11
merge: resolve conflicts after merging base into projects-redesign/pl…
sunilsabatp Sep 12, 2024
f4b590c
fix: update incorrect import path for IconProps
mohitb35 Sep 12, 2024
620e796
feat: UI for parent plant location info
sunilsabatp Sep 13, 2024
153764a
fix: show project info when hover event end on plocation
sunilsabatp Sep 13, 2024
1401a87
feat: apply shadow effect for plant location info container
sunilsabatp Sep 14, 2024
69b44dc
fix: address feedbacks
sunilsabatp Sep 16, 2024
5323c2f
Merge branch 'projects-redesign/project-details' of https://github.co…
sunilsabatp Sep 16, 2024
bb438af
merge: merge base branch, resolve conflicts
sunilsabatp Sep 16, 2024
0db4578
refactor: refactor plant location info component
sunilsabatp Sep 16, 2024
e472309
feat: add ploc query for selected plant location
sunilsabatp Sep 17, 2024
83b8859
merge: merge base branch, resolve conflicts
sunilsabatp Sep 17, 2024
2982d95
fix: minor ui adjustment
sunilsabatp Sep 17, 2024
8fd7d2c
fix: minor ui adjustment
sunilsabatp Sep 17, 2024
67c4216
fix: minor ui adjustment
sunilsabatp Sep 17, 2024
975e2d5
refactor: rename + add state to ProjectSiteDropdown story
mohitb35 Sep 18, 2024
8cccdc9
address feedbacks
sunilsabatp Sep 18, 2024
c8cb6f8
minor ui adjustment
sunilsabatp Sep 18, 2024
8422f9f
feat: set up the component for sample plant location
sunilsabatp Sep 18, 2024
f705ec7
address feedbacks
sunilsabatp Sep 19, 2024
ec0f5e8
Merge branch 'projects-redesign/zoom-into-site' of https://github.com…
sunilsabatp Sep 19, 2024
3f00cb5
fix:minor ui adjustment
sunilsabatp Sep 20, 2024
acb6593
feat: UI for sample plant location
sunilsabatp Sep 20, 2024
f2d8003
address the feedbacks
sunilsabatp Sep 23, 2024
a353e7d
address the feedbacks
sunilsabatp Sep 24, 2024
f4fbba4
refactor: remove console
sunilsabatp Sep 24, 2024
267ff6f
merge: resolve conflicts after merging base branch
sunilsabatp Sep 24, 2024
e839b17
merge: merge base branch, resolve conflicts
sunilsabatp Sep 24, 2024
9cb3f36
fix: add missing keys
sunilsabatp Sep 24, 2024
a86f918
refactor: use correct component name
sunilsabatp Sep 24, 2024
a720597
feat: handle routing for plant location
sunilsabatp Sep 24, 2024
c2fd6cc
feat: handle routing for param site and ploc
sunilsabatp Sep 25, 2024
7e5382c
refactor: change variable name
sunilsabatp Sep 25, 2024
23be597
refactor: remove unwanted props
sunilsabatp Sep 25, 2024
95125ad
refactor: remove unused variable from classificationDropDownProps int…
sunilsabatp Sep 25, 2024
3666bab
Merge branch 'develop' into feature/projects-redesign
mohitb35 Sep 25, 2024
039f4dc
Merge branch 'feature/projects-redesign' into projects-redesign/list-…
mohitb35 Sep 25, 2024
f3a0ddf
address feedbacks
sunilsabatp Sep 26, 2024
90d5d59
Merge branch 'projects-redesign/list-screen' into projects-redesign/p…
sunilsabatp Sep 26, 2024
97b793a
merge: merge base branch, resolve conflicts
sunilsabatp Sep 26, 2024
07462e1
merge: merge base branch, resolve conflicts
sunilsabatp Sep 26, 2024
17c6068
refactor: updated stories
sunilsabatp Sep 26, 2024
bf28790
merge: merge base branch, resolve conflicts
sunilsabatp Sep 26, 2024
b7a83ea
Merge pull request #2209 from Plant-for-the-Planet-org/projects-redes…
mohitb35 Sep 26, 2024
2201b40
refactor: create a seperate component for sample plant location info
sunilsabatp Sep 27, 2024
47c9646
refactor: rename variables
sunilsabatp Sep 30, 2024
70abea0
address the feedbacks
sunilsabatp Sep 30, 2024
694624b
fix: set selectedSite to null if plant location is selected
sunilsabatp Sep 30, 2024
ca26c30
address the feedbacks
sunilsabatp Sep 30, 2024
b5b8119
merge: merge base branch, resolve conflicts
sunilsabatp Sep 30, 2024
7761faa
address the feedbacks
sunilsabatp Oct 1, 2024
72c3b72
feat: modal view for sample plant images
sunilsabatp Oct 1, 2024
1675266
fix: add site param
sunilsabatp Oct 1, 2024
c5a7a85
refactor: simplified shallow routing logic
sunilsabatp Oct 3, 2024
fc7ca8a
refactor: handle case for empty plantLocations array
sunilsabatp Oct 3, 2024
5b1fb43
refactor: rearranges/organizes ProjectsProvider code
mohitb35 Oct 3, 2024
227302c
Merge pull request #2211 from Plant-for-the-Planet-org/projects-redes…
sunilsabatp Oct 3, 2024
8046ea2
fix: react-insta bug
sunilsabatp Oct 4, 2024
82fc482
refactor: resolve merge conflict, refactor image slider component
sunilsabatp Oct 4, 2024
c60804d
feat: handle case where project has no sites
sunilsabatp Oct 4, 2024
049bb7a
Merge pull request #2247 from Plant-for-the-Planet-org/projects-redes…
sunilsabatp Oct 4, 2024
4f28e05
chore: install swiper library
mohitb35 Oct 7, 2024
0a39f75
feat: adds basic swiper layout for plant locations
mohitb35 Oct 7, 2024
4ef4176
address the feedbacks
sunilsabatp Oct 8, 2024
f5f8d1f
Merge branch 'projects-redesign/sample-plant-location' of https://git…
sunilsabatp Oct 8, 2024
b887bf5
feat: conditionally show MobileInfoSwiper
mohitb35 Oct 8, 2024
8734a28
feat: clear sample plant info if parent plant location (polygon) is c…
sunilsabatp Oct 8, 2024
39dc8d5
feat: hide MobileInfoSwiper on selecting site
mohitb35 Oct 8, 2024
2ab9c64
fix: plant location polygon overlap issue
sunilsabatp Oct 8, 2024
fe0008d
feat: clear undesired ProjectProps data on exiting map mode
mohitb35 Oct 8, 2024
b68c150
feat: update the zoom in duration value
sunilsabatp Oct 8, 2024
a643efd
feat: allow switching between sample tree info and plant location inf…
sunilsabatp Oct 9, 2024
fb7fcc7
feat: zoom to sample plant location
sunilsabatp Oct 9, 2024
39a9a5a
refactor: combine zoom to plant location logic
sunilsabatp Oct 9, 2024
cfee16c
refactor: remove duplicate dependency
sunilsabatp Oct 9, 2024
548680f
fix: use onMouseOut event to clear hover plant location state
sunilsabatp Oct 9, 2024
1912821
address feedbacks
sunilsabatp Oct 9, 2024
fb71c05
refactor: zoom logics
sunilsabatp Oct 10, 2024
229bfb8
feat: adds UI for mobile swiper (plant location info)
mohitb35 Oct 10, 2024
ac44b1e
address the feedbacks
sunilsabatp Oct 10, 2024
27cae22
refactor: resolve type issue
sunilsabatp Oct 10, 2024
29dc62d
Merge pull request #2255 from Plant-for-the-Planet-org/projects-redes…
sunilsabatp Oct 10, 2024
811b3ad
refactor: resolve conflicts
sunilsabatp Oct 10, 2024
3644f0b
fix: fixes swiper being hidden by address bar on safari (iOS)
mohitb35 Oct 10, 2024
cd7299f
address the feedbacks
sunilsabatp Oct 10, 2024
6be0733
feat: address the feedback
sunilsabatp Oct 11, 2024
ba25dc2
Merge pull request #2237 from Plant-for-the-Planet-org/projects-redes…
sunilsabatp Oct 11, 2024
276d54c
Merge branch 'projects-redesign/project-details' into feature/merge-f…
mohitb35 Oct 11, 2024
603d7d0
Merge pull request #2257 from Plant-for-the-Planet-org/feature/merge-…
mohitb35 Oct 11, 2024
0825cd8
Merge pull request #2155 from Plant-for-the-Planet-org/projects-redes…
mohitb35 Oct 11, 2024
9015e9d
Merge pull request #2183 from Plant-for-the-Planet-org/projects-redes…
mohitb35 Oct 11, 2024
2f711ea
feat: adds UI for mobile swiper (single plant location info)
mohitb35 Oct 14, 2024
b6fdf52
fix: redirect user to the previous page
sunilsabatp Oct 14, 2024
f2c47a1
feat: optimizes swiper rendering on hide/show or data change
mohitb35 Oct 14, 2024
d8f7544
refactor: minor code cleanup
sunilsabatp Oct 15, 2024
c3da1be
fix: corrects text color for Show Whole Area button
mohitb35 Oct 15, 2024
5a4756e
feat: handle route for a project which has no site
sunilsabatp Oct 15, 2024
f3c461c
feat: prevent shallow push after clicking back button
sunilsabatp Oct 16, 2024
8a54ed9
feat: clean up redirect link from local storage when user visit to pr…
sunilsabatp Oct 16, 2024
60cb6a3
hotfix: address conflicting zoom adjustments
sunilsabatp Oct 16, 2024
92dfb8c
feat: center the map base on filter results
sunilsabatp Oct 16, 2024
540b63a
feat: smooth map centering with filtered project data
sunilsabatp Oct 17, 2024
90b4237
feat: expand the clickable area for project snippet
sunilsabatp Oct 17, 2024
ae03b06
feat: hide zoom buttons and satellite toggle when plant location swip…
mohitb35 Oct 16, 2024
e376d03
fix: resolves bugs in selecting/unselecting sample plant locations
mohitb35 Oct 17, 2024
2177da2
feat: remove seperator from the key info
sunilsabatp Oct 17, 2024
589ab3b
feat: include report text in the clickable area to download the proje…
sunilsabatp Oct 17, 2024
321e6d1
Merge pull request #2259 from Plant-for-the-Planet-org/projects-redes…
mohitb35 Oct 17, 2024
6af36ee
merge: merge base branch, resolve conflicts, resolve type issue
sunilsabatp Oct 17, 2024
061f0db
merge: merge base branch, resolve merge conflicts
sunilsabatp Oct 17, 2024
3d566b3
feat: make the snippet non clickable for the project details page
sunilsabatp Oct 17, 2024
c69c783
refactor: remove unwanted imports
sunilsabatp Oct 18, 2024
6e6f8c6
Merge pull request #2266 from Plant-for-the-Planet-org/projects-redes…
sunilsabatp Oct 18, 2024
a3183ed
Merge branch 'feature/projects-redesign' into projects-redesign/expan…
sunilsabatp Oct 18, 2024
71bd0c2
feat: handle null case for site geometry
sunilsabatp Oct 18, 2024
e161501
feat: use next Link
sunilsabatp Oct 18, 2024
dbed9ac
address feedback
sunilsabatp Oct 18, 2024
7c35d79
refactor: merge base branch, resolve conflict
sunilsabatp Oct 18, 2024
0e9f561
refactor: address the feedbacks
sunilsabatp Oct 18, 2024
e8232b3
refactor: address feedback
sunilsabatp Oct 21, 2024
6ddf7ba
feat: render a separator for the footer on mobile
sunilsabatp Oct 21, 2024
08734a5
feat: shift event to link
sunilsabatp Oct 21, 2024
979710c
refactor: revert geometry null check logic
sunilsabatp Oct 21, 2024
a0c5808
feat: use memoized variable
sunilsabatp Oct 21, 2024
db95af1
refactor: address feedbacks
sunilsabatp Oct 21, 2024
b26fc2c
refactor: minor reorg of ProjectInfo styles
mohitb35 Oct 21, 2024
46f39f2
Merge pull request #2268 from Plant-for-the-Planet-org/projects-redes…
sunilsabatp Oct 21, 2024
6e39570
Merge pull request #2267 from Plant-for-the-Planet-org/projects-redes…
sunilsabatp Oct 21, 2024
597da40
Merge pull request #2261 from Plant-for-the-Planet-org/projects-redes…
mohitb35 Oct 21, 2024
4718648
refactor: merge base branch, resolve conflicts
sunilsabatp Oct 21, 2024
a683fe7
refactor: remove unwanted code
sunilsabatp Oct 21, 2024
027cabc
Merge branch 'feature/projects-redesign' into projects-redesign/back-…
sunilsabatp Oct 21, 2024
6841e79
Merge pull request #2271 from Plant-for-the-Planet-org/projects-redes…
sunilsabatp Oct 21, 2024
712701c
feat: check device for mobile and set bottom value for navigation con…
sunilsabatp Oct 22, 2024
895d5aa
refactor: change the variable name from redirectLink to backNavigatio…
sunilsabatp Oct 22, 2024
d3f07b0
refactor: avoid passing preventShallowPush in the context provider
sunilsabatp Oct 22, 2024
bffcd0a
feat: set url for history route
sunilsabatp Oct 22, 2024
d34c7fc
fix: navigation control bottom alignment for different mobile OS
sunilsabatp Oct 23, 2024
f77378d
feat: use session storage to store previous page url
sunilsabatp Oct 23, 2024
3a15d36
Merge branch 'projects-redesign/back-button-functionality' of https:/…
sunilsabatp Oct 23, 2024
dcfed64
feat: use microtask(promise) to delay the execution of the zoom out f…
sunilsabatp Oct 24, 2024
39f66c3
feat: minor poistioning change of navigation control for ios
sunilsabatp Oct 24, 2024
acafcf1
fix: handle satellite layer warning
sunilsabatp Oct 24, 2024
7e6468a
feat: format planting density unit
sunilsabatp Oct 24, 2024
1e4a9b5
fix: handle site geometry null case
sunilsabatp Oct 25, 2024
cd65728
Merge pull request #2272 from Plant-for-the-Planet-org/projects-redes…
mariahosfeld Oct 25, 2024
fb00830
address feedback
sunilsabatp Oct 25, 2024
0c95eeb
merge: merge base branch; resolve conflicts
sunilsabatp Oct 25, 2024
11fc653
refactor: remove site related logics
sunilsabatp Oct 27, 2024
2473c8c
refactor: remove unwanted import
sunilsabatp Oct 27, 2024
6724cca
refactor: use correct dependency
sunilsabatp Oct 27, 2024
71e853b
feat: avoid passing query params for absolute url
sunilsabatp Oct 28, 2024
1f41c4b
Merge pull request #2260 from Plant-for-the-Planet-org/projects-redes…
sunilsabatp Oct 28, 2024
ca1a3be
Merge pull request #2274 from Plant-for-the-Planet-org/projects-redes…
mohitb35 Oct 28, 2024
62fffe5
merge: resolve conflicts from base branch merge
sunilsabatp Oct 28, 2024
e024ecc
hotfix: avoid calling plantlocation api while switching between list …
sunilsabatp Oct 28, 2024
7253cd5
refactor: remove duplicate code
sunilsabatp Oct 28, 2024
3902675
refactor: rename keyinfo component class name
sunilsabatp Oct 29, 2024
d0eb021
minor refactor for updateSiteAndUrl helper function
sunilsabatp Oct 29, 2024
2192869
Merge pull request #2278 from Plant-for-the-Planet-org/projects-redes…
mohitb35 Oct 29, 2024
0b13273
refactor: move TopProjectReports to /projectsv2
mohitb35 Oct 30, 2024
28613d2
fix: correct link colors
mohitb35 Oct 30, 2024
b4afe98
refactor: avoid adding site query param for projects with no sites
sunilsabatp Oct 30, 2024
0c6c481
fix: increase size for DownloadReports CTA
mohitb35 Oct 30, 2024
fca9179
fix: reduces size for search field text (mobile only)
mohitb35 Oct 30, 2024
b8d733c
feat: update default project image
mohitb35 Oct 30, 2024
5dbc009
address the feedbacks
sunilsabatp Oct 30, 2024
fd49320
feat: updates styles for noProjectFound
mohitb35 Oct 30, 2024
6c4bf52
feat: update styles of expandedImageSlider
mohitb35 Oct 30, 2024
8410094
feat: move nav menu upwards
mohitb35 Oct 30, 2024
5fef4c4
fix: enhance box-shadow for filter menu
mohitb35 Oct 30, 2024
88f41e2
fix: fix credits to screen bottom on mobile
mohitb35 Oct 30, 2024
0a79a7d
Merge pull request #2277 from Plant-for-the-Planet-org/projects-redes…
mohitb35 Oct 30, 2024
9e01550
refactor: consistent type import
sunilsabatp Oct 30, 2024
53fe589
fix: corrects icon color for cookie policy
mohitb35 Oct 30, 2024
b25b15d
fix: enhances exit map mode button visibility
mohitb35 Oct 30, 2024
05effd5
merge: merge base branch, resolve conflicts
sunilsabatp Oct 30, 2024
a034e81
Merge pull request #2275 from Plant-for-the-Planet-org/projects-redes…
mohitb35 Oct 30, 2024
90bb278
refactor: consistent type import
sunilsabatp Nov 4, 2024
b1df733
merge: merge base branch, resolve conflict
sunilsabatp Nov 4, 2024
f64e967
fix: preload default project image/cleans up code
mohitb35 Nov 4, 2024
05f2315
fix: smoother image loading transition
mohitb35 Nov 4, 2024
ceff679
Merge from 'develop' into projects-redesign
mohitb35 Nov 4, 2024
8669215
refactor: seperate type imports from runtime import
sunilsabatp Nov 4, 2024
f8ce7c2
refactor: reverse only import order file changes
sunilsabatp Nov 4, 2024
133c71a
refactor: seperate type imports from the runtime imports
sunilsabatp Nov 4, 2024
14f9818
refactor: update import statements to use 'import type' for type imports
mohitb35 Nov 4, 2024
b244cab
refactor: reorder import statements placing type imports above runtim…
mohitb35 Nov 4, 2024
0bd2fd4
Merge pull request #2280 from Plant-for-the-Planet-org/projects-redes…
sunilsabatp Nov 4, 2024
2401d2b
Fix: aligns edge of exit map mode button with map controls
mohitb35 Nov 4, 2024
9aa652b
Merge branch 'feature/projects-redesign' into projects-redesign/minor…
mohitb35 Nov 4, 2024
d665f02
Merge pull request #2279 from Plant-for-the-Planet-org/projects-redes…
mohitb35 Nov 4, 2024
5dbfd44
Merge pull request #2282 from Plant-for-the-Planet-org/projects-redes…
mohitb35 Nov 4, 2024
d26236a
refactor: minor change in the font size and position of explore conta…
sunilsabatp Nov 5, 2024
41e16d3
refactor: update font sizes in project info components
sunilsabatp Nov 5, 2024
868b12e
refactor(icons): move the icons from temp to projectV2 folder
sunilsabatp Nov 5, 2024
a2c2352
feat: update the font size of the site ownership type text
sunilsabatp Nov 5, 2024
31de207
fix: resolves default locale fallback bug on project details page
mohitb35 Nov 5, 2024
f3704f1
fix: resolves possible locale change on back button click
mohitb35 Nov 6, 2024
1d6a4f9
feat: add localized path utility and improve back navigation handling
mohitb35 Nov 6, 2024
17d9de5
refactor: move the infoIconPopup out of the temp folder
sunilsabatp Nov 6, 2024
6df3544
refactor: move styles for PlantLocations to /projectsV2
mohitb35 Nov 6, 2024
0761195
refactor: move Credits to /projectsV2
mohitb35 Nov 6, 2024
dc29bda
addressed the feedbacks
sunilsabatp Nov 6, 2024
5eea9f0
doc: add notes for old projects code to be removed from _app.tsx
mohitb35 Nov 6, 2024
e977eb0
refactor: rename ecosystem classes to toggle classes for clarity
mohitb35 Nov 6, 2024
af4d942
Merge pull request #2284 from Plant-for-the-Planet-org/projects-redes…
mohitb35 Nov 6, 2024
0945106
Merge pull request #2283 from Plant-for-the-Planet-org/projects-redes…
sunilsabatp Nov 6, 2024
4e1b610
fix: add hover state to footer CTAs
mohitb35 Nov 6, 2024
828ff3b
refactor: minor update to `buildProjectDetailsQuery` for readability
mohitb35 Nov 6, 2024
938b16a
Merge pull request #2287 from Plant-for-the-Planet-org/projects-redes…
mohitb35 Nov 6, 2024
2b0b5a3
Merge pull request #2290 from Plant-for-the-Planet-org/projects-redes…
mohitb35 Nov 6, 2024
301b3ab
fix: adapts mobile footer to handle different text lengths
mohitb35 Nov 7, 2024
6d8760b
fix: address TS warning while using SingleProjectView
mohitb35 Nov 7, 2024
0a54d44
feat: add meta info to project list and details pages
mohitb35 Nov 7, 2024
ec2598a
refactor: remove 'ManageProjects' translation namespace from projects…
mohitb35 Nov 7, 2024
3f7b1e0
fix: remove incorrect translated text capitalization
mohitb35 Nov 7, 2024
cde7d17
refactor: remove unused styles
mohitb35 Nov 7, 2024
bb098b9
Merge pull request #2291 from Plant-for-the-Planet-org/projects-redes…
sunilsabatp Nov 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ module.exports = {
browser: true,
es2020: true,
},
extends: ['eslint:recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', 'plugin:react/recommended', 'plugin:storybook/recommended'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:storybook/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
Expand Down Expand Up @@ -47,6 +53,7 @@ module.exports = {
'import/extensions': 'off',
'import/no-unresolved': 'off',
'react/jsx-no-literals': 'off',
'@typescript-eslint/consistent-type-imports': 'warn',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-empty-function': 'off',
Expand Down
4,904 changes: 2,120 additions & 2,784 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"prepare": "node ./husky-prepare.js"
},
"validate-branch-name": {
"pattern": "^(main|develop){1}$|^(feature|hotfix)/[a-z0-9-_]+$",
"pattern": "^(main|develop){1}$|^(feature|hotfix|projects-redesign)/[a-z0-9-_]+$",
"errorMsg": "Invalid branch name. \n 1.Branch names can contain lowercase characters, numbers, hyphen and underscore. \n 2.Except for 'main' and 'develop', branch names must begin with 'feature/' or 'hotfix/' "
},
"engines": {
Expand Down Expand Up @@ -133,6 +133,7 @@
"styled-jsx": "^5.0.0",
"supercluster": "^8.0.1",
"superjson": "^1.12.3",
"swiper": "^11.1.14",
"uuid": "^8.3.2",
"vizzuality-components": "^3.0.3",
"xlsx": "^0.18.5",
Expand Down
73 changes: 57 additions & 16 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import { CacheProvider, EmotionCache } from '@emotion/react';
import createEmotionCache from '../src/createEmotionCache';
import 'mapbox-gl/dist/mapbox-gl.css';
import 'mapbox-gl-compare/dist/mapbox-gl-compare.css';
import React from 'react';
import React, { ReactElement, ReactNode, useMemo } from 'react';
import TagManager from 'react-gtm-module';
import Router from 'next/router';
import App, { AppProps, AppContext, AppInitialProps } from 'next/app';
import App, { AppContext, AppInitialProps, AppProps } from 'next/app';
import { Auth0Provider } from '@auth0/auth0-react';
// NOTE - needs to be removed when old projects code is removed
import '../src/features/projects/styles/MapPopup.scss';
import '../src/theme/global.scss';
// NOTE - needs to be removed when old projects code is removed
import './../src/features/projects/styles/Projects.scss';
import './../src/features/common/Layout/Navbar/Navbar.scss';
import ThemeProvider from '../src/theme/themeContext';
Expand All @@ -32,6 +34,7 @@ import QueryParamsProvider from '../src/features/common/Layout/QueryParamsContex
import { PlanetCashProvider } from '../src/features/common/Layout/PlanetCashContext';
import { PayoutsProvider } from '../src/features/common/Layout/PayoutsContext';
import { trpc } from '../src/utils/trpc';
// NOTE - needs to be removed when old projects code is removed
import MapHolder from '../src/features/projects/components/maps/MapHolder';
import { TenantProvider } from '../src/features/common/Layout/TenantContext';
import { CurrencyProvider } from '../src/features/common/Layout/CurrencyContext';
Expand All @@ -41,9 +44,9 @@ import {
getTenantSlug,
} from '../src/utils/multiTenancy/helpers';
import { Tenant } from '@planet-sdk/common/build/types/tenant';
import { NextIntlClientProvider } from 'next-intl';

type AppOwnProps = { tenantConfig: Tenant };
import { AbstractIntlMessages, NextIntlClientProvider } from 'next-intl';
import { NextPage } from 'next';
import { SetState } from '../src/features/common/types/common';

const VideoContainer = dynamic(
() => import('../src/features/common/LandingVideo'),
Expand Down Expand Up @@ -107,15 +110,40 @@ const onRedirectCallback = (appState: any) => {
// Client-side cache, shared for the whole session of the user in the browser.
const clientSideEmotionCache = createEmotionCache();

export interface MyAppProps extends AppProps {
export type NextPageWithLayout<P = PageComponentProps, IP = P> = NextPage<
P,
IP
> & {
getLayout?: (
page: ReactElement,
pageComponentProps: PageComponentProps
) => ReactNode;
};

type AppPropsWithLayout = Omit<AppProps, 'pageProps'> & {
Component: NextPageWithLayout;
emotionCache?: EmotionCache;
}
pageProps: PageProps;
};

export type PageProps = {
tenantConfig: Tenant;
messages?: AbstractIntlMessages;
[key: string]: any;
};

export type PageComponentProps = {
pageProps: PageProps;
currencyCode: string;
setCurrencyCode: SetState<string>;
isMobile: boolean;
};

const PlanetWeb = ({
Component,
pageProps,
emotionCache = clientSideEmotionCache,
}: MyAppProps & AppOwnProps) => {
}: AppPropsWithLayout) => {
const router = useRouter();
const [isMap, setIsMap] = React.useState(false);
const [currencyCode, setCurrencyCode] = React.useState('');
Expand Down Expand Up @@ -164,10 +192,16 @@ const PlanetWeb = ({
setBrowserCompatible(browserNotCompatible());
}, []);

const ProjectProps = {
const isMobile = useMemo(() => {
if (typeof window === 'undefined') return false;
return window.innerWidth < 481;
}, [typeof window !== 'undefined' && window.innerWidth]);

const pageComponentProps = {
pageProps,
currencyCode,
setCurrencyCode,
isMobile,
};

const [showVideo, setshowVideo] = React.useState(true);
Expand Down Expand Up @@ -206,6 +240,12 @@ const PlanetWeb = ({
setshowVideo(localShowVideo);
}, [localShowVideo]);

const getLayout = Component.getLayout ?? ((page) => page);
const pageContent = getLayout(
<Component {...pageComponentProps} />,
pageComponentProps
);

if (browserCompatible) {
return <BrowserNotSupported />;
} else {
Expand Down Expand Up @@ -273,7 +313,7 @@ const PlanetWeb = ({
setshowVideo={setshowVideo}
/>
) : null}
<Component {...ProjectProps} />
{pageContent}
</AnalyticsProvider>
</BulkCodeProvider>
</ProjectPropsProvider>
Expand All @@ -300,7 +340,7 @@ const PlanetWeb = ({

PlanetWeb.getInitialProps = async (
context: AppContext
): Promise<AppOwnProps & AppInitialProps> => {
): Promise<AppInitialProps & { pageProps: PageProps }> => {
const ctx = await App.getInitialProps(context);

const _tenantSlug = await getTenantSlug(
Expand All @@ -311,12 +351,13 @@ PlanetWeb.getInitialProps = async (

const tenantConfig = await getTenantConfig(tenantSlug);

const pageProps = {
...ctx.pageProps,
tenantConfig,
return {
...ctx,
pageProps: {
...ctx.pageProps,
tenantConfig,
},
};

return { ...ctx, pageProps } as AppOwnProps & AppInitialProps;
};

export default trpc.withTRPC(PlanetWeb);
10 changes: 9 additions & 1 deletion pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,20 @@ class MyDocument extends Document {
return (
<Html lang="en">
<Head>
<link rel="dns-prefetch" href="https://www.plant-for-the-planet.org/" />
<link
rel="dns-prefetch"
href="https://www.plant-for-the-planet.org/"
/>
<link
rel="preconnect"
href="https://fonts.googleapis.com/"
crossOrigin="true"
/>
<link
rel="preload"
as="image"
href="/assets/images/project-contribution-default-landscape.png"
/>
{/* Commented code below to avoid inserting emotion css <style> tags above global/module scss */}
{/* <meta name="emotion-insertion-point" content="" /> */}
{this.props.styles}
Expand Down
8 changes: 4 additions & 4 deletions pages/sites/[slug]/[locale]/[p].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { useRouter } from 'next/router';
import React from 'react';
import { ErrorHandlingContext } from '../../../../src/features/common/Layout/ErrorHandlingContext';
import { useProjectProps } from '../../../../src/features/common/Layout/ProjectPropsContext';
import Credits from '../../../../src/features/projects/components/maps/Credits';
import Credits from '../../../../src/features/projectsV2/ProjectsMap/Credits';
import SingleProjectDetails from '../../../../src/features/projects/screens/SingleProjectDetails';
import { getRequest } from '../../../../src/utils/apiRequests/api';
import getStoredCurrency from '../../../../src/utils/countryCurrency/getStoredCurrency';
import GetProjectMeta from '../../../../src/utils/getMetaTags/GetProjectMeta';
import ProjectDetailsMeta from '../../../../src/utils/getMetaTags/ProjectDetailsMeta';
import { getAllPlantLocations } from '../../../../src/utils/maps/plantLocations';
import { AbstractIntlMessages, useLocale } from 'next-intl';
import {
Expand Down Expand Up @@ -205,7 +205,7 @@ export default function Donate({

return pageProps.tenantConfig ? (
<>
{project ? <GetProjectMeta project={project} /> : null}
{project ? <ProjectDetailsMeta project={project} /> : null}
{project ? (
<>
<SingleProjectDetails />
Expand All @@ -223,7 +223,7 @@ export default function Donate({
export const getStaticPaths = async () => {
const subDomainPaths = await constructPathsForTenantSlug();

const paths = subDomainPaths.map((path) => {
const paths = subDomainPaths?.map((path) => {
return {
params: {
slug: path.params.slug,
Expand Down
6 changes: 3 additions & 3 deletions pages/sites/[slug]/[locale]/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useRouter } from 'next/router';
import React from 'react';
import ProjectsList from '../../../../src/features/projects/screens/Projects';
import GetAllProjectsMeta from '../../../../src/utils/getMetaTags/GetAllProjectsMeta';
import ProjectsListMeta from '../../../../src/utils/getMetaTags/ProjectsListMeta';
import getStoredCurrency from '../../../../src/utils/countryCurrency/getStoredCurrency';
import { getRequest } from '../../../../src/utils/apiRequests/api';
import { useProjectProps } from '../../../../src/features/common/Layout/ProjectPropsContext';
import Credits from '../../../../src/features/projects/components/maps/Credits';
import Credits from '../../../../src/features/projectsV2/ProjectsMap/Credits';
import Filters from '../../../../src/features/projects/components/projects/Filters';
import { ErrorHandlingContext } from '../../../../src/features/common/Layout/ErrorHandlingContext';
import DirectGift, {
Expand Down Expand Up @@ -149,7 +149,7 @@ export default function Donate({
<>
{filteredProjects !== null ? (
<>
<GetAllProjectsMeta />
<ProjectsListMeta />
<ProjectsList
projects={filteredProjects}
{...OtherProjectListProps}
Expand Down
2 changes: 1 addition & 1 deletion pages/sites/[slug]/[locale]/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default function Login({ pageProps }: Props): ReactElement {
export const getStaticPaths = async () => {
const subDomainPaths = await constructPathsForTenantSlug();

const paths = subDomainPaths.map((path) => {
const paths = subDomainPaths?.map((path) => {
return {
params: {
slug: path.params.slug,
Expand Down
108 changes: 108 additions & 0 deletions pages/sites/[slug]/[locale]/prd/[p].tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
import type {
GetStaticProps,
GetStaticPropsContext,
GetStaticPropsResult,
} from 'next/types';
import type { ReactElement } from 'react';
import type {
NextPageWithLayout,
PageComponentProps,
PageProps,
} from '../../../../_app';

import {
constructPathsForTenantSlug,
getTenantConfig,
} from '../../../../../src/utils/multiTenancy/helpers';
import { defaultTenant } from '../../../../../tenant.config';
import getMessagesForPage from '../../../../../src/utils/language/getMessagesForPage';
import { useRouter } from 'next/router';
import { useTenant } from '../../../../../src/features/common/Layout/TenantContext';
import { useEffect } from 'react';
import { v4 } from 'uuid';
import ProjectsLayout from '../../../../../src/features/common/Layout/ProjectsLayout';
import MobileProjectsLayout from '../../../../../src/features/common/Layout/ProjectsLayout/MobileProjectsLayout';
import ProjectDetails from '../../../../../src/features/projectsV2/ProjectDetails';

const ProjectDetailsPage: NextPageWithLayout = ({
pageProps,
currencyCode,
isMobile,
}) => {
const router = useRouter();
const { setTenantConfig } = useTenant();

useEffect(() => {
if (router.isReady) {
setTenantConfig(pageProps.tenantConfig);
}
}, [router.isReady]);

return <ProjectDetails currencyCode={currencyCode} isMobile={isMobile} />;
};

ProjectDetailsPage.getLayout = function getLayout(
page: ReactElement,
pageComponentProps: PageComponentProps
): ReactElement {
const layoutProps = {
currencyCode: pageComponentProps.currencyCode,
setCurrencyCode: pageComponentProps.setCurrencyCode,
page: 'project-details',
isMobile: pageComponentProps.isMobile,
} as const;
return pageComponentProps.isMobile ? (
<MobileProjectsLayout {...layoutProps}>{page}</MobileProjectsLayout>
) : (
<ProjectsLayout {...layoutProps}>{page}</ProjectsLayout>
);
};

export default ProjectDetailsPage;

export const getStaticPaths = async () => {
const subDomainPaths = await constructPathsForTenantSlug();

const paths = subDomainPaths?.map((path) => {
return {
params: {
slug: path.params.slug,
p: v4(),
locale: 'en',
},
};
});

return {
paths,
fallback: 'blocking',
};
};

export const getStaticProps: GetStaticProps<PageProps> = async (
context: GetStaticPropsContext
): Promise<GetStaticPropsResult<PageProps>> => {
const tenantConfig =
(await getTenantConfig(context.params?.slug as string)) ?? defaultTenant;

const messages = await getMessagesForPage({
locale: context.params?.locale as string,
filenames: [
'common',
'maps',
'allProjects',
'projectDetails',
'donate',
'country',
'project',
'me',
],
});

return {
props: {
messages,
tenantConfig,
},
};
};
Loading
Loading