Skip to content

Commit

Permalink
sorted project updates by date on old design (#1059)
Browse files Browse the repository at this point in the history
* sorted project updates by date on old design

* updated updatesData variable on project pages
  • Loading branch information
blai0264 authored Jul 5, 2024
1 parent e3f7206 commit b5c8b0b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
5 changes: 5 additions & 0 deletions lib/utils/sortUpdatesByDate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const sortUpdatesByDate = (array) => {
return [...array].sort((a, b) => {
return b.scDateModifiedOverwrite.localeCompare(a.scDateModifiedOverwrite);
});
};
3 changes: 2 additions & 1 deletion pages/projects/benefits-navigator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ import { Collapse } from "../../../components/molecules/Collapse";
import Image from "next/image";
import stageDictionary from "../../../lib/utils/stageDictionary";
import TextRender from "../../../components/text_node_renderer/TextRender";
import { sortUpdatesByDate } from "../../../lib/utils/sortUpdatesByDate";

export default function BenefitsNavigatorOverview(props) {
const [pageData] = useState(props.pageData.item);
const [updatesData] = useState(props.updatesData);
const updatesData = sortUpdatesByDate(props.updatesData);
const [filteredDictionary] = useState(
props.dictionary.items.filter(
(item) =>
Expand Down
3 changes: 2 additions & 1 deletion pages/projects/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import stageDictionary from "../../../lib/utils/stageDictionary";
import TextRender from "../../../components/text_node_renderer/TextRender";
import Card from "../../../components/molecules/Card";
import FragmentRender from "../../../components/fragment_renderer/FragmentRender";
import { sortUpdatesByDate } from "../../../lib/utils/sortUpdatesByDate";

export default function MscaDashboard(props) {
const pageData = props.pageData?.item;
const updatesData = props.updatesData;
const updatesData = sortUpdatesByDate(props.updatesData);

const filteredDictionary = props.dictionary?.items?.filter(
(item) =>
Expand Down
3 changes: 2 additions & 1 deletion pages/projects/digital-standards-playbook/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import { Heading } from "../../../components/molecules/Heading";
import { ActionButton } from "../../../components/atoms/ActionButton";
import Image from "next/image";
import stageDictionary from "../../../lib/utils/stageDictionary";
import { sortUpdatesByDate } from "../../../lib/utils/sortUpdatesByDate";

export default function DigitalStandardsPlaybookPage(props) {
const [pageData] = useState(props.pageData.item);
const [updatesData] = useState(props.updatesData);
const updatesData = sortUpdatesByDate(props.updatesData);

const filteredDictionary = props.dictionary?.items?.filter(
(item) =>
Expand Down
3 changes: 2 additions & 1 deletion pages/projects/making-easier-get-benefits/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ import { Heading } from "../../../components/molecules/Heading";
import TextRender from "../../../components/text_node_renderer/TextRender";
import Image from "next/image";
import stageDictionary from "../../../lib/utils/stageDictionary";
import { sortUpdatesByDate } from "../../../lib/utils/sortUpdatesByDate";

export default function IntegratedChannelStrategyPage(props) {
const [pageData] = useState(props.pageData.item);
const [updatesData] = useState(props.updatesData);
const updatesData = sortUpdatesByDate(props.updatesData);
const [filteredDictionary] = useState(
props.dictionary.items.filter(
(item) =>
Expand Down
3 changes: 2 additions & 1 deletion pages/projects/oas-benefits-estimator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import { createBreadcrumbs } from "../../../lib/utils/createBreadcrumbs";
import { Heading } from "../../../components/molecules/Heading";
import Image from "next/image";
import stageDictionary from "../../../lib/utils/stageDictionary";
import { sortUpdatesByDate } from "../../../lib/utils/sortUpdatesByDate";

export default function OasBenefitsEstimator(props) {
const [pageData] = useState(props.pageData.item);
const [updatesData] = useState(props.updatesData);
const updatesData = sortUpdatesByDate(props.updatesData);
const [filteredDictionary] = useState(
props.dictionary.items.filter(
(item) =>
Expand Down

0 comments on commit b5c8b0b

Please sign in to comment.