- check if zsh is default shell
- check if ~/.zshrc exists ?
- check if git is installed
- install git via brew
let parent = document.querySelector(".your-position-sticky-class").parentElement; | |
while (parent) { | |
const hasOverflow = getComputedStyle(parent).overflow; | |
if (hasOverflow !== "visible") { | |
console.log(hasOverflow, parent); | |
parent.style.overflow = "auto"; | |
} | |
parent = parent.parentElement; | |
} |
export const InputWithCounter = ({ maxLength, control, placeholder, name, rules }: Props) => { | |
const [counter, setCounter] = useState(0); | |
const handleInputCounter = (e: React.ChangeEvent<HTMLInputElement> | React.ChangeEvent<HTMLTextAreaElement>) => { | |
const value = e.target.value.length; | |
setCounter(value); | |
}; | |
return ( | |
<Controller | |
render={() => ( |
/* eslint-disable @typescript-eslint/camelcase */ | |
import React from 'react'; | |
import { ThemeProvider } from 'styled-components'; | |
import axiosMock from 'axios'; | |
import { render, waitForElement } from 'tests'; | |
import { theme } from 'assets/theme/theme'; | |
import { Home } from './Home'; |
// Without try catch | |
const doFetch = async (path) => { | |
const res = await fetch('https://api.github.com/users/' + path) | |
if (res.ok) { | |
return res.json() | |
} | |
throw await res.json() | |
} | |
// With try catch |
goToActivity(action, data, report, preview) { | |
let pageUrl = action.toLowerCase(); | |
const routeParams = { | |
date: moment().format(), | |
href: this.getCurrentUrlWithoutTabs(this.router.url), | |
report: data, | |
editMode: true, | |
reportData: report, | |
previewMode: preview | |
} |
import { NgModule } from '@angular/core'; | |
import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; | |
import { AuthGuard } from './guards/auth.guard'; | |
import { DataResolverService } from './resolver/data-resolver.service'; | |
const routes: Routes = [ | |
{ | |
path: '', | |
redirectTo: '/tabs', | |
pathMatch: 'full' |
import { Component, OnInit } from '@angular/core'; | |
import { ActivatedRoute, ActivatedRouteSnapshot, Router } from '@angular/router'; | |
import { NavController } from '@ionic/angular'; | |
import * as moment from 'moment'; | |
import { | |
textAreaLimitCharsLarge, | |
selectAllChildrenText, | |
unselectAllChildrenText, | |
TagColorsEnum | |
} from '../../../constants'; |
// useAuth.ts | |
export default () => { | |
const dispatch = useDispatch() | |
const currentUser = useSelector(selectCurrentUser) | |
console.log('current User in useAuth hook', currentUser) | |
useEffect(() => { | |
const setUser = (user: any) => { | |
if(user) { | |
dispatch(login({ uid: user.uid, email: user.email })) |
import React from 'react' | |
import styled from 'styled-components' | |
import dayjs from 'dayjs' | |
import { Link } from 'react-router-dom' | |
import { useDispatch } from 'react-redux' | |
import { EventModel } from '../interfaces' | |
import { showEventDetails } from '../reducers/event' | |
const EventItem = (props: any) => { |