From 731af8b7430c3b4966e44bdc9739597d526aed51 Mon Sep 17 00:00:00 2001 From: Jonathan Sick Date: Wed, 3 Apr 2024 14:36:08 -0400 Subject: [PATCH] Include urlQueryString in context This makes it easier for users to append the query string to base URLs provided by Times Square's API. --- .../TimesSquareUrlParametersProvider.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/squareone/src/components/TimesSquareUrlParametersProvider/TimesSquareUrlParametersProvider.js b/apps/squareone/src/components/TimesSquareUrlParametersProvider/TimesSquareUrlParametersProvider.js index 40e3a5e6..d2059f5a 100644 --- a/apps/squareone/src/components/TimesSquareUrlParametersProvider/TimesSquareUrlParametersProvider.js +++ b/apps/squareone/src/components/TimesSquareUrlParametersProvider/TimesSquareUrlParametersProvider.js @@ -44,6 +44,8 @@ export default function TimesSquareUrlParametersProvider({ children }) { .map((item) => item) ); + const queryString = new URLSearchParams(userParameters).toString(); + // pop display settings from the user parameters and to also separate out // the notebook parameters. const { ts_hide_code = '1', ...notebookParameters } = userParameters; @@ -60,6 +62,7 @@ export default function TimesSquareUrlParametersProvider({ children }) { commit, tsSlug, githubSlug, + urlQueryString: queryString, }} > {children}