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
| class Dropdown extends Component { | |
| state = { | |
| show: false | |
| } | |
| componentDidMount() { | |
| document.addEventListener('click', this.handleClickOutside, true); | |
| } | |
| componentWillUnmount() { |
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
| sudo apt-get install unzip | |
| wget -N http://chromedriver.storage.googleapis.com/2.10/chromedriver_linux64.zip -P ~/Downloads | |
| unzip ~/Downloads/chromedriver_linux64.zip -d ~/Downloads | |
| chmod +x ~/Downloads/chromedriver | |
| sudo mv -f ~/Downloads/chromedriver /usr/local/share/chromedriver | |
| Change the directory to /usr/bin/chromedriver | |
| sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver | |
| sudo ln -s /usr/local/share/chromedriver /usr/bin/chromedriver | |
| Now run the script and add the following in the environment file. |
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
| class App extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| data: undefined, | |
| }; | |
| } | |
| componentWillMount() { |
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
| // Data | |
| var object = { 'a': [{ 'b': { 'c': 3 } }] }; | |
| var object2 = {a: { b: { c: 3 } } }; | |
| // Function helper to get the type of Param | |
| const getTypeOfParam = (value) => Object.prototype.toString.call(value).replace(/^\[object |\]$/g, '').toLowerCase(); | |
| const getIn = (obj, path, defaultValue) => { | |
| // validate params | |
| if (getTypeOfParam(obj) !== 'object') throw new TypeError('the first param should be a object'); | |
| if (getTypeOfParam(path) !== 'string') throw new TypeError('the second param should be a object'); |
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
| // Menu styles | |
| .menu { | |
| @extend %flex-container; | |
| box-shadow: 0px 2px 2px rgba(30, 30, 30, 0.42); | |
| height: 72px; | |
| top: 0; | |
| font-family: $font-family--primary; | |
| position: fixed; | |
| width: 100vw; | |
| z-index: 900; |
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() { | |
| "use strict"; | |
| angular.module('app') | |
| .controller('GeneralCtrl', GeneralCtrl); | |
| GeneralCtrl.$inject = ['$timeout', 'EnterpriseService', 'TouchPointService']; | |
| function GeneralCtrl($timeout, EnterpriseService, TouchPointService) { | |
| var vm = this; | |
| vm.test = 'test general trip'; |
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
| // GET USER DATA | |
| (function() { | |
| "use strict"; | |
| angular.module('app') | |
| .factory('GetUserService', GetUserService); | |
| GetUserService.$inject = ['$http', '$log', '$q', 'localStorageService']; | |
| function GetUserService($http, $log, $q, localStorageService) { |
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() { | |
| 'use strict'; | |
| angular.module('app', ['LocalStorageModule', | |
| 'cleave.js', | |
| 'ngAnimate', | |
| 'ngRoute', | |
| 'ui.router', | |
| 'templates']) | |
| .config(['$stateProvider', '$authProvider', '$urlRouterProvider', '$locationProvider', function ($stateProvider, $authProvider, $urlRouterProvider, $locationProvider) { | |
| $stateProvider |
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
| // children component | |
| class Children extends Component { | |
| state = { | |
| text: "text children" | |
| } | |
| changeText = () => { | |
| this.setState({ text: "text from parent" }) | |
| }; |
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'; | |
| export default class App extends React.Component { | |
| state: { | |
| searchText: '', | |
| data: [{id: 1, text: 'text 1'}, {id: 2, text: 'text 2'}] | |
| } | |
| renderFilteredData = () => { | |
| const { searchText, data } = this.state |