Skip to content

Instantly share code, notes, and snippets.

View JWLangford's full-sized avatar

Jesse Langford JWLangford

View GitHub Profile
import * as React from "react";
const TestComponent: React.FunctionComponent = (props) => {
const myList: any[] = [];
const onClickItem = (item: any) => {
console.log("Item: ", item);
};
return (
import * as React from "react";
const TestComponent: React.FunctionComponent = (props) => {
const myList: any[] = [];
const onClickItem = (item: any) => () => {
console.log("Item: ", item);
};
return (
import { accountSlice } from "@app/store";
import { IMember, IRootState } from "@app/typings";
import { FormGroup, TextField } from "@mui/material";
import * as React from "react";
import { useDispatch, useSelector } from "react-redux";
const FlatObject: React.FunctionComponent = () => {
const dispatch = useDispatch();
const { firstName, lastName, emailAddress } = useSelector(
(state: IRootState) => state.account.member
export const setMemberField = (
state: IAccountState,
action: IAction<IGenericUpdate<IMember>>
) => {
const { key, value } = action.payload;
state.member = { ...state.member, [key]: value };
};
export interface IMember {
firstName: string;
lastName: string;
emailAddress: string;
}
export interface IAction<T = undefined> {
type: string;
payload: T;
error?: boolean;
interface IUser {
status Status
...other user stuff
}
enum Status {
NO_STATUS = 0,
ACTIVE = 1, // 2^0
ADMIN = 2, // 2^1
EMAIL_VERIFIED = 4, // 2^2
// why is width 99? https://link-to-github-issue-here
<ResponsiveContainer width="99%" height="100%">
// artificial wait to allow customers to move card away from scanner
await new Promise<void>((res) => setTimeout(() => res(), 2000))
import { Router } from "@reach/router"
import * as React from "react"
import LoginComponent from "./Login"
import SignUpComponent from "./Signup"
import ForgotComponent from "./ForgotPassword"
import AuthenticatedComponent from "./Authenticated"
export function Routes() {
return (
<Router>
import { LinearProgress } from "@mui/material"
import { Router } from "@reach/router"
import React, { Suspense } from "react"
export function Routes() {
const LoginComponent = React.lazy(
() => import(/* webpackChunkName: "login" */ "./Login")
)
const SignUpComponent = React.lazy(