This file contains 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 GamesService from '../../services/games' | |
import store from '../index' | |
function getGamesAction () { | |
return async (dispatch) => { | |
dispatch({ type: 'GET_GAMES_REQUEST'}) | |
try { | |
const { data } = await GamesService.getGames() |
This file contains 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
// We use useImperativeHandle for having ability to call methods from parent component. | |
// We use onMessage method from WebView for triggering needed states from any web apps. | |
import React, { forwardRef, useImperativeHandle, useRef, memo } from 'react' | |
import { WebView } from 'react-native-webview' | |
const WebViewLink = forwardRef(({ onMessage }, ref) => { | |
const webviewRef = useRef() |
This file contains 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
// We use react-hook-form library for form validations | |
// We use react-native-elements library for UI components | |
import React from 'react' | |
import { useSelector, useDispatch } from 'react-redux' | |
import { StatusBar, View, TextInput, ActivityIndicator } from 'react-native' | |
import { Button, Text } from 'react-native-elements' | |
import { useForm } from 'react-hook-form' |
This file contains 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 { instance } from '../../api' | |
const state = { | |
statsGeneral: [], | |
loadingStatsGeneral: true, | |
statsClients: [], | |
loadingStatsClients: true | |
} |
This file contains 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 { Alert } from 'react-native' | |
import axios from 'axios' | |
import SocketService from './socket' | |
import store, { actions } from '../store' | |
import config from '../config' |
This file contains 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
// pages/_app.js | |
import React from 'react' | |
import CookiesUtils from '../utils/cookies' | |
const App = () => { | |
// ... | |
} |
This file contains 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
// pages/index.js | |
import React, { useEffect } from 'react' | |
import CookiesUtils from '../utils/cookies' | |
const HomePage = () => { | |
useEffect(() => { | |
CookiesUtils.getItem('server-side-cookies') // Output: Aloha from server side cookies! |
This file contains 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
export const state = () => ({ | |
signinLoading: false, | |
logoutLoading: false, | |
}) | |
export const getters = { | |
signinLoading: (state) => state.signinLoading, | |
logoutLoading: (state) => state.logoutLoading, | |
} |
OlderNewer