feature: Added Skeleton states

Added skeleton loading states to project mini card, project card, and project rows
This commit is contained in:
MTG2000
2022-01-12 20:54:48 +02:00
parent ac8b71ce99
commit 1d71897e62
20 changed files with 498 additions and 42 deletions

View File

@@ -1,11 +1,12 @@
import { QueryClient, QueryClientProvider } from 'react-query'
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'react-redux';
import { store } from '../redux/store';
import 'react-multi-carousel/lib/styles.css';
import "react-loader-spinner/dist/loader/css/react-spinner-loader.css";
import { BrowserRouter } from 'react-router-dom';
import 'react-loading-skeleton/dist/skeleton.css'
import {
ApolloClient,

10
src/utils/hoc.tsx Normal file
View File

@@ -0,0 +1,10 @@
import { Link } from "react-router-dom";
export function wrapLink(Component: JSX.Element, href: string | undefined, className?: string) {
if (!href) return Component;
return <Link to={href} className={className}>
{Component}
</Link>
}

11
src/utils/types/utils.ts Normal file
View File

@@ -0,0 +1,11 @@
export type UnionToObjectKeys<O, Key extends keyof O, Value = string> = { [EE in NonNullable<O[Key]> extends string ? NonNullable<O[Key]> : never]: Value }
export type Id<T> = {} & { [P in keyof T]: T[P] } // flatens out the types to make them more readable can be removed
export type RemoveCommonValues<T, TOmit> = {
[P in keyof T]: TOmit extends Record<P, infer U> ? Exclude<T[P], U> : T[P]
}
export type ValueOf<T> = Id<T[keyof T]>;
export type OmitId<T, Id extends string = 'id'> = Omit<T, Id>