mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-01-27 18:24:25 +01:00
feature: Added Skeleton states
Added skeleton loading states to project mini card, project card, and project rows
This commit is contained in:
@@ -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
10
src/utils/hoc.tsx
Normal 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
11
src/utils/types/utils.ts
Normal 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>
|
||||
Reference in New Issue
Block a user