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

Release #445

Merged
merged 2 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions components/atomic/Tile/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from "prop-types";
import { useUID } from "react-uid";
import { useId } from "react";
import classNames from "classnames";
import {
ResponsiveImage,
Expand All @@ -25,7 +25,7 @@ const Tile = ({
type = "related",
showSharePopup,
}) => {
const uid = useUID();
const uid = useId();
const { siteInfo } = useGlobalData();
const finalImage =
type === "jobs" ? image : image || siteInfo?.siteImage?.[0];
Expand Down
4 changes: 2 additions & 2 deletions components/atomic/Tile/patterns/InvestigationTile/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useId } from "react";
import PropTypes from "prop-types";
import { useUID } from "react-uid";
import { Image } from "@rubin-epo/epo-react-lib";
import * as Styled from "./styles";
import { useTranslation } from "react-i18next";
import { imageShaper } from "@/lib/utils";

const InvestigationTile = ({ investigation, useExternalLink }) => {
const uid = useUID();
const uid = useId();

const { t } = useTranslation();
const { cantoAssetSingle, status, title, externalUrl, landingPage } =
Expand Down
4 changes: 2 additions & 2 deletions components/atomic/Tile/patterns/SlideTile/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from "prop-types";
import { useUID } from "react-uid";
import { useId } from "react";
import classNames from "classnames";
import {
ResponsiveImage,
Expand All @@ -22,7 +22,7 @@ const SlideTile = ({
titleTag = "h3",
type = "related",
}) => {
const uid = useUID();
const uid = useId();
const { siteInfo } = useGlobalData();
const finalImage =
type === "jobs" ? image : image || siteInfo?.siteImage?.[0];
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
"react-is": "^18.2.0",
"react-player": "^2.12.0",
"react-popper": "^2.3.0",
"react-uid": "^2.3.2",
"striptags": "^3.2.0",
"styled-components": "5.3.11",
"swr": "^1.3.0",
Expand Down
47 changes: 22 additions & 25 deletions pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import PropTypes from "prop-types";
import "@/lib/i18n";
import "focus-visible";
import { UIDReset } from "react-uid";
import Script from "next/script";
import { AuthenticationContextProvider } from "@/contexts/Authentication";
import useAuthentication from "@/hooks/useAuthentication";
Expand All @@ -23,23 +22,22 @@ function Client({ Component, pageProps }) {
});

return (
<UIDReset>
<AuthenticationContextProvider data={authData}>
{PLAUSIBLE_DOMAIN && (
<AuthenticationContextProvider data={authData}>
{PLAUSIBLE_DOMAIN && (
<Script
id="plausible-script"
data-domain={PLAUSIBLE_DOMAIN}
src="https://plausible.io/js/plausible.js"
strategy="afterInteractive"
/>
)}
{SURVEY_SPARROW && (
<>
<div id="ss_survey_widget"></div>
<Script
id="plausible-script"
data-domain={PLAUSIBLE_DOMAIN}
src="https://plausible.io/js/plausible.js"
strategy="afterInteractive"
/>
)}
{SURVEY_SPARROW && (
<>
<div id="ss_survey_widget"></div>
<Script
id="SS_SCRIPT"
dangerouslySetInnerHTML={{
__html: `
id="SS_SCRIPT"
dangerouslySetInnerHTML={{
__html: `
function sparrowLaunch(opts) {
// eslint-disable-next-line no-var, one-var
var e = "ss-widget",
Expand Down Expand Up @@ -89,14 +87,13 @@ function Client({ Component, pageProps }) {
}
sparrowLaunch({sparrowLang: "${lang}"});
`,
}}
/>
</>
)}
<GlobalStyles />
<Component {...pageProps} />
</AuthenticationContextProvider>
</UIDReset>
}}
/>
</>
)}
<GlobalStyles />
<Component {...pageProps} />
</AuthenticationContextProvider>
);
}

Expand Down
6 changes: 6 additions & 0 deletions pages/api/revalidate.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
/* eslint-disable no-console */
import { isCraftPreview } from "@/helpers";

async function handler(req, res) {
const { query } = req;
const isPreview = isCraftPreview(query);

console.debug({
serverToken: process.env.CRAFT_REVALIDATE_SECRET_TOKEN,
receivedToken: query.secret,
});

if (isPreview) {
return res.status(401).json({
message:
Expand Down
Loading