Skip to content

Commit

Permalink
nit: rename hook name
Browse files Browse the repository at this point in the history
  • Loading branch information
toddkao committed Jul 8, 2024
1 parent 601d228 commit 6d35179
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions packages/widget/src/ui/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLDivElement>,
Expand All @@ -27,7 +27,7 @@ export const SwapWidget: React.FC<SwapWidgetProps> = ({
style,
...swapWidgetProviderProps
}) => {
useInjectStyleToDocumentHead();
useInjectFontsToDocumentHead();
useEffect(() => {
configureSwapWidget({
colors,
Expand Down

0 comments on commit 6d35179

Please sign in to comment.