Skip to content

Commit

Permalink
update story
Browse files Browse the repository at this point in the history
  • Loading branch information
mkosir committed Oct 30, 2019
1 parent 0a62c8e commit 5c31dd1
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions stories/Flashlight/Flashlight.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
import React, { useRef } from 'react';
import React from 'react';

import useMightyMouse from '../../src';
import './Flashlight.scss';
import imgFlashlight from './img/flashlight.png';

const Flashlight = () => {
let toggleFlashlight = useRef(true);

const {
position: {
page: { x, y },
},
eventType,
} = useMightyMouse();
if (eventType === 'mousedown') {
toggleFlashlight.current = !toggleFlashlight.current;
}

const style = {
backgroundImage: toggleFlashlight.current ? `url(${imgFlashlight})` : null,
backgroundImage: x && y ? `url(${imgFlashlight})` : null,
backgroundPositionX: x - 200,
backgroundPositionY: y - 350,
};
Expand Down

0 comments on commit 5c31dd1

Please sign in to comment.