This file contains hidden or 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 CracoAlias = require('craco-alias'); | |
| const WebpackBar = require('webpackbar'); | |
| const { getLoader, loaderByName } = require('@craco/craco'); | |
| const transformBabelLoader = require('./internals/transformBabelLoader'); | |
| module.exports = { | |
| style: { | |
| postcss: { | |
| plugins: [require('tailwindcss'), require('autoprefixer')], | |
| }, |
This file contains hidden or 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 { useHistory, useRouteMatch } from 'react-router-dom'; | |
| import { | |
| StateMachineProvider, | |
| createStore, | |
| useStateMachine, | |
| } from 'little-state-machine'; | |
| import { RouteFactory, Route } from 'services/router/RouteFactory'; | |
| import { useForm } from 'react-hook-form'; | |
| function updateAction(state, payload) { |
This file contains hidden or 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 RouteFactory from 'app/routes'; | |
| export default function App() { | |
| return <RouteFactory />; | |
| } |
This file contains hidden or 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 flat, { unflatten } from "flat"; | |
| import { reduceRight } from "lodash"; | |
| import { | |
| pipe, | |
| reject, | |
| isNil, | |
| isEqual, | |
| get, | |
| fromPairs, | |
| entries, |
This file contains hidden or 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
| /* picked from cypress-realworld-app */ | |
| import Fuse from "fuse.js"; | |
| import { flow, map, curry } from "lodash/fp"; | |
| type IItems = { | |
| title: string; | |
| body: string; | |
| }; | |
| export const performSearch = (items: object[], options: {}, query: string) => |
This file contains hidden or 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
| type PathImpl<T, K extends keyof T> = K extends string | |
| ? T[K] extends Record<string, any> | |
| ? T[K] extends ArrayLike<any> | |
| ? K | `${K}.${PathImpl<T[K], Exclude<keyof T[K], keyof any[]>>}` | |
| : K | `${K}.${PathImpl<T[K], keyof T[K]>}` | |
| : K | |
| : never; | |
| type Path<T> = PathImpl<T, keyof T> | keyof T; |
This file contains hidden or 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 { PartialDeep } from "type-fest"; | |
| export type RouteConfigProps = PartialDeep<{ | |
| layout: { | |
| include: boolean; | |
| topbar: boolean; | |
| }; | |
| accessKey: string; | |
| }>; | |
This file contains hidden or 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 accesKeys = { | |
| guest: { | |
| home: true, | |
| users: true, | |
| user: true, | |
| }, | |
| }; |
This file contains hidden or 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 composableHoc = (prop: string) => { | |
| return function <T>(Component: ComponentType<T>) { | |
| return function (props: T): JSX.Element { | |
| return <Component {...props} />; | |
| }; | |
| }; | |
| }; |
This file contains hidden or 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 { useState, RefObject, useLayoutEffect } from "react"; | |
| import useWindowSize from "./useWindowSize"; | |
| export function useOverflow( | |
| ref: RefObject<HTMLElement> | |
| ): { | |
| refXOverflowing: boolean; | |
| refYOverflowing: boolean; | |
| refXScrollBegin: boolean; |
NewerOlder