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
load-nvmrc() { | |
local node_version="$(nvm version)" | |
local nvmrc_path="$(nvm_find_nvmrc)" | |
if [ -n "$nvmrc_path" ]; then | |
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")") | |
if [ "$nvmrc_node_version" = "N/A" ]; then | |
nvm install | |
elif [ "$nvmrc_node_version" != "$node_version" ]; then |
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 { withRouter, Redirect } from 'react-router-dom'; | |
const PrivateRoute = (WrappedComponent) => { | |
class PrivateRoute extends React.Component { | |
state = { | |
isLogged: false, | |
} | |
_checkAuthentication() { |
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 gql from 'graphql-tag'; | |
const USER_FRAGMENT = { | |
account: gql` | |
fragment AccountDetails on FinancialUserType { | |
id | |
username | |
firstName | |
lastName |
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
[ | |
{ | |
"title": "Classic zombies", | |
"picture": "https://via.placeholder.com/150x80/000000/FFFFFF/?text=Imagem+01", | |
"description": | |
"Slow, quiet and clumsy, the reason for these dead to reanimate is unknown. After a zombie apocalypse, all dead humans turn into zombies. Being bitten by a zombie results in illness and death. Can only be killed by massive brain trauma." | |
}, | |
{ | |
"title": "Voodoo Zombies", | |
"picture": "https://via.placeholder.com/150x80/000000/FFFFFF/?text=Imagem+02", |
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 { compose, withState, withHandlers } from "recompose"; | |
import { ModalComponent } from "./Modal"; | |
const hoc = compose( | |
withState("showModal", "updateModal", false), | |
withHandlers({ | |
onHandleModal: ({ updateModal, showModal }) => () => updateModal(!showModal), | |
onBtnSuccess: () => () => console.warn("Success"), |
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 PropTypes from "prop-types"; | |
import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from "reactstrap"; | |
export const ModalComponent = ({ | |
showModal, | |
onHandleModal, | |
onBtnSuccess, | |
onBtnCancel, | |
mainBtnLabel, |
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 { ModalComponent } from "./Modal"; | |
class ModalContainer extends React.Component { | |
state = { | |
showModal: false | |
}; | |
onHandleModal = () => { |
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 { compose, withState, mapProps } from 'recompose'; | |
const MyComponent = ({ myCounter, setCounter }) => ( | |
<div> | |
<h1>{myCounter}</h1> | |
<button onClick={() => setCounter(myCounter + 1)}>Add</button> | |
<button onClick={() => setCounter(myCounter - 1)}>Remove</button> | |
</div> | |
); |
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 { compose, withState, withHandlers } from 'recompose'; | |
const MyComponent = ({ counter, increment, decrement, reset }) => ( | |
<div> | |
<h2>{counter}</h2> | |
<button onClick={increment}>Add</button> | |
<button onClick={decrement}>Remove</button> | |
<button onClick={reset}>Reset</button> | |
</div> |
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 { nest } from 'recompose'; | |
const Header = ({ children }) => ( | |
<div> | |
<header>HEY!</header> | |
{children} | |
</div> | |
); |
NewerOlder