Skip to content

Commit

Permalink
Organise and upgrade stories to match v8 requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
kilemensi committed Jun 5, 2024
1 parent b7ecde2 commit 0ef334c
Show file tree
Hide file tree
Showing 64 changed files with 83 additions and 134 deletions.
2 changes: 1 addition & 1 deletion apps/pesayetu/src/components/AboutHero/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
import AboutHero from ".";

export default {
title: "Sections/AboutHero",
title: "PesaYetu/Sections/AboutHero",
};

function Template({ ...args }) {
Expand Down
2 changes: 1 addition & 1 deletion apps/pesayetu/src/components/AboutProject/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
import AboutProject from ".";

export default {
title: "Sections/AboutProject",
title: "PesaYetu/Sections/AboutProject",
};

function Template({ ...args }) {
Expand Down
2 changes: 1 addition & 1 deletion apps/pesayetu/src/components/AboutTeam/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import AboutTeam from ".";
import { aboutTeam } from "@/pesayetu/config";

export default {
title: "Sections/AboutTeam",
title: "PesaYetu/Sections/AboutTeam",
};

function Template({ ...args }) {
Expand Down
2 changes: 1 addition & 1 deletion apps/pesayetu/src/components/Button/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Button } from "@mui/material";
import React from "react";

export default {
title: "Components/Button",
title: "PesaYetu/Components/Button",
argTypes: {
color: {
control: {
Expand Down
2 changes: 1 addition & 1 deletion apps/pesayetu/src/components/Card/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const [insightItem] = insightData.items;
const [teamItem] = aboutTeam.items;

export default {
title: "Components/Card",
title: "PesaYetu/Components/Card",
argTypes: {
card: {
control: {
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import DataIndicators from ".";
import { dataIndicator } from "@/pesayetu/config";

export default {
title: "Sections/DataIndicators",
title: "PesaYetu/Sections/DataIndicators",
};

function Template({ ...args }) {
Expand Down
2 changes: 1 addition & 1 deletion apps/pesayetu/src/components/DataSources/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
import DataSources from ".";

export default {
title: "Sections/DataSources",
title: "PesaYetu/Sections/DataSources",
};

function Template(args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import DataVisuals from ".";
import { dataVisuals } from "@/pesayetu/config";

export default {
title: "Sections/DataVisualisationGuide",
title: "PesaYetu/Sections/DataVisualisationGuide",
};

function Template({ ...args }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import DatasetsAndDocuments from ".";
import { documentsAndDatasetsArgs } from "@/pesayetu/config";

export default {
title: "Sections/DatasetsAndDocuments",
title: "PesaYetu/Sections/DatasetsAndDocuments",
argTypes: {
activeType: {
control: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import DropdownSearch from ".";
import { searchArgs } from "@/pesayetu/config";

export default {
title: "Components/DropdownSearch",
title: "PesaYetu/Components/DropdownSearch",
argTypes: {
title: {
control: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ExploreOtherTools from ".";
import { exploreTools } from "@/pesayetu/config";

export default {
title: "Sections/ExploreOtherTools",
title: "PesaYetu/Sections/ExploreOtherTools",
};

function Template({ ...args }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import FeaturedStoryCard from ".";
import cardImage from "@/pesayetu/assets/images/stephen-dawson-qwtCeJ5cLYs-unsplash.png";

export default {
title: "Components/FeaturedStoryCard",
title: "PesaYetu/Components/FeaturedStoryCard",
argTypes: {
ctaText: {
control: {
Expand Down
8 changes: 5 additions & 3 deletions apps/pesayetu/src/components/Footer/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Footer from ".";
import { footerArgs } from "@/pesayetu/config";

export default {
title: "Sections/Footer",
title: "PesaYetu/Sections/Footer",
argTypes: {
title: {
control: {
Expand Down Expand Up @@ -54,8 +54,10 @@ function Template({ ...args }) {
export const Default = Template.bind({});

Default.parameters = {
nextRouter: {
pathname: "/?path=/story/sections-footer--default",
nextjs: {
router: {
pathname: "/?path=/story/sections-footer--default",
},
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Group4658 from "@/pesayetu/assets/icons/Group 4658-white.svg";
import CategoryHeader from "@/pesayetu/components/HURUmap/CategoryHeader";

export default {
title: "Components/HURUmap/CategoryHeader",
title: "HURUmap/Components/CategoryHeader",
argTypes: {},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from "react";
import Chart from "@/pesayetu/components/HURUmap/Chart";

export default {
title: "Components/HURUmap/Chart",
title: "HURUmap/Components/Chart",
};

function Template({ ...args }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
import ChartFilter from "@/pesayetu/components/HURUmap/ChartFilter";

export default {
title: "Components/HURUmap/ChartFilter",
title: "HURUmap/Components/ChartFilter",
argTypes: {},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
import ChartTooltip from "@/pesayetu/components/HURUmap/ChartTooltip";

export default {
title: "Components/HURUmap/ChartTooltip",
title: "HURUmap/Components/ChartTooltip",
argTypes: {
title: {
control: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
import KeyMetric from "@/pesayetu/components/HURUmap/KeyMetric";

export default {
title: "Components/HURUmap/KeyMetric",
title: "HURUmap/Components/KeyMetric",
};

function Template({ ...args }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { hurumapArgs } from "@/pesayetu/config";
const { location } = hurumapArgs;

export default {
title: "Components/HURUmap/Location",
title: "HURUmap/Components/Location",
};

function Template(args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Print from "@/pesayetu/assets/icons/print.svg";
import LocationHeader from "@/pesayetu/components/HURUmap/LocationHeader";

export default {
title: "Components/HURUmap/LocationHeader",
title: "HURUmap/Components/LocationHeader",
argTypes: {},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const {
},
} = hurumapArgs;
export default {
title: "Components/HURUmap/LocationHighlight",
title: "HURUmap/Components/LocationHighlight",
};

function Template(args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const {
} = hurumapArgs;

export default {
title: "Components/HURUmap/LocationTag",
title: "HURUmap/Components/LocationTag",
argTypes: {
variant: {
control: {
Expand Down
2 changes: 1 addition & 1 deletion apps/pesayetu/src/components/HURUmap/Map/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
import Map from "@/pesayetu/components/HURUmap/Map";

export default {
title: "Components/HURUmap/Map",
title: "HURUmap/Components/Map",
argTypes: {
geography: {
control: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function PanelButtons({
const { isOpen: tutorialOpen } = useTour();

useEffect(() => {
if (primaryProfile.items.length || secondaryProfile?.items?.length) {
if (primaryProfile?.items?.length || secondaryProfile?.items?.length) {
const timeoutId = setTimeout(() => setValue("rich-data"), 200);

return () => {
Expand Down Expand Up @@ -64,7 +64,7 @@ function PanelButtons({
}
}
setPanelItems(pItems);
}, [isCompare, panelItemsProp, primaryProfile.items]);
}, [isCompare, panelItemsProp, primaryProfile?.items]);

useEffect(() => {
if (isPinning || isCompare) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ function RichData({ primaryProfile, ...props }) {
return (
<>
<TreeView
items={primaryProfile.items}
items={primaryProfile?.items}
onLabelClick={handleLabelClick}
classes={{ root: classes.treeView }}
/>
<Profile
{...props}
categories={primaryProfile.items}
categories={primaryProfile?.items}
primaryProfile={primaryProfile}
ref={profileRef}
/>
Expand Down
3 changes: 3 additions & 0 deletions apps/pesayetu/src/components/HURUmap/Panel/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ const Profile = forwardRef(function Profile(
geoCode = `${geoCode}-vs-${secondaryProfile?.geography?.code}`;
}

if (!categories?.length) {
return null;
}
return (
<div className={classes.profile} ref={ref}>
{isLoading && <Loading />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { hurumapArgs, panelArgs } from "@/pesayetu/config";
const { locations } = hurumapArgs;

export default {
title: "Components/HURUmap/Panel",
title: "HURUmap/Components/Panel",
argTypes: {},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PanelButtonGroup from ".";
import { panelArgs } from "@/pesayetu/config";

export default {
title: "Components/HURUmap/PanelButtonGroup",
title: "HURUmap/Components/PanelButtonGroup",
argTypes: {},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { hurumapArgs } from "@/pesayetu/config";
const { pinAndCompare } = hurumapArgs;

export default {
title: "Components/HURUmap/PinAndCompare",
title: "HURUmap/Components/PinAndCompare",
};

function Template({ ...args }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
import Source from ".";

export default {
title: "Components/Source",
title: "HURUmap/Components/Source",
argTypes: {},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
import SubcategoryHeader from "@/pesayetu/components/HURUmap/SubcategoryHeader";

export default {
title: "Components/HURUmap/SubcategoryHeader",
title: "HURUmap/Components/SubcategoryHeader",
argTypes: {},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import TreeView from "@/pesayetu/components/HURUmap/TreeView";
import { treeViewArgs } from "@/pesayetu/config";

export default {
title: "Components/HURUmap/TreeView",
title: "HURUmap/Components/TreeView",
argTypes: {},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { hurumapArgs } from "@/pesayetu/config";
const { tutorial } = hurumapArgs;

export default {
title: "Components/HURUmap/Tutorial",
title: "HURUmap/Components/Tutorial",
argTypes: {},
};

Expand Down
2 changes: 1 addition & 1 deletion apps/pesayetu/src/components/Header/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from "react";
import Header from ".";

export default {
title: "Components/Header",
title: "PesaYetu/Components/Header",
};

function Template({ title, ...args }) {
Expand Down
2 changes: 1 addition & 1 deletion apps/pesayetu/src/components/Hero/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Hero from ".";
import { searchArgs } from "@/pesayetu/config";

export default {
title: "Sections/Hero",
title: "PesaYetu/Sections/Hero",
argTypes: {
title: {
control: {
Expand Down
2 changes: 1 addition & 1 deletion apps/pesayetu/src/components/HowItWorks/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
import HowItWorks from ".";

export default {
title: "Sections/HowItWorks",
title: "PesaYetu/Sections/HowItWorks",
argTypes: {
title: {
control: {
Expand Down
2 changes: 1 addition & 1 deletion apps/pesayetu/src/components/InsightsData/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import InsightsData from "@/pesayetu/components/InsightsData";
import { insightData } from "@/pesayetu/config";

export default {
title: "Sections/InsightsData",
title: "PesaYetu/Sections/InsightsData",
argTypes: {},
};

Expand Down
2 changes: 1 addition & 1 deletion apps/pesayetu/src/components/Link/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
import Link from ".";

export default {
title: "Components/Link",
title: "PesaYetu/Components/Link",
argTypes: {
color: {
control: {
Expand Down
2 changes: 1 addition & 1 deletion apps/pesayetu/src/components/Loading/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
import Loading from ".";

export default {
title: "Components/Loading",
title: "PesaYetu/Components/Loading",
argTypes: {},
};

Expand Down
2 changes: 1 addition & 1 deletion apps/pesayetu/src/components/Menu/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Menu from ".";
import { navigationArgs } from "@/pesayetu/config";

export default {
title: "Components/Menu",
title: "PesaYetu/Components/Menu",
argTypes: {
links: {
control: {
Expand Down
2 changes: 1 addition & 1 deletion apps/pesayetu/src/components/Metrics/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Metrics from ".";
import { metrics } from "@/pesayetu/config";

export default {
title: "Sections/Metrics",
title: "PesaYetu/Sections/Metrics",
argTypes: {},
};

Expand Down
Loading

0 comments on commit 0ef334c

Please sign in to comment.