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 axios from "axios"; | |
import { Storage } from "./utils/storage"; | |
const instance = axios.create({ | |
baseURL: process.env.API_URL, | |
timeout: 3000 | |
}); | |
const onRequestSuccess = config => { | |
console.log("request success", config); | |
const token = Storage.local.get("auth"); |
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 AuthLayoutMain = Loadable({ | |
loader: () => import('./features/auth/layout'), | |
loading: Loading | |
}); | |
<Route path={AUTH} component={AuthLayoutMain} /> | |
react.development.js?72d0:247 Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. |
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, { Component } from 'react'; | |
const asyncComponent = (importComponent) => { | |
return class extends Component { | |
state = { | |
component: null | |
} | |
componentDidMount () { | |
importComponent() |
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
.babelrc | |
{ | |
"presets": [ | |
"@babel/preset-env", | |
"@babel/preset-react" | |
], | |
"plugins": [["transform-class-properties",{ "spec": true }]] | |
} |
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
{ | |
"index": "/index.html", | |
"assetGroups": [{ | |
"name": "app", | |
"installMode": "prefetch", | |
"resources": { | |
"files": [ | |
"/favicon.ico", | |
"/index.html", | |
"/*.css", |
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 { configure, shallow } from 'enzyme'; | |
import Adapter from 'enzyme-adapter-react-16'; | |
import { Minus } from '../Icons/Icons'; | |
import Button from './Button'; | |
configure({adapter: new Adapter()}); |
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 classes from './Input.css'; | |
const input = ( props ) => { | |
let inputElement = null; | |
const inputClasses = [classes.InputElement]; | |
if (props.invalid && props.shouldValidate && props.touched) { | |
inputClasses.push(classes.Invalid); |
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
{ | |
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | |
"version": 1, | |
"newProjectRoot": "projects", | |
"projects": { | |
"blogial-client": { | |
"root": "", | |
"sourceRoot": "src", | |
"projectType": "application", | |
"prefix": "iwdf", |
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
HOC | |
import React, { Component } from 'react'; | |
const asyncComponent = (importComponent) => { | |
return class extends Component { | |
state = { | |
component: null | |
} |
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 class Store { | |
private subject = new BehaviorSubject<State>(state); | |
private store = this.subject.asObservable().distinctUntilChanged(); | |
get value() { | |
return this.subject.value; | |
} | |
select<T>(name: string): Observable<T> { |