Skip to content

Commit

Permalink
[C] replace react-uid
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgoff committed May 21, 2024
1 parent e411789 commit 1a7dca9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 32 deletions.
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

0 comments on commit 1a7dca9

Please sign in to comment.