Skip to content

Commit

Permalink
remove oas ee new tag and update logic for displaying tag (#892)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fbasham authored Oct 5, 2023
1 parent 153d95c commit 9387f72
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions graphql/queries/projectQuery.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ query getAllProjects {
scTitleFr
scPageNameEn
scPageNameFr
scLabsNewExpiryDate
scBreadcrumbParentPages {
scTitleEn
scTitleFr
Expand Down
11 changes: 5 additions & 6 deletions pages/home.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import Head from "next/head";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import { Layout } from "../components/organisms/Layout";
import { useEffect, useState } from "react";
import { useEffect } from "react";
import Card from "../components/molecules/Card";
import aemServiceInstance from "../services/aemServiceInstance";
import { Heading } from "../components/design-system/Heading";
import { ContextualAlert } from "../components/design-system/ContextualAlert";

export default function Home(props) {
const [pageData] = useState(props.pageData.item);
const [experimentsData] = useState(props.experimentsData);
const pageData = props.pageData?.item;
const experimentsData = props.experimentsData;

const currentProjects = experimentsData.filter((project) => {
return (
Expand All @@ -23,9 +23,8 @@ export default function Home(props) {
<Card
showImage
showTag={
project.scTitleEn === "Old Age Security Benefits Estimator"
? true
: false
project.scLabsNewExpiryDate &&
Date.now() <= new Date(project.scLabsNewExpiryDate)
}
tagLabel={props.locale === "en" ? "New update" : "Nouvelle mise à jour"}
tag="new_update"
Expand Down

0 comments on commit 9387f72

Please sign in to comment.