From 6d351796c41f5461c954b0e7dca0715519a62571 Mon Sep 17 00:00:00 2001 From: todd kao Date: Mon, 8 Jul 2024 14:45:29 -0400 Subject: [PATCH] nit: rename hook name --- ...-document-head.ts => use-inject-fonts-to-document-head.ts} | 2 +- packages/widget/src/ui/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename packages/widget/src/hooks/{use-inject-style-to-document-head.ts => use-inject-fonts-to-document-head.ts} (88%) diff --git a/packages/widget/src/hooks/use-inject-style-to-document-head.ts b/packages/widget/src/hooks/use-inject-fonts-to-document-head.ts similarity index 88% rename from packages/widget/src/hooks/use-inject-style-to-document-head.ts rename to packages/widget/src/hooks/use-inject-fonts-to-document-head.ts index 7b52dd831..d3a091a66 100644 --- a/packages/widget/src/hooks/use-inject-style-to-document-head.ts +++ b/packages/widget/src/hooks/use-inject-fonts-to-document-head.ts @@ -1,7 +1,7 @@ import { useEffect } from 'react'; import { fonts } from '../styles/fonts'; -export const useInjectStyleToDocumentHead = () => { +export const useInjectFontsToDocumentHead = () => { useEffect(() => { const styleElement = document.createElement('style'); styleElement.textContent = fonts; diff --git a/packages/widget/src/ui/index.tsx b/packages/widget/src/ui/index.tsx index 05ab50dad..e520b5441 100644 --- a/packages/widget/src/ui/index.tsx +++ b/packages/widget/src/ui/index.tsx @@ -8,7 +8,7 @@ import { SwapWidgetUI } from './Widget'; import shadowDomStyles from '../styles/shadowDomStyles.css'; import toastStyles from '../styles/toastStyles.css'; import { Scope } from 'react-shadow-scope'; -import { useInjectStyleToDocumentHead } from '../hooks/use-inject-style-to-document-head'; +import { useInjectFontsToDocumentHead } from '../hooks/use-inject-fonts-to-document-head'; export type SwapWidgetProps = Pick< React.HTMLAttributes, @@ -27,7 +27,7 @@ export const SwapWidget: React.FC = ({ style, ...swapWidgetProviderProps }) => { - useInjectStyleToDocumentHead(); + useInjectFontsToDocumentHead(); useEffect(() => { configureSwapWidget({ colors,