Need a server for your single page app?
npm install --save dotenv express path body-parser compression express-sslify
| import { useEffect, useRef } from 'react'; | |
| type KeyboardRef = (event: KeyboardEvent) => void; | |
| const useKeypress = (keys: string[], handler?: (e: KeyboardEvent) => void) => { | |
| const eventListenerRef = useRef<KeyboardRef | null>(null); | |
| useEffect(() => { | |
| eventListenerRef.current = (event: KeyboardEvent) => { | |
| if (Array.isArray(keys) ? keys.includes(event.key) : keys === event.key) { |
| --- | |
| schedule: | |
| F: | |
| - Bridges | |
| - Squats | |
| M: | |
| - Pushups | |
| - "Leg Raises" | |
| - Pullups | |
| Sa: ~ |
| SHELL := /bin/bash | |
| include .env | |
| export $(shell sed 's/=.*//' .env) | |
| all: ui api | |
| ui: | |
| export REACT_APP_REDIRECT_URI=${BASE_URL}/authed\ | |
| export REACT_APP_SCOREBOT_API=${BASE_URL}/api/\ | |
| export REACT_APP_SCOREBOT_CLIENT_ID=${CLIENT_ID};\ |
| type FAQDialogProps = RouteComponentProps<any>; | |
| const FAQDialog: React.SFC<FAQDialogProps> = props => { | |
| const shouldRender = get(props, "location.state.showFAQWindow"); | |
| if (!shouldRender) { | |
| return null; | |
| } | |
| return ( | |
| <Dialog scroll="body" maxWidth={"md"} open={true}> |
| import TextField, { TextFieldProps } from "@material-ui/core/TextField"; | |
| import flat from "flat"; | |
| import { FieldProps } from "formik"; | |
| import React from "react"; | |
| import { I18n } from "react-i18next"; | |
| import { FlatErrors, FlatTouched } from "../../types/Forms"; | |
| interface Props extends FieldProps, TextFieldProps {} | |
| const FormTextField: React.SFC<Props> = ({ |
| import React from 'react'; | |
| import SortableJS from 'sortablejs'; | |
| import animatedScrollTo from 'animated-scroll-to'; | |
| class Sortable extends React.Component { | |
| componentDidMount() { | |
| const container = document.getElementById(this.props.container); | |
| const scroller = document.getElementById('scroller'); | |
| const sortable = SortableJS.create(container, { | |
| handle: '.foobar', |
| import PropTypes from "prop-types"; | |
| import React from "react"; | |
| import * as api from 'somewhere/api' | |
| class Provider extends React.Component { | |
| childContextTypes = { | |
| api: PropTypes.object, | |
| }; |
| # Your init script | |
| # | |
| # Atom will evaluate this file each time a new window is opened. It is run | |
| # after packages are loaded/activated and after the previous editor state | |
| # has been restored. | |
| # | |
| # An example hack to log to the console when each text editor is saved. | |
| # | |
| # atom.workspace.observeTextEditors (editor) -> | |
| # editor.onDidSave -> |
Need a server for your single page app?
npm install --save dotenv express path body-parser compression express-sslify
| /* eslint-disable import/default */ | |
| import React from 'react'; | |
| import { render } from 'react-dom'; | |
| import HomePage from './components/HomePage' | |
| require('./favicon.ico'); // Tell webpack to load favicon.ico | |
| import './styles/styles.scss'; // Yep, that's right. You can import SASS/CSS files too! Webpack will run the associated loader and plug this into the page. | |
| import getMuiTheme from 'material-ui/styles/getMuiTheme'; | |
| import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; |