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 React from 'react' | |
import RNRestart from 'react-native-restart' | |
import { ErrorScreen } from '~/newUI' | |
interface Props { | |
children: React.ReactNode | |
} | |
interface State { | |
error: boolean |
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
GLOBAL.XMLHttpRequest = GLOBAL.originalXMLHttpRequest || GLOBAL.XMLHttpRequest; | |
//use it on anywhere in global scope |
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 React, { useMemo } from 'react' | |
import { Dimensions, StyleSheet } from 'react-native' | |
import { Divider } from 'react-native-elements' | |
import TextWithCircle from '~/components/TextWithCircle' | |
import { Colors, Spacing, Typography, View } from '~/newUI' | |
import format from '~/services/format' | |
interface Data { | |
value: number; | |
color: string; |
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
shadow: { | |
backgroundColor: 'white', | |
borderRadius: 6, | |
borderWidth: 1, | |
borderColor: Colors.mercury, | |
shadowColor: 'rgba(0,0,0,0.7)', | |
shadowOffset: { | |
width: 0, | |
height: 2 | |
}, |
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
const useMount = func => useEffect(() => func(), []) | |
const useInitialURL = () => { | |
const [url, setUrl] = useState(null) | |
const [processing, setProcessing] = useState(true) | |
useMount(() => { | |
const getUrlAsync = async () => { | |
// Get the deep link used to open the app | |
const initialUrl = await Linking.getInitialURL() |
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 React, { useEffect, Fragment } from 'react'; | |
import { withRouter } from 'react-router-dom'; | |
function ScrollToTop({ history, children }) { | |
useEffect(() => { | |
const unlisten = history.listen(() => { | |
window.scrollTo(0, 0); | |
}); | |
return () => { | |
unlisten(); |
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 { GetRepositoryInfoDocument, useGetRepositoryInfoQuery } from 'queries/generated/hooks'; | |
import { MockedProvider } from '@apollo/client/testing'; | |
import { renderHook } from '@testing-library/react-hooks'; | |
export const queryMock = [ | |
{ | |
request: { | |
query: GetRepositoryInfoDocument, | |
variables: { |
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
const submitFeedbackToSentry = async ({ eventId, name, email, comments }: SubmitFeedbackToSentryOptions) => { | |
const response = await fetch(`https://sentry.io/api/0/projects/{COMPANY}/${SENTRY_PROJECT}/user-feedback/`, { | |
method: 'POST', | |
headers: { | |
'Content-Type': 'application/json', | |
Authorization: `DSN ${ENVS.SENTRY_DSN}` | |
}, | |
body: JSON.stringify({ | |
event_id: eventId, | |
name, |
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 React, { useRef, useState } from 'react' | |
// Import Swiper React components | |
import { Swiper, SwiperSlide } from 'swiper/react' | |
import 'swiper/swiper.min.css' | |
import 'swiper/components/pagination/pagination.min.css' | |
import 'swiper/components/navigation/navigation.min.css' | |
import './styles.scss' | |
import SwiperCore, { Navigation, Virtual } from 'swiper/core' | |
// install Swiper modules |
OlderNewer