From 3565b07ca4b0f054ffe78f77ef53f46be55d3fac Mon Sep 17 00:00:00 2001 From: Clemence Kyara Date: Mon, 4 Nov 2019 10:45:14 +0300 Subject: [PATCH 01/31] Initial move of files to align with Next.js structure --- src/AppContext.js => AppContext.js | 0 README.md | 2 +- .../images/bg/background.png | Bin {src/assets => assets}/images/bg/databg.png | Bin .../assets => assets}/images/bg/databg@2x.png | Bin .../assets => assets}/images/bg/databg@3x.png | Bin {src/assets => assets}/images/bg/hero_bg.png | Bin {src/assets => assets}/images/bg/hero_map.png | Bin .../images/bg/smallscreen_background.png | Bin {src/assets => assets}/images/group-3-up.png | Bin {src/assets => assets}/images/group-3.png | Bin .../assets => assets}/images/hero-image-1.png | Bin .../images/hero-image-1@2x.png | Bin .../images/hero-image-1@3x.png | Bin .../assets => assets}/images/hero-image-3.png | Bin .../images/hero-image-3@2x.png | Bin .../images/hero-image-3@3x.png | Bin .../images/hero-image-3_2.png | Bin .../images/hero-image-3_2@2x.png | Bin .../images/hero-image-3_2@3x.png | Bin {src/assets => assets}/images/icons/back.svg | 0 .../images/icons/black-combined-shape.svg | 0 {src/assets => assets}/images/icons/close.svg | 0 .../images/icons/combined-shape.png | Bin .../images/icons/combined-shape.svg | 0 .../images/icons/group-6.png | Bin .../images/icons/group-6@2x.png | Bin .../images/icons/group-6@3x 2.png | Bin .../images/icons/group-6@3x.png | Bin .../images/icons/group-7.png | Bin .../images/icons/group-7@2x.png | Bin .../images/icons/group-7@3x.png | Bin .../images/icons/location.svg | 0 {src/assets => assets}/images/icons/menu.svg | 0 {src/assets => assets}/images/icons/shape.svg | 0 {src/assets => assets}/images/image.png | Bin {src/assets => assets}/images/image@2x.png | Bin {src/assets => assets}/images/image@3x.png | Bin {src/assets => assets}/images/image_2.png | Bin {src/assets => assets}/images/image_2@2x.png | Bin {src/assets => assets}/images/image_2@3x.png | Bin {src/assets => assets}/images/image_3.png | Bin {src/assets => assets}/images/image_3@2x.png | Bin {src/assets => assets}/images/image_3@3x.png | Bin {src/assets => assets}/images/image_4.png | Bin {src/assets => assets}/images/image_4@2x.png | Bin {src/assets => assets}/images/image_4@3x.png | Bin .../images/kaitlyn-baker-422999-unsplash.png | Bin .../kaitlyn-baker-422999-unsplash@2x.png | Bin .../kaitlyn-baker-422999-unsplash@3x.png | Bin .../images/logos/africa-drone.png | Bin {src/assets => assets}/images/logos/ancir.png | Bin {src/assets => assets}/images/logos/aul.png | Bin {src/assets => assets}/images/logos/bmgf.png | Bin {src/assets => assets}/images/logos/cfa.png | Bin .../images/logos/citypress.png | Bin .../images/logos/codeforafrica.png | Bin .../images/logos/datazetu.png | Bin .../images/logos/dominion-logo-country.png | Bin .../images/logos/dominion-logo.png | Bin {src/assets => assets}/images/logos/icfj.png | Bin .../images/logos/landbou.png | Bin .../images/logos/onground.png | Bin .../images/logos/oxpeckers.png | Bin .../images/logos/pulitzer.png | Bin .../images/logos/pulitzercenter.png | Bin .../images/logos/rapport.png | Bin .../images/logos/twaweza.png | Bin {src/components => components}/A.js | 0 .../About/AboutCountry.js | 0 .../About/AboutDominion.js | 0 .../components => components}/About/Header.js | 0 {src/components => components}/About/Info.js | 0 {src/components => components}/About/Land.js | 0 {src/components => components}/About/index.js | 0 {src/components => components}/ArrowButton.js | 0 {src/components => components}/Card/Data.js | 0 .../Card/Document.js | 0 .../components => components}/ChartFactory.js | 0 .../ChartsContainer.js | 0 .../CountryPartners/PartnerContent.js | 0 .../CountryPartners/index.js | 0 .../components => components}/Data/Content.js | 0 .../Data/DatasetsContent.js | 0 .../Data/DocumentsContents.js | 0 {src/components => components}/Data/index.js | 0 .../components => components}/ErrorContent.js | 0 .../components => components}/Footer/About.js | 0 .../Footer/Community.js | 0 .../Footer/Project.js | 0 .../Footer/SocialMedia.js | 0 .../components => components}/Footer/index.js | 0 .../Header/Header.js | 0 .../Header/Navigation.js | 0 .../Header/PortalDropdown.js | 0 .../components => components}/Header/index.js | 0 .../Hero/CountryHero.js | 0 {src/components => components}/Hero/Hero.js | 0 .../Hero/HomeHero.js | 0 .../Hero/HomeHeroMap.js | 0 .../Hero/ProfileHero/Profile.js | 0 .../Hero/ProfileHero/index.js | 0 .../Hero/TitleHero.js | 0 .../HowItWorks/Content.js | 0 .../HowItWorks/Description.js | 0 .../HowItWorks/FindFactsContent.js | 0 .../HowItWorks/GetContext.js | 0 .../HowItWorks/Map.js | 0 .../HowItWorks/Steps.js | 0 .../HowItWorks/ViewVideos.js | 0 .../HowItWorks/VisualizeContent.js | 0 .../HowItWorks/index.js | 0 {src/components => components}/IFrame.js | 0 .../Modal/ContactUs.js | 0 .../Modal/GetLocation.js | 0 .../Modal/PortalChooser.js | 0 {src/components => components}/Modal/index.js | 0 .../Modal}/useCloseModalOnPopstate.js | 0 {src => components/Modal}/useToggleModal.js | 0 {src/components => components}/Page.js | 0 {src/components => components}/Partners.js | 0 .../ProfileReleases/index.js | 0 .../ProfileSectionTitle.js | 0 {src/components => components}/ProfileTabs.js | 0 .../ReleaseDropdown.js | 0 .../Search/SearchBar.js | 0 .../Search/SearchResults.js | 0 .../components => components}/Search/index.js | 0 {src/components => components}/Section.js | 0 .../Showcase/StoryCard.js | 0 .../Showcase/StoryList.js | 0 .../Showcase/index.js | 0 .../components => components}/Video/Player.js | 0 .../Video/PlayerModal.js | 0 .../Video/Sources.js | 0 .../Video/Thumbnail.js | 0 {src/components => components}/Video/index.js | 0 {src/data => data}/charts.json | 0 {src/data => data}/queries.js | 0 {src/data => data}/useChartDefinitions.js | 0 {src/data => data}/useProfileLoader.js | 0 src/config.js => dominion.config.js | 0 {src/lib => lib}/api.js | 0 {src => lib}/utils/aggregateData.js | 0 {src => lib}/utils/slugify.js | 0 package.json | 26 +++++++++++------- .../Country.js => pages/[countrySlug].js | 0 src/pages/About.js => pages/about.js | 0 src/pages/Home.js => pages/index.js | 0 .../Profile.js => pages/profile/[geoId].js | 0 src/pages/Resources.js => pages/resources.js | 0 scripts/chartsDefinitionsApplyUniqueId.js | 4 +-- src/Theme.js => theme.js | 0 153 files changed, 19 insertions(+), 13 deletions(-) rename src/AppContext.js => AppContext.js (100%) rename {src/assets => assets}/images/bg/background.png (100%) rename {src/assets => assets}/images/bg/databg.png (100%) rename {src/assets => assets}/images/bg/databg@2x.png (100%) rename {src/assets => assets}/images/bg/databg@3x.png (100%) rename {src/assets => assets}/images/bg/hero_bg.png (100%) rename {src/assets => assets}/images/bg/hero_map.png (100%) rename {src/assets => assets}/images/bg/smallscreen_background.png (100%) rename {src/assets => assets}/images/group-3-up.png (100%) rename {src/assets => assets}/images/group-3.png (100%) rename {src/assets => assets}/images/hero-image-1.png (100%) rename {src/assets => assets}/images/hero-image-1@2x.png (100%) rename {src/assets => assets}/images/hero-image-1@3x.png (100%) rename {src/assets => assets}/images/hero-image-3.png (100%) rename {src/assets => assets}/images/hero-image-3@2x.png (100%) rename {src/assets => assets}/images/hero-image-3@3x.png (100%) rename {src/assets => assets}/images/hero-image-3_2.png (100%) rename {src/assets => assets}/images/hero-image-3_2@2x.png (100%) rename {src/assets => assets}/images/hero-image-3_2@3x.png (100%) rename {src/assets => assets}/images/icons/back.svg (100%) rename {src/assets => assets}/images/icons/black-combined-shape.svg (100%) rename {src/assets => assets}/images/icons/close.svg (100%) rename {src/assets => assets}/images/icons/combined-shape.png (100%) rename {src/assets => assets}/images/icons/combined-shape.svg (100%) rename {src/assets => assets}/images/icons/group-6.png (100%) rename {src/assets => assets}/images/icons/group-6@2x.png (100%) rename {src/assets => assets}/images/icons/group-6@3x 2.png (100%) rename {src/assets => assets}/images/icons/group-6@3x.png (100%) rename {src/assets => assets}/images/icons/group-7.png (100%) rename {src/assets => assets}/images/icons/group-7@2x.png (100%) rename {src/assets => assets}/images/icons/group-7@3x.png (100%) rename {src/assets => assets}/images/icons/location.svg (100%) rename {src/assets => assets}/images/icons/menu.svg (100%) rename {src/assets => assets}/images/icons/shape.svg (100%) rename {src/assets => assets}/images/image.png (100%) rename {src/assets => assets}/images/image@2x.png (100%) rename {src/assets => assets}/images/image@3x.png (100%) rename {src/assets => assets}/images/image_2.png (100%) rename {src/assets => assets}/images/image_2@2x.png (100%) rename {src/assets => assets}/images/image_2@3x.png (100%) rename {src/assets => assets}/images/image_3.png (100%) rename {src/assets => assets}/images/image_3@2x.png (100%) rename {src/assets => assets}/images/image_3@3x.png (100%) rename {src/assets => assets}/images/image_4.png (100%) rename {src/assets => assets}/images/image_4@2x.png (100%) rename {src/assets => assets}/images/image_4@3x.png (100%) rename {src/assets => assets}/images/kaitlyn-baker-422999-unsplash.png (100%) rename {src/assets => assets}/images/kaitlyn-baker-422999-unsplash@2x.png (100%) rename {src/assets => assets}/images/kaitlyn-baker-422999-unsplash@3x.png (100%) rename {src/assets => assets}/images/logos/africa-drone.png (100%) rename {src/assets => assets}/images/logos/ancir.png (100%) rename {src/assets => assets}/images/logos/aul.png (100%) rename {src/assets => assets}/images/logos/bmgf.png (100%) rename {src/assets => assets}/images/logos/cfa.png (100%) rename {src/assets => assets}/images/logos/citypress.png (100%) rename {src/assets => assets}/images/logos/codeforafrica.png (100%) rename {src/assets => assets}/images/logos/datazetu.png (100%) rename {src/assets => assets}/images/logos/dominion-logo-country.png (100%) rename {src/assets => assets}/images/logos/dominion-logo.png (100%) rename {src/assets => assets}/images/logos/icfj.png (100%) rename {src/assets => assets}/images/logos/landbou.png (100%) rename {src/assets => assets}/images/logos/onground.png (100%) rename {src/assets => assets}/images/logos/oxpeckers.png (100%) rename {src/assets => assets}/images/logos/pulitzer.png (100%) rename {src/assets => assets}/images/logos/pulitzercenter.png (100%) rename {src/assets => assets}/images/logos/rapport.png (100%) rename {src/assets => assets}/images/logos/twaweza.png (100%) rename {src/components => components}/A.js (100%) rename {src/components => components}/About/AboutCountry.js (100%) rename {src/components => components}/About/AboutDominion.js (100%) rename {src/components => components}/About/Header.js (100%) rename {src/components => components}/About/Info.js (100%) rename {src/components => components}/About/Land.js (100%) rename {src/components => components}/About/index.js (100%) rename {src/components => components}/ArrowButton.js (100%) rename {src/components => components}/Card/Data.js (100%) rename {src/components => components}/Card/Document.js (100%) rename {src/components => components}/ChartFactory.js (100%) rename {src/components => components}/ChartsContainer.js (100%) rename {src/components => components}/CountryPartners/PartnerContent.js (100%) rename {src/components => components}/CountryPartners/index.js (100%) rename {src/components => components}/Data/Content.js (100%) rename {src/components => components}/Data/DatasetsContent.js (100%) rename {src/components => components}/Data/DocumentsContents.js (100%) rename {src/components => components}/Data/index.js (100%) rename {src/components => components}/ErrorContent.js (100%) rename {src/components => components}/Footer/About.js (100%) rename {src/components => components}/Footer/Community.js (100%) rename {src/components => components}/Footer/Project.js (100%) rename {src/components => components}/Footer/SocialMedia.js (100%) rename {src/components => components}/Footer/index.js (100%) rename {src/components => components}/Header/Header.js (100%) rename {src/components => components}/Header/Navigation.js (100%) rename {src/components => components}/Header/PortalDropdown.js (100%) rename {src/components => components}/Header/index.js (100%) rename {src/components => components}/Hero/CountryHero.js (100%) rename {src/components => components}/Hero/Hero.js (100%) rename {src/components => components}/Hero/HomeHero.js (100%) rename {src/components => components}/Hero/HomeHeroMap.js (100%) rename {src/components => components}/Hero/ProfileHero/Profile.js (100%) rename {src/components => components}/Hero/ProfileHero/index.js (100%) rename {src/components => components}/Hero/TitleHero.js (100%) rename {src/components => components}/HowItWorks/Content.js (100%) rename {src/components => components}/HowItWorks/Description.js (100%) rename {src/components => components}/HowItWorks/FindFactsContent.js (100%) rename {src/components => components}/HowItWorks/GetContext.js (100%) rename {src/components => components}/HowItWorks/Map.js (100%) rename {src/components => components}/HowItWorks/Steps.js (100%) rename {src/components => components}/HowItWorks/ViewVideos.js (100%) rename {src/components => components}/HowItWorks/VisualizeContent.js (100%) rename {src/components => components}/HowItWorks/index.js (100%) rename {src/components => components}/IFrame.js (100%) rename {src/components => components}/Modal/ContactUs.js (100%) rename {src/components => components}/Modal/GetLocation.js (100%) rename {src/components => components}/Modal/PortalChooser.js (100%) rename {src/components => components}/Modal/index.js (100%) rename {src => components/Modal}/useCloseModalOnPopstate.js (100%) rename {src => components/Modal}/useToggleModal.js (100%) rename {src/components => components}/Page.js (100%) rename {src/components => components}/Partners.js (100%) rename {src/components => components}/ProfileReleases/index.js (100%) rename {src/components => components}/ProfileSectionTitle.js (100%) rename {src/components => components}/ProfileTabs.js (100%) rename {src/components => components}/ReleaseDropdown.js (100%) rename {src/components => components}/Search/SearchBar.js (100%) rename {src/components => components}/Search/SearchResults.js (100%) rename {src/components => components}/Search/index.js (100%) rename {src/components => components}/Section.js (100%) rename {src/components => components}/Showcase/StoryCard.js (100%) rename {src/components => components}/Showcase/StoryList.js (100%) rename {src/components => components}/Showcase/index.js (100%) rename {src/components => components}/Video/Player.js (100%) rename {src/components => components}/Video/PlayerModal.js (100%) rename {src/components => components}/Video/Sources.js (100%) rename {src/components => components}/Video/Thumbnail.js (100%) rename {src/components => components}/Video/index.js (100%) rename {src/data => data}/charts.json (100%) rename {src/data => data}/queries.js (100%) rename {src/data => data}/useChartDefinitions.js (100%) rename {src/data => data}/useProfileLoader.js (100%) rename src/config.js => dominion.config.js (100%) rename {src/lib => lib}/api.js (100%) rename {src => lib}/utils/aggregateData.js (100%) rename {src => lib}/utils/slugify.js (100%) rename src/pages/Country.js => pages/[countrySlug].js (100%) rename src/pages/About.js => pages/about.js (100%) rename src/pages/Home.js => pages/index.js (100%) rename src/pages/Profile.js => pages/profile/[geoId].js (100%) rename src/pages/Resources.js => pages/resources.js (100%) rename src/Theme.js => theme.js (100%) diff --git a/src/AppContext.js b/AppContext.js similarity index 100% rename from src/AppContext.js rename to AppContext.js diff --git a/README.md b/README.md index 6d1965fd..7da6bf65 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,6 @@ Dominion gives journalist and civic activists useful facts and data about land o ## Chart Definitions -The charts in the app are defined in the json file `charts.json` in the `src/data/`. When you define the charts, they will be assigned a unique id when your run `yarn start` or `yarn deploy` or `yarn build`. This id will be used to identify this chart especially important when used in an embed. Don't chnage the id once the code is deployed otherwise any shared embeds with this Id will fail. +The charts in the app are defined in the json file `charts.json` in the `data/` folder. When you define the charts, they will be assigned a unique id when your run `yarn start` or `yarn deploy` or `yarn build`. This id will be used to identify this chart especially important when used in an embed. Don't chnage the id once the code is deployed otherwise any shared embeds with this Id will fail. Note: Using router in gh-pages see [spa-github-pages](https://github.com/rafrex/spa-github-pages). It requires the app to have a `404.html` file with a custom script and a custom script in the `index.html` that will allow the router to work in gh-pages. \ No newline at end of file diff --git a/src/assets/images/bg/background.png b/assets/images/bg/background.png similarity index 100% rename from src/assets/images/bg/background.png rename to assets/images/bg/background.png diff --git a/src/assets/images/bg/databg.png b/assets/images/bg/databg.png similarity index 100% rename from src/assets/images/bg/databg.png rename to assets/images/bg/databg.png diff --git a/src/assets/images/bg/databg@2x.png b/assets/images/bg/databg@2x.png similarity index 100% rename from src/assets/images/bg/databg@2x.png rename to assets/images/bg/databg@2x.png diff --git a/src/assets/images/bg/databg@3x.png b/assets/images/bg/databg@3x.png similarity index 100% rename from src/assets/images/bg/databg@3x.png rename to assets/images/bg/databg@3x.png diff --git a/src/assets/images/bg/hero_bg.png b/assets/images/bg/hero_bg.png similarity index 100% rename from src/assets/images/bg/hero_bg.png rename to assets/images/bg/hero_bg.png diff --git a/src/assets/images/bg/hero_map.png b/assets/images/bg/hero_map.png similarity index 100% rename from src/assets/images/bg/hero_map.png rename to assets/images/bg/hero_map.png diff --git a/src/assets/images/bg/smallscreen_background.png b/assets/images/bg/smallscreen_background.png similarity index 100% rename from src/assets/images/bg/smallscreen_background.png rename to assets/images/bg/smallscreen_background.png diff --git a/src/assets/images/group-3-up.png b/assets/images/group-3-up.png similarity index 100% rename from src/assets/images/group-3-up.png rename to assets/images/group-3-up.png diff --git a/src/assets/images/group-3.png b/assets/images/group-3.png similarity index 100% rename from src/assets/images/group-3.png rename to assets/images/group-3.png diff --git a/src/assets/images/hero-image-1.png b/assets/images/hero-image-1.png similarity index 100% rename from src/assets/images/hero-image-1.png rename to assets/images/hero-image-1.png diff --git a/src/assets/images/hero-image-1@2x.png b/assets/images/hero-image-1@2x.png similarity index 100% rename from src/assets/images/hero-image-1@2x.png rename to assets/images/hero-image-1@2x.png diff --git a/src/assets/images/hero-image-1@3x.png b/assets/images/hero-image-1@3x.png similarity index 100% rename from src/assets/images/hero-image-1@3x.png rename to assets/images/hero-image-1@3x.png diff --git a/src/assets/images/hero-image-3.png b/assets/images/hero-image-3.png similarity index 100% rename from src/assets/images/hero-image-3.png rename to assets/images/hero-image-3.png diff --git a/src/assets/images/hero-image-3@2x.png b/assets/images/hero-image-3@2x.png similarity index 100% rename from src/assets/images/hero-image-3@2x.png rename to assets/images/hero-image-3@2x.png diff --git a/src/assets/images/hero-image-3@3x.png b/assets/images/hero-image-3@3x.png similarity index 100% rename from src/assets/images/hero-image-3@3x.png rename to assets/images/hero-image-3@3x.png diff --git a/src/assets/images/hero-image-3_2.png b/assets/images/hero-image-3_2.png similarity index 100% rename from src/assets/images/hero-image-3_2.png rename to assets/images/hero-image-3_2.png diff --git a/src/assets/images/hero-image-3_2@2x.png b/assets/images/hero-image-3_2@2x.png similarity index 100% rename from src/assets/images/hero-image-3_2@2x.png rename to assets/images/hero-image-3_2@2x.png diff --git a/src/assets/images/hero-image-3_2@3x.png b/assets/images/hero-image-3_2@3x.png similarity index 100% rename from src/assets/images/hero-image-3_2@3x.png rename to assets/images/hero-image-3_2@3x.png diff --git a/src/assets/images/icons/back.svg b/assets/images/icons/back.svg similarity index 100% rename from src/assets/images/icons/back.svg rename to assets/images/icons/back.svg diff --git a/src/assets/images/icons/black-combined-shape.svg b/assets/images/icons/black-combined-shape.svg similarity index 100% rename from src/assets/images/icons/black-combined-shape.svg rename to assets/images/icons/black-combined-shape.svg diff --git a/src/assets/images/icons/close.svg b/assets/images/icons/close.svg similarity index 100% rename from src/assets/images/icons/close.svg rename to assets/images/icons/close.svg diff --git a/src/assets/images/icons/combined-shape.png b/assets/images/icons/combined-shape.png similarity index 100% rename from src/assets/images/icons/combined-shape.png rename to assets/images/icons/combined-shape.png diff --git a/src/assets/images/icons/combined-shape.svg b/assets/images/icons/combined-shape.svg similarity index 100% rename from src/assets/images/icons/combined-shape.svg rename to assets/images/icons/combined-shape.svg diff --git a/src/assets/images/icons/group-6.png b/assets/images/icons/group-6.png similarity index 100% rename from src/assets/images/icons/group-6.png rename to assets/images/icons/group-6.png diff --git a/src/assets/images/icons/group-6@2x.png b/assets/images/icons/group-6@2x.png similarity index 100% rename from src/assets/images/icons/group-6@2x.png rename to assets/images/icons/group-6@2x.png diff --git a/src/assets/images/icons/group-6@3x 2.png b/assets/images/icons/group-6@3x 2.png similarity index 100% rename from src/assets/images/icons/group-6@3x 2.png rename to assets/images/icons/group-6@3x 2.png diff --git a/src/assets/images/icons/group-6@3x.png b/assets/images/icons/group-6@3x.png similarity index 100% rename from src/assets/images/icons/group-6@3x.png rename to assets/images/icons/group-6@3x.png diff --git a/src/assets/images/icons/group-7.png b/assets/images/icons/group-7.png similarity index 100% rename from src/assets/images/icons/group-7.png rename to assets/images/icons/group-7.png diff --git a/src/assets/images/icons/group-7@2x.png b/assets/images/icons/group-7@2x.png similarity index 100% rename from src/assets/images/icons/group-7@2x.png rename to assets/images/icons/group-7@2x.png diff --git a/src/assets/images/icons/group-7@3x.png b/assets/images/icons/group-7@3x.png similarity index 100% rename from src/assets/images/icons/group-7@3x.png rename to assets/images/icons/group-7@3x.png diff --git a/src/assets/images/icons/location.svg b/assets/images/icons/location.svg similarity index 100% rename from src/assets/images/icons/location.svg rename to assets/images/icons/location.svg diff --git a/src/assets/images/icons/menu.svg b/assets/images/icons/menu.svg similarity index 100% rename from src/assets/images/icons/menu.svg rename to assets/images/icons/menu.svg diff --git a/src/assets/images/icons/shape.svg b/assets/images/icons/shape.svg similarity index 100% rename from src/assets/images/icons/shape.svg rename to assets/images/icons/shape.svg diff --git a/src/assets/images/image.png b/assets/images/image.png similarity index 100% rename from src/assets/images/image.png rename to assets/images/image.png diff --git a/src/assets/images/image@2x.png b/assets/images/image@2x.png similarity index 100% rename from src/assets/images/image@2x.png rename to assets/images/image@2x.png diff --git a/src/assets/images/image@3x.png b/assets/images/image@3x.png similarity index 100% rename from src/assets/images/image@3x.png rename to assets/images/image@3x.png diff --git a/src/assets/images/image_2.png b/assets/images/image_2.png similarity index 100% rename from src/assets/images/image_2.png rename to assets/images/image_2.png diff --git a/src/assets/images/image_2@2x.png b/assets/images/image_2@2x.png similarity index 100% rename from src/assets/images/image_2@2x.png rename to assets/images/image_2@2x.png diff --git a/src/assets/images/image_2@3x.png b/assets/images/image_2@3x.png similarity index 100% rename from src/assets/images/image_2@3x.png rename to assets/images/image_2@3x.png diff --git a/src/assets/images/image_3.png b/assets/images/image_3.png similarity index 100% rename from src/assets/images/image_3.png rename to assets/images/image_3.png diff --git a/src/assets/images/image_3@2x.png b/assets/images/image_3@2x.png similarity index 100% rename from src/assets/images/image_3@2x.png rename to assets/images/image_3@2x.png diff --git a/src/assets/images/image_3@3x.png b/assets/images/image_3@3x.png similarity index 100% rename from src/assets/images/image_3@3x.png rename to assets/images/image_3@3x.png diff --git a/src/assets/images/image_4.png b/assets/images/image_4.png similarity index 100% rename from src/assets/images/image_4.png rename to assets/images/image_4.png diff --git a/src/assets/images/image_4@2x.png b/assets/images/image_4@2x.png similarity index 100% rename from src/assets/images/image_4@2x.png rename to assets/images/image_4@2x.png diff --git a/src/assets/images/image_4@3x.png b/assets/images/image_4@3x.png similarity index 100% rename from src/assets/images/image_4@3x.png rename to assets/images/image_4@3x.png diff --git a/src/assets/images/kaitlyn-baker-422999-unsplash.png b/assets/images/kaitlyn-baker-422999-unsplash.png similarity index 100% rename from src/assets/images/kaitlyn-baker-422999-unsplash.png rename to assets/images/kaitlyn-baker-422999-unsplash.png diff --git a/src/assets/images/kaitlyn-baker-422999-unsplash@2x.png b/assets/images/kaitlyn-baker-422999-unsplash@2x.png similarity index 100% rename from src/assets/images/kaitlyn-baker-422999-unsplash@2x.png rename to assets/images/kaitlyn-baker-422999-unsplash@2x.png diff --git a/src/assets/images/kaitlyn-baker-422999-unsplash@3x.png b/assets/images/kaitlyn-baker-422999-unsplash@3x.png similarity index 100% rename from src/assets/images/kaitlyn-baker-422999-unsplash@3x.png rename to assets/images/kaitlyn-baker-422999-unsplash@3x.png diff --git a/src/assets/images/logos/africa-drone.png b/assets/images/logos/africa-drone.png similarity index 100% rename from src/assets/images/logos/africa-drone.png rename to assets/images/logos/africa-drone.png diff --git a/src/assets/images/logos/ancir.png b/assets/images/logos/ancir.png similarity index 100% rename from src/assets/images/logos/ancir.png rename to assets/images/logos/ancir.png diff --git a/src/assets/images/logos/aul.png b/assets/images/logos/aul.png similarity index 100% rename from src/assets/images/logos/aul.png rename to assets/images/logos/aul.png diff --git a/src/assets/images/logos/bmgf.png b/assets/images/logos/bmgf.png similarity index 100% rename from src/assets/images/logos/bmgf.png rename to assets/images/logos/bmgf.png diff --git a/src/assets/images/logos/cfa.png b/assets/images/logos/cfa.png similarity index 100% rename from src/assets/images/logos/cfa.png rename to assets/images/logos/cfa.png diff --git a/src/assets/images/logos/citypress.png b/assets/images/logos/citypress.png similarity index 100% rename from src/assets/images/logos/citypress.png rename to assets/images/logos/citypress.png diff --git a/src/assets/images/logos/codeforafrica.png b/assets/images/logos/codeforafrica.png similarity index 100% rename from src/assets/images/logos/codeforafrica.png rename to assets/images/logos/codeforafrica.png diff --git a/src/assets/images/logos/datazetu.png b/assets/images/logos/datazetu.png similarity index 100% rename from src/assets/images/logos/datazetu.png rename to assets/images/logos/datazetu.png diff --git a/src/assets/images/logos/dominion-logo-country.png b/assets/images/logos/dominion-logo-country.png similarity index 100% rename from src/assets/images/logos/dominion-logo-country.png rename to assets/images/logos/dominion-logo-country.png diff --git a/src/assets/images/logos/dominion-logo.png b/assets/images/logos/dominion-logo.png similarity index 100% rename from src/assets/images/logos/dominion-logo.png rename to assets/images/logos/dominion-logo.png diff --git a/src/assets/images/logos/icfj.png b/assets/images/logos/icfj.png similarity index 100% rename from src/assets/images/logos/icfj.png rename to assets/images/logos/icfj.png diff --git a/src/assets/images/logos/landbou.png b/assets/images/logos/landbou.png similarity index 100% rename from src/assets/images/logos/landbou.png rename to assets/images/logos/landbou.png diff --git a/src/assets/images/logos/onground.png b/assets/images/logos/onground.png similarity index 100% rename from src/assets/images/logos/onground.png rename to assets/images/logos/onground.png diff --git a/src/assets/images/logos/oxpeckers.png b/assets/images/logos/oxpeckers.png similarity index 100% rename from src/assets/images/logos/oxpeckers.png rename to assets/images/logos/oxpeckers.png diff --git a/src/assets/images/logos/pulitzer.png b/assets/images/logos/pulitzer.png similarity index 100% rename from src/assets/images/logos/pulitzer.png rename to assets/images/logos/pulitzer.png diff --git a/src/assets/images/logos/pulitzercenter.png b/assets/images/logos/pulitzercenter.png similarity index 100% rename from src/assets/images/logos/pulitzercenter.png rename to assets/images/logos/pulitzercenter.png diff --git a/src/assets/images/logos/rapport.png b/assets/images/logos/rapport.png similarity index 100% rename from src/assets/images/logos/rapport.png rename to assets/images/logos/rapport.png diff --git a/src/assets/images/logos/twaweza.png b/assets/images/logos/twaweza.png similarity index 100% rename from src/assets/images/logos/twaweza.png rename to assets/images/logos/twaweza.png diff --git a/src/components/A.js b/components/A.js similarity index 100% rename from src/components/A.js rename to components/A.js diff --git a/src/components/About/AboutCountry.js b/components/About/AboutCountry.js similarity index 100% rename from src/components/About/AboutCountry.js rename to components/About/AboutCountry.js diff --git a/src/components/About/AboutDominion.js b/components/About/AboutDominion.js similarity index 100% rename from src/components/About/AboutDominion.js rename to components/About/AboutDominion.js diff --git a/src/components/About/Header.js b/components/About/Header.js similarity index 100% rename from src/components/About/Header.js rename to components/About/Header.js diff --git a/src/components/About/Info.js b/components/About/Info.js similarity index 100% rename from src/components/About/Info.js rename to components/About/Info.js diff --git a/src/components/About/Land.js b/components/About/Land.js similarity index 100% rename from src/components/About/Land.js rename to components/About/Land.js diff --git a/src/components/About/index.js b/components/About/index.js similarity index 100% rename from src/components/About/index.js rename to components/About/index.js diff --git a/src/components/ArrowButton.js b/components/ArrowButton.js similarity index 100% rename from src/components/ArrowButton.js rename to components/ArrowButton.js diff --git a/src/components/Card/Data.js b/components/Card/Data.js similarity index 100% rename from src/components/Card/Data.js rename to components/Card/Data.js diff --git a/src/components/Card/Document.js b/components/Card/Document.js similarity index 100% rename from src/components/Card/Document.js rename to components/Card/Document.js diff --git a/src/components/ChartFactory.js b/components/ChartFactory.js similarity index 100% rename from src/components/ChartFactory.js rename to components/ChartFactory.js diff --git a/src/components/ChartsContainer.js b/components/ChartsContainer.js similarity index 100% rename from src/components/ChartsContainer.js rename to components/ChartsContainer.js diff --git a/src/components/CountryPartners/PartnerContent.js b/components/CountryPartners/PartnerContent.js similarity index 100% rename from src/components/CountryPartners/PartnerContent.js rename to components/CountryPartners/PartnerContent.js diff --git a/src/components/CountryPartners/index.js b/components/CountryPartners/index.js similarity index 100% rename from src/components/CountryPartners/index.js rename to components/CountryPartners/index.js diff --git a/src/components/Data/Content.js b/components/Data/Content.js similarity index 100% rename from src/components/Data/Content.js rename to components/Data/Content.js diff --git a/src/components/Data/DatasetsContent.js b/components/Data/DatasetsContent.js similarity index 100% rename from src/components/Data/DatasetsContent.js rename to components/Data/DatasetsContent.js diff --git a/src/components/Data/DocumentsContents.js b/components/Data/DocumentsContents.js similarity index 100% rename from src/components/Data/DocumentsContents.js rename to components/Data/DocumentsContents.js diff --git a/src/components/Data/index.js b/components/Data/index.js similarity index 100% rename from src/components/Data/index.js rename to components/Data/index.js diff --git a/src/components/ErrorContent.js b/components/ErrorContent.js similarity index 100% rename from src/components/ErrorContent.js rename to components/ErrorContent.js diff --git a/src/components/Footer/About.js b/components/Footer/About.js similarity index 100% rename from src/components/Footer/About.js rename to components/Footer/About.js diff --git a/src/components/Footer/Community.js b/components/Footer/Community.js similarity index 100% rename from src/components/Footer/Community.js rename to components/Footer/Community.js diff --git a/src/components/Footer/Project.js b/components/Footer/Project.js similarity index 100% rename from src/components/Footer/Project.js rename to components/Footer/Project.js diff --git a/src/components/Footer/SocialMedia.js b/components/Footer/SocialMedia.js similarity index 100% rename from src/components/Footer/SocialMedia.js rename to components/Footer/SocialMedia.js diff --git a/src/components/Footer/index.js b/components/Footer/index.js similarity index 100% rename from src/components/Footer/index.js rename to components/Footer/index.js diff --git a/src/components/Header/Header.js b/components/Header/Header.js similarity index 100% rename from src/components/Header/Header.js rename to components/Header/Header.js diff --git a/src/components/Header/Navigation.js b/components/Header/Navigation.js similarity index 100% rename from src/components/Header/Navigation.js rename to components/Header/Navigation.js diff --git a/src/components/Header/PortalDropdown.js b/components/Header/PortalDropdown.js similarity index 100% rename from src/components/Header/PortalDropdown.js rename to components/Header/PortalDropdown.js diff --git a/src/components/Header/index.js b/components/Header/index.js similarity index 100% rename from src/components/Header/index.js rename to components/Header/index.js diff --git a/src/components/Hero/CountryHero.js b/components/Hero/CountryHero.js similarity index 100% rename from src/components/Hero/CountryHero.js rename to components/Hero/CountryHero.js diff --git a/src/components/Hero/Hero.js b/components/Hero/Hero.js similarity index 100% rename from src/components/Hero/Hero.js rename to components/Hero/Hero.js diff --git a/src/components/Hero/HomeHero.js b/components/Hero/HomeHero.js similarity index 100% rename from src/components/Hero/HomeHero.js rename to components/Hero/HomeHero.js diff --git a/src/components/Hero/HomeHeroMap.js b/components/Hero/HomeHeroMap.js similarity index 100% rename from src/components/Hero/HomeHeroMap.js rename to components/Hero/HomeHeroMap.js diff --git a/src/components/Hero/ProfileHero/Profile.js b/components/Hero/ProfileHero/Profile.js similarity index 100% rename from src/components/Hero/ProfileHero/Profile.js rename to components/Hero/ProfileHero/Profile.js diff --git a/src/components/Hero/ProfileHero/index.js b/components/Hero/ProfileHero/index.js similarity index 100% rename from src/components/Hero/ProfileHero/index.js rename to components/Hero/ProfileHero/index.js diff --git a/src/components/Hero/TitleHero.js b/components/Hero/TitleHero.js similarity index 100% rename from src/components/Hero/TitleHero.js rename to components/Hero/TitleHero.js diff --git a/src/components/HowItWorks/Content.js b/components/HowItWorks/Content.js similarity index 100% rename from src/components/HowItWorks/Content.js rename to components/HowItWorks/Content.js diff --git a/src/components/HowItWorks/Description.js b/components/HowItWorks/Description.js similarity index 100% rename from src/components/HowItWorks/Description.js rename to components/HowItWorks/Description.js diff --git a/src/components/HowItWorks/FindFactsContent.js b/components/HowItWorks/FindFactsContent.js similarity index 100% rename from src/components/HowItWorks/FindFactsContent.js rename to components/HowItWorks/FindFactsContent.js diff --git a/src/components/HowItWorks/GetContext.js b/components/HowItWorks/GetContext.js similarity index 100% rename from src/components/HowItWorks/GetContext.js rename to components/HowItWorks/GetContext.js diff --git a/src/components/HowItWorks/Map.js b/components/HowItWorks/Map.js similarity index 100% rename from src/components/HowItWorks/Map.js rename to components/HowItWorks/Map.js diff --git a/src/components/HowItWorks/Steps.js b/components/HowItWorks/Steps.js similarity index 100% rename from src/components/HowItWorks/Steps.js rename to components/HowItWorks/Steps.js diff --git a/src/components/HowItWorks/ViewVideos.js b/components/HowItWorks/ViewVideos.js similarity index 100% rename from src/components/HowItWorks/ViewVideos.js rename to components/HowItWorks/ViewVideos.js diff --git a/src/components/HowItWorks/VisualizeContent.js b/components/HowItWorks/VisualizeContent.js similarity index 100% rename from src/components/HowItWorks/VisualizeContent.js rename to components/HowItWorks/VisualizeContent.js diff --git a/src/components/HowItWorks/index.js b/components/HowItWorks/index.js similarity index 100% rename from src/components/HowItWorks/index.js rename to components/HowItWorks/index.js diff --git a/src/components/IFrame.js b/components/IFrame.js similarity index 100% rename from src/components/IFrame.js rename to components/IFrame.js diff --git a/src/components/Modal/ContactUs.js b/components/Modal/ContactUs.js similarity index 100% rename from src/components/Modal/ContactUs.js rename to components/Modal/ContactUs.js diff --git a/src/components/Modal/GetLocation.js b/components/Modal/GetLocation.js similarity index 100% rename from src/components/Modal/GetLocation.js rename to components/Modal/GetLocation.js diff --git a/src/components/Modal/PortalChooser.js b/components/Modal/PortalChooser.js similarity index 100% rename from src/components/Modal/PortalChooser.js rename to components/Modal/PortalChooser.js diff --git a/src/components/Modal/index.js b/components/Modal/index.js similarity index 100% rename from src/components/Modal/index.js rename to components/Modal/index.js diff --git a/src/useCloseModalOnPopstate.js b/components/Modal/useCloseModalOnPopstate.js similarity index 100% rename from src/useCloseModalOnPopstate.js rename to components/Modal/useCloseModalOnPopstate.js diff --git a/src/useToggleModal.js b/components/Modal/useToggleModal.js similarity index 100% rename from src/useToggleModal.js rename to components/Modal/useToggleModal.js diff --git a/src/components/Page.js b/components/Page.js similarity index 100% rename from src/components/Page.js rename to components/Page.js diff --git a/src/components/Partners.js b/components/Partners.js similarity index 100% rename from src/components/Partners.js rename to components/Partners.js diff --git a/src/components/ProfileReleases/index.js b/components/ProfileReleases/index.js similarity index 100% rename from src/components/ProfileReleases/index.js rename to components/ProfileReleases/index.js diff --git a/src/components/ProfileSectionTitle.js b/components/ProfileSectionTitle.js similarity index 100% rename from src/components/ProfileSectionTitle.js rename to components/ProfileSectionTitle.js diff --git a/src/components/ProfileTabs.js b/components/ProfileTabs.js similarity index 100% rename from src/components/ProfileTabs.js rename to components/ProfileTabs.js diff --git a/src/components/ReleaseDropdown.js b/components/ReleaseDropdown.js similarity index 100% rename from src/components/ReleaseDropdown.js rename to components/ReleaseDropdown.js diff --git a/src/components/Search/SearchBar.js b/components/Search/SearchBar.js similarity index 100% rename from src/components/Search/SearchBar.js rename to components/Search/SearchBar.js diff --git a/src/components/Search/SearchResults.js b/components/Search/SearchResults.js similarity index 100% rename from src/components/Search/SearchResults.js rename to components/Search/SearchResults.js diff --git a/src/components/Search/index.js b/components/Search/index.js similarity index 100% rename from src/components/Search/index.js rename to components/Search/index.js diff --git a/src/components/Section.js b/components/Section.js similarity index 100% rename from src/components/Section.js rename to components/Section.js diff --git a/src/components/Showcase/StoryCard.js b/components/Showcase/StoryCard.js similarity index 100% rename from src/components/Showcase/StoryCard.js rename to components/Showcase/StoryCard.js diff --git a/src/components/Showcase/StoryList.js b/components/Showcase/StoryList.js similarity index 100% rename from src/components/Showcase/StoryList.js rename to components/Showcase/StoryList.js diff --git a/src/components/Showcase/index.js b/components/Showcase/index.js similarity index 100% rename from src/components/Showcase/index.js rename to components/Showcase/index.js diff --git a/src/components/Video/Player.js b/components/Video/Player.js similarity index 100% rename from src/components/Video/Player.js rename to components/Video/Player.js diff --git a/src/components/Video/PlayerModal.js b/components/Video/PlayerModal.js similarity index 100% rename from src/components/Video/PlayerModal.js rename to components/Video/PlayerModal.js diff --git a/src/components/Video/Sources.js b/components/Video/Sources.js similarity index 100% rename from src/components/Video/Sources.js rename to components/Video/Sources.js diff --git a/src/components/Video/Thumbnail.js b/components/Video/Thumbnail.js similarity index 100% rename from src/components/Video/Thumbnail.js rename to components/Video/Thumbnail.js diff --git a/src/components/Video/index.js b/components/Video/index.js similarity index 100% rename from src/components/Video/index.js rename to components/Video/index.js diff --git a/src/data/charts.json b/data/charts.json similarity index 100% rename from src/data/charts.json rename to data/charts.json diff --git a/src/data/queries.js b/data/queries.js similarity index 100% rename from src/data/queries.js rename to data/queries.js diff --git a/src/data/useChartDefinitions.js b/data/useChartDefinitions.js similarity index 100% rename from src/data/useChartDefinitions.js rename to data/useChartDefinitions.js diff --git a/src/data/useProfileLoader.js b/data/useProfileLoader.js similarity index 100% rename from src/data/useProfileLoader.js rename to data/useProfileLoader.js diff --git a/src/config.js b/dominion.config.js similarity index 100% rename from src/config.js rename to dominion.config.js diff --git a/src/lib/api.js b/lib/api.js similarity index 100% rename from src/lib/api.js rename to lib/api.js diff --git a/src/utils/aggregateData.js b/lib/utils/aggregateData.js similarity index 100% rename from src/utils/aggregateData.js rename to lib/utils/aggregateData.js diff --git a/src/utils/slugify.js b/lib/utils/slugify.js similarity index 100% rename from src/utils/slugify.js rename to lib/utils/slugify.js diff --git a/package.json b/package.json index 47b0a63d..7c65ec4f 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,9 @@ "private": true, "homepage": "https://dev.dominion.africa", "dependencies": { - "@codeforafrica/hurumap-ui": "^0.1.12", + "@apollo/react-hooks": "^3.1.3", + "@apollo/react-ssr": "^3.1.3", + "@codeforafrica/hurumap-ui": "^0.2.0-alpha.7", "@fortawesome/fontawesome-free": "^5.9.0", "@fortawesome/fontawesome-svg-core": "^1.2.19", "@fortawesome/free-brands-svg-icons": "^5.6.3", @@ -12,13 +14,19 @@ "@fortawesome/react-fontawesome": "^0.1.4", "@material-ui/core": "^4.5.1", "@material-ui/icons": "^4.5.1", + "@zeit/next-css": "^1.0.1", "apollo-boost": "^0.4.3", - "apollo-client": "^2.6.3", + "apollo-cache-inmemory": "^1.6.3", + "apollo-client": "^2.6.4", + "apollo-link-http": "^1.5.16", "axios": "^0.19.0", "classnames": "^2.2.6", "dequal": "^1.0.0", "graphql": "^14.4.2", "graphql-tag": "^2.10.1", + "isomorphic-unfetch": "^3.0.0", + "next": "^9.1.2", + "next-images": "^1.2.0", "prop-types": "^15.7.2", "react": "^16.8.6", "react-apollo": "^2.5.8", @@ -26,7 +34,6 @@ "react-dom": "^16.8.6", "react-router": "^5.0.1", "react-router-dom": "^5.0.1", - "react-scripts": "3.0.1", "shortid": "^2.2.15", "typescript": "*" }, @@ -45,17 +52,16 @@ "prettier": "^1.16.1" }, "scripts": { - "commitChartDefinitions": "git add src/data/charts.json && (git diff-index --quiet HEAD || (git commit -m 'updated chart ids' && git push))", + "commitChartDefinitions": "git add data/charts.json && (git diff-index --quiet HEAD || (git commit -m 'updated chart ids' && git push))", "applyIdsToChartDefinitions": "node scripts/chartsDefinitionsApplyUniqueId.js", + "dev": "next", "prestart": "yarn applyIdsToChartDefinitions", - "start": "react-scripts start", + "start": "next start", "prebuild": "yarn applyIdsToChartDefinitions", - "build": "react-scripts build", - "test": "react-scripts test", + "build": "next build", + "test": "next test", "lint": "node_modules/eslint/bin/eslint.js --fix src scripts", - "eject": "react-scripts eject", "predeploy": "yarn build && yarn commitChartDefinitions", - "deploy": "gh-pages -d build", "postversion": "git push --follow-tags && yarn deploy && echo \"Successfully released version $npm_package_version!\"" }, "eslintConfig": { @@ -75,7 +81,7 @@ }, "husky": { "hooks": { - "pre-commit": "yarn applyIdsToChartDefinitions && git add src/data/charts.json && lint-staged" + "pre-commit": "yarn applyIdsToChartDefinitions && git add data/charts.json && lint-staged" } }, "lint-staged": { diff --git a/src/pages/Country.js b/pages/[countrySlug].js similarity index 100% rename from src/pages/Country.js rename to pages/[countrySlug].js diff --git a/src/pages/About.js b/pages/about.js similarity index 100% rename from src/pages/About.js rename to pages/about.js diff --git a/src/pages/Home.js b/pages/index.js similarity index 100% rename from src/pages/Home.js rename to pages/index.js diff --git a/src/pages/Profile.js b/pages/profile/[geoId].js similarity index 100% rename from src/pages/Profile.js rename to pages/profile/[geoId].js diff --git a/src/pages/Resources.js b/pages/resources.js similarity index 100% rename from src/pages/Resources.js rename to pages/resources.js diff --git a/scripts/chartsDefinitionsApplyUniqueId.js b/scripts/chartsDefinitionsApplyUniqueId.js index aa05f6cc..23882500 100644 --- a/scripts/chartsDefinitionsApplyUniqueId.js +++ b/scripts/chartsDefinitionsApplyUniqueId.js @@ -1,6 +1,6 @@ const fs = require('fs'); const shortid = require('shortid'); -const sectionedCharts = require('../src/data/charts.json'); +const sectionedCharts = require('../data/charts.json'); sectionedCharts.forEach(section => { if (!section.id) { @@ -22,7 +22,7 @@ sectionedCharts.forEach(section => { }); fs.writeFileSync( - `${__dirname}/../src/data/charts.json`, + `${__dirname}/../data/charts.json`, JSON.stringify(sectionedCharts, null, 2) ); diff --git a/src/Theme.js b/theme.js similarity index 100% rename from src/Theme.js rename to theme.js From a64b1c12a55ba07516af93487db8cbccf8d702e0 Mon Sep 17 00:00:00 2001 From: Clemence Kyara Date: Mon, 4 Nov 2019 10:47:32 +0300 Subject: [PATCH 02/31] Initial support for NextJS --- AppContext.js | 11 +- components/About/AboutCountry.js | 2 +- components/About/Info.js | 1 - components/About/Land.js | 3 +- components/ArrowButton.js | 5 +- components/ChartFactory.js | 33 +- components/Data/Content.js | 13 +- components/Data/DatasetsContent.js | 1 - components/Data/DocumentsContents.js | 1 - components/Header/Header.js | 8 +- components/Header/Navigation.js | 26 +- components/Header/PortalDropdown.js | 23 +- components/Header/index.js | 3 +- components/Hero/CountryHero.js | 33 +- components/Hero/Hero.js | 15 +- components/Hero/HomeHero.js | 2 +- components/Hero/ProfileHero/Profile.js | 51 +- components/Hero/ProfileHero/index.js | 5 +- components/HowItWorks/Description.js | 2 +- components/HowItWorks/ViewVideos.js | 16 +- components/Link.js | 96 + components/Modal/GetLocation.js | 2 +- components/Modal/PortalChooser.js | 2 +- components/Modal/useCloseModalOnPopstate.js | 3 +- components/Modal/useToggleModal.js | 17 +- components/Page.js | 4 +- components/ProfileSectionTitle.js | 11 +- components/ProfileTabs.js | 8 +- components/Showcase/StoryList.js | 10 +- components/Video/Player.js | 45 +- components/Video/PlayerModal.js | 3 +- components/Video/index.js | 2 +- lib/api.js | 18 +- lib/withApollo.js | 110 + next.config.js | 4 + pages/[countrySlug].js | 34 +- pages/_app.js | 38 + pages/_document.js | 80 + pages/about.js | 9 +- pages/index.js | 9 +- pages/profile/[geoId].js | 81 +- pages/resources.js | 7 +- theme.js | 2 +- yarn.lock | 5897 ++++--------------- 44 files changed, 1697 insertions(+), 5049 deletions(-) create mode 100644 components/Link.js create mode 100644 lib/withApollo.js create mode 100644 next.config.js create mode 100644 pages/_app.js create mode 100644 pages/_document.js diff --git a/AppContext.js b/AppContext.js index 9890c829..376f7082 100644 --- a/AppContext.js +++ b/AppContext.js @@ -1,7 +1,7 @@ import React, { useReducer } from 'react'; import PropTypes from 'prop-types'; -export const AppContext = React.createContext({}); +const AppContext = React.createContext({}); const initialState = { selectedCountry: {}, @@ -18,7 +18,8 @@ const reducer = (state, action) => { return state; } }; -export default function AppContextProvider({ children }) { + +function Provider({ children }) { const [state, dispatch] = useReducer(reducer, initialState); return ( @@ -27,9 +28,13 @@ export default function AppContextProvider({ children }) { ); } -AppContextProvider.propTypes = { +Provider.propTypes = { children: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.node), PropTypes.node ]).isRequired }; + +export { Provider }; + +export default AppContext; diff --git a/components/About/AboutCountry.js b/components/About/AboutCountry.js index 3590c15d..322240d5 100644 --- a/components/About/AboutCountry.js +++ b/components/About/AboutCountry.js @@ -8,7 +8,7 @@ import Info, { InfoSubtitle, InfoBody } from './Info'; import Land from './Land'; import land from '../../assets/images/hero-image-3.png'; -import config from '../../config'; +import config from '../../dominion.config'; const useStyles = makeStyles(theme => ({ root: { diff --git a/components/About/Info.js b/components/About/Info.js index 3508cff6..ec82a365 100644 --- a/components/About/Info.js +++ b/components/About/Info.js @@ -71,7 +71,6 @@ function Info({ children, ...props }) { } Info.propTypes = { - classes: PropTypes.shape({}).isRequired, children: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.node), PropTypes.node diff --git a/components/About/Land.js b/components/About/Land.js index 9d4cb171..dc4f3998 100644 --- a/components/About/Land.js +++ b/components/About/Land.js @@ -32,7 +32,7 @@ const useStyles = makeStyles(theme => ({ } })); -function Land({ width, imgSrc, ...props }) { +function Land({ imgSrc, ...props }) { const classes = useStyles(props); const theme = useTheme(); let direction = 'column'; @@ -58,7 +58,6 @@ function Land({ width, imgSrc, ...props }) { } Land.propTypes = { - width: PropTypes.string.isRequired, imgSrc: PropTypes.string.isRequired }; diff --git a/components/ArrowButton.js b/components/ArrowButton.js index ecf1a3ca..71d116f0 100644 --- a/components/ArrowButton.js +++ b/components/ArrowButton.js @@ -41,13 +41,13 @@ const useStyles = makeStyles(theme => ({ } })); -function ArrowButton({ children, onClick, secondary, ...props }) { +function ArrowButton({ children, secondary, ...props }) { const classes = useStyles(props); + return (