mobile behavior remains mostly the same, except after the first click, a second click anywhere else will go through to the title.
21 lines
472 B
TypeScript
21 lines
472 B
TypeScript
import React from 'react';
|
|
import useInteraction from '../hooks/useInteraction';
|
|
|
|
interface InteractionContextProps {
|
|
isTouch: boolean;
|
|
}
|
|
|
|
export const InteractionContext = React.createContext<InteractionContextProps>({
|
|
isTouch: false,
|
|
});
|
|
|
|
export const InteractionProvider: React.FC = ({ children }) => {
|
|
const isTouch = useInteraction();
|
|
|
|
return (
|
|
<InteractionContext.Provider value={{ isTouch }}>
|
|
{children}
|
|
</InteractionContext.Provider>
|
|
);
|
|
};
|