Icon component

This commit is contained in:
Max Lynch
2020-12-22 17:27:45 -06:00
parent 5e2bd30d72
commit 91ca416c9f
12 changed files with 132 additions and 34 deletions
+4 -5
View File
@@ -4,18 +4,17 @@ import { useDrag } from 'react-use-gesture';
import Store from '../../store';
import { SafeAreaContext } from './SafeArea';
// A Modal window that slides in from offscreen and can be closed
// by dragging.
const Modal = ({ open, onClose, children }) => {
const ref = useRef();
const [dragging, setDragging] = useState(false);
const [rect, setRect] = useState(null);
const [y, setY] = useState(100000);
const { top } = useContext(SafeAreaContext);
const safeAreaTop = top;
const { top: safeAreaTop } = useContext(SafeAreaContext);
const _open = useCallback(() => {
console.log('Opening modal!', safeAreaTop);
setY(safeAreaTop);
}, [safeAreaTop]);
@@ -75,7 +74,7 @@ const Modal = ({ open, onClose, children }) => {
ref={ref}
{...bind()}
className={classNames(
'fixed z-40 top-5 transform transform-gpu ranslate w-full h-full bg-white rounded-t-xl',
'fixed z-40 top-5 transform transform-gpu w-full h-full bg-white rounded-t-xl',
{
'ease-in-out duration-300 transition-transformation': !dragging,
}