Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const HomePage = () => {
const appRef = React.useRef(null);
const { docX, docY } = useMouse(appRef);
const dispatch = useDispatch();
const { counter, resetLoading } = useSelector(state => ({
counter: state.get('Home').get('counter'),
resetLoading: state.get('Home').get('resetLoading')
}), shallowEqual);
const [rect, ref] = useClientRect();
const center = getCoordinates(rect !== null ? rect : {});
const increment = () => {
dispatch(incrementCounter(counter));
};
const decrement = () => {
dispatch(decrementCounter(counter));
};
const MouseRain = () => {
const ref = useRef(null)
const { docX } = useMouse(ref)
const activeProps = docX ? {
confettiSource: {
w: 0,
h: 0,
x: docX,
y: 0,
},
} : {
run: false,
}
return (
<>
<p style="{{">Move your mouse</p>
function WinXP() {
const [state, dispatch] = useReducer(reducer, initState);
const ref = useRef(null);
const mouse = useMouse(ref);
const focusedAppId = getFocusedAppId();
const onFocusApp = useCallback(id => {
dispatch({ type: FOCUS_APP, payload: id });
}, []);
const onMaximizeWindow = useCallback(
id => {
if (focusedAppId === id) {
dispatch({ type: TOGGLE_MAXIMIZE_APP, payload: id });
}
},
[focusedAppId],
);
const onMinimizeWindow = useCallback(
id => {
if (focusedAppId === id) {
dispatch({ type: MINIMIZE_APP, payload: id });
function WinXP() {
const [state, dispatch] = useReducer(reducer, initState);
const ref = useRef(null);
const mouse = useMouse(ref);
function onFocusApp(id) {
dispatch({ type: 'FOCUS_APP', payload: id });
}
function onMaximizeWindow(id) {
if (getFocusedAppId() === id && state.focusing === 'window') {
dispatch({ type: 'TOGGLE_MAXIMIZE_APP', payload: id });
}
}
function onMinimizeWindow(id) {
if (getFocusedAppId() === id && state.focusing === 'window') {
dispatch({ type: 'MINIMIZE_APP', payload: id });
}
}
function onMouseDownFooterApp(id) {
if (getFocusedAppId() === id) {
dispatch({ type: 'MINIMIZE_APP', payload: id });