diff --git a/app/context/dom-scale.js b/app/context/dom-scale.js new file mode 100644 index 0000000..982edb3 --- /dev/null +++ b/app/context/dom-scale.js @@ -0,0 +1,9 @@ +import {createContext, useContext} from 'react'; + +const context = createContext(); + +export default context; + +export function useDomScale() { + return useContext(context); +} diff --git a/app/react-components/dom.jsx b/app/react-components/dom.jsx index b041c7a..d5207aa 100644 --- a/app/react-components/dom.jsx +++ b/app/react-components/dom.jsx @@ -1,6 +1,7 @@ import {useEffect, useRef, useState} from 'react'; import {RESOLUTION} from '@/constants.js'; +import DomContext from '@/context/dom-scale.js'; import styles from './dom.module.css'; @@ -35,7 +36,9 @@ export default function Dom({children}) { } `} )} - {children} + + {children} + ); }