feat: DOM scale context

This commit is contained in:
cha0s 2024-07-12 00:00:48 -05:00
parent 375b83f366
commit d086f802f8
2 changed files with 13 additions and 1 deletions

9
app/context/dom-scale.js Normal file
View File

@ -0,0 +1,9 @@
import {createContext, useContext} from 'react';
const context = createContext();
export default context;
export function useDomScale() {
return useContext(context);
}

View File

@ -1,6 +1,7 @@
import {useEffect, useRef, useState} from 'react'; import {useEffect, useRef, useState} from 'react';
import {RESOLUTION} from '@/constants.js'; import {RESOLUTION} from '@/constants.js';
import DomContext from '@/context/dom-scale.js';
import styles from './dom.module.css'; import styles from './dom.module.css';
@ -35,7 +36,9 @@ export default function Dom({children}) {
} }
`}</style> `}</style>
)} )}
<DomContext.Provider value={scale}>
{children} {children}
</DomContext.Provider>
</div> </div>
); );
} }