This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import './SwipeableListItem.css' | |
| import React, {useRef, useEffect} from 'react' | |
| function SwipeableListItem(props) { | |
| const listElementRef = useRef() | |
| const wrapperRef = useRef() | |
| const backgroundRef = useRef() | |
| const dragStartXRef = useRef(0) | |
| const leftRef = useRef(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| //source: http://blog.guya.net/2015/06/12/sharing-sessionstorage-between-tabs-for-secure-multi-tab-authentication/ | |
| if (!sessionStorage.length) { | |
| // Ask other tabs for session storage | |
| localStorage.setItem('getSessionStorage', Date.now()); | |
| }; | |
| window.addEventListener('storage', function(event) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import moment from 'moment'; | |
| import { | |
| LocaleResolver, | |
| NavigatorDetector, | |
| FallbacksTransformer, | |
| DefaultLocaleTransformer, | |
| } from 'locales-detector'; | |
| // moment locales are in lowercase, need it change en-GB to en-gb | |
| class LowerCaseTransformer { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function MyResponsiveComponent() { | |
| const width = useWindowWidth(); // Our custom Hook | |
| return ( | |
| <p>Window width is {width}</p> | |
| ); | |
| } |