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 * as React from "react"; | |
const TestComponent: React.FunctionComponent = (props) => { | |
const myList: any[] = []; | |
const onClickItem = (item: any) => { | |
console.log("Item: ", item); | |
}; | |
return ( |
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 * as React from "react"; | |
const TestComponent: React.FunctionComponent = (props) => { | |
const myList: any[] = []; | |
const onClickItem = (item: any) => () => { | |
console.log("Item: ", item); | |
}; | |
return ( |
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 { 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 |
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 const setMemberField = ( | |
state: IAccountState, | |
action: IAction<IGenericUpdate<IMember>> | |
) => { | |
const { key, value } = action.payload; | |
state.member = { ...state.member, [key]: value }; | |
}; |
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 interface IMember { | |
firstName: string; | |
lastName: string; | |
emailAddress: string; | |
} | |
export interface IAction<T = undefined> { | |
type: string; | |
payload: T; | |
error?: boolean; |
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
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 |
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
// why is width 99? https://link-to-github-issue-here | |
<ResponsiveContainer width="99%" height="100%"> |
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
// artificial wait to allow customers to move card away from scanner | |
await new Promise<void>((res) => setTimeout(() => res(), 2000)) |
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 { 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> |
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 { 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( |