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 default [ | |
{ | |
text: "Afghanistan (+93)", | |
value: "+93", | |
flag: "af", | |
key: "af", | |
}, | |
{ | |
text: "Aland Islands", | |
value: "", |
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
{ | |
"AED": "United Arab Emirates Dirham", | |
"AFN": "Afghan Afghani", | |
"ALL": "Albanian Lek", | |
"AMD": "Armenian Dram", | |
"ANG": "Netherlands Antillean Guilder", | |
"AOA": "Angolan Kwanza", | |
"ARS": "Argentine Peso", | |
"AUD": "Australian Dollar", | |
"AWG": "Aruban Florin", |
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 AsyncStorage from '@react-native-async-storage/async-storage'; | |
import axios, {AxiosError} from 'axios'; | |
import {logOutUserLocal} from 'redux/actions/auth/logout/clearAllUser'; | |
import store from 'redux/store'; | |
import envs from 'config/env'; | |
// Getting token from local Storage | |
async function getLocalToken() { | |
const token = await AsyncStorage.getItem('token'); | |
return `Bearer ${token}`; |
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
Here is how you can do it when the items in the arrays are objects. | |
The idea is to find the array of only the keys in an inner array using the map function | |
Then foreach of those check if they contain a spectific element key in the outer array. | |
const existsInBothArrays = array1.filter((element1) => | |
array2.map((element2) => element2._searchKey).includes(element1._searchKey), | |
); |
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 AsyncStorage from '@react-native-async-storage/async-storage'; | |
import axios from 'axios'; | |
import envs from '../config/env'; | |
import {LOGOUT} from '../constants/routeNames'; | |
import * as RootNavigation from '../navigations/RootNavigation'; | |
let headers = {}; | |
const axiosInstance = axios.create({ | |
baseURL: envs.BACKEND_URL, |
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
const initialItemsRef = useRef([]); | |
useEffect(() => { | |
if (userItems.length) { | |
const prev = initialItemsRef.current; | |
initialWalletsRef.current = <whatToCheckForChanges>; | |
const newones = initialItemsRef.current; | |
if (newones.length - prev.length === 1) { | |
const difference = newones.find((x) => !prev.map((i) => i.AccountNumber).includes(x.AccountNumber)); |
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 "./App.css"; | |
import { useState } from "react"; | |
function App() { | |
const options = [ | |
{ | |
header: { | |
name: "Account", | |
}, |
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 React, { useState } from "react"; | |
import "./style.css"; | |
const DynamicHeightInput = () => { | |
const [textareaHeight, setTextareaHeight] = useState(42); | |
const [formValue, setFormValue] = useState({}); | |
const onChange = (event) => { | |
event.preventDefault(); | |
event.persist(); |
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 React, { useState } from "react"; | |
import "./App.css"; | |
function App() { | |
const [form, setForm] = useState([]); | |
const [submitted, setFormSubmitted] = useState(false); | |
const someEmpty = form.some( | |
(item) => item.Platform === "" || item.Username === "" | |
); |
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
from rest_framework.views import exception_handler | |
from rest_framework import status | |
from django.http import Http404 | |
def custom_exception_handler(exc, context): | |
""" | |
This function will handle errors that are returned by | |
the different views. | |
The `handlers` dictionary will map |