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 from 'react'; | |
import { connect } from 'formik'; | |
class ErrorFocus extends React.Component { | |
componentDidUpdate(prevProps) { | |
const { isSubmitting, isValidating, errors } = prevProps.formik; | |
const keys = Object.keys(errors); | |
if (keys.length > 0 && isSubmitting && !isValidating) { | |
const selector = `[id="${keys[0]}"]`; | |
const errorElement = document.querySelector(selector); |
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
cd /home/<user>/ | |
sudo apt-get install unzip | |
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip | |
unzip sdk-tools-linux-4333796.zip -d Android | |
rm sdk-tools-linux-4333796.zip | |
sudo apt-get install -y lib32z1 openjdk-8-jdk | |
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 | |
export PATH=$PATH:$JAVA_HOME/bin | |
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc | |
cd Android/tools/bin |
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
/** | |
* Sort array of objects based on another array | |
*/ | |
function mapOrder (array, order, key) { | |
array.sort( function (a, b) { | |
var A = a[key], B = b[key]; | |