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
| <div class="text-right"> | |
| <div class="custom-control custom-switch"> | |
| <mat-checkbox type="checkbox" | |
| class="custom-control-input" | |
| id="darkMode" | |
| [checked]="isThemeDark | async" | |
| (change)="toggleDarkTheme($event)"> | |
| <label class="custom-control-label" for="darkMode"></label> | |
| <a class="text-capitalize">Dark Mode</a> | |
| </mat-checkbox> |
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
| getLocation() { | |
| let locate = ''; | |
| if (navigator.geolocation) { | |
| // console.log(navigator.geolocation.getCurrentPosition(this.showPosition)); | |
| locate = navigator.geolocation.getCurrentPosition(this.showPosition); | |
| } else { | |
| locate = 'No Location'; | |
| console.log(locate); |
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
| export default class App extends Component { | |
| state = { | |
| endpoint: 'http://test.sample.com' | |
| } | |
| envUsage = (environment) => { | |
| if (environment == 'testing') { | |
| this.setState({ endpoint: 'http://test.sample.com' }) | |
| } |
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
| getAnswer(event) { | |
| if (event.target.name == 'q1') { | |
| this.setState({ q1: event.target.value }); | |
| } | |
| else if (event.target.name == 'q2') { | |
| this.setState({ q2: event.target.value }); | |
| } | |
| else if (event.target.name == 'q3') { | |
| this.setState({ q3: event.target.value }); | |
| } |
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 { connect } from "react-redux"; | |
| import { | |
| GetUsers | |
| } from "./app/redux/actions/taskAction"; | |
| class App extends React.Component { | |
| constructor(props) { |
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
| // Child | |
| import React, { useState, Component } from 'react'; | |
| import Input from '../../shared/input-box/InputBox' | |
| const Form = function (props) { | |
| const {toggle, toggler} = props; | |
| const [value, setValue] = useState(''); |
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
| // check if any object is same in two array of abjects | |
| const matchedRoles = []; | |
| allRoles.forEach(role => { | |
| const matchRoles = userRoles.map(userRole => { | |
| if (role.id === userRole.id) { | |
| // console.log(userRole.id); | |
| matchedRoles.push(userRole.id); | |
| // console.log(matchedRoles.indexOf(userRole.id)) | |
| } |
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, { useState } from 'react'; | |
| import TextField from '@material-ui/core/TextField'; | |
| import Grid from '@material-ui/core/Grid'; | |
| import DialogContent from '@material-ui/core/DialogContent'; | |
| const RoleDetailsDialog = function (props) { | |
| const handleChange = e => { | |
| // console.log("dialog input values >", { |
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
| // filtered data list from searchbox component - callback | |
| callbackFunction = (filteredData) => { | |
| this.setState({numbers: filteredData}); | |
| console.log(filteredData); | |
| } | |
| class Conversations extends Component { | |
| state = { |
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
| filterUniqueItems(arr) { | |
| let mymap = new Map(); | |
| let uniqueItems = arr.filter(el => { | |
| const val = mymap.get(el.text); | |
| if(val) { | |
| if(el.type < val) { | |
| mymap.delete(el.text); | |
| mymap.set(el.text, el.type); | |
| return true; |