refactor(frontend): titlecard behavior changed to allow clicking anywhere to go through to title

mobile behavior remains mostly the same, except after the first click, a second click anywhere else
will go through to the title.
This commit is contained in:
sct
2020-12-15 15:49:59 +00:00
parent 7c08809501
commit e8776fd336
5 changed files with 272 additions and 154 deletions

View File

@@ -0,0 +1,20 @@
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>
);
};