-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Incorporate new Epic-Stack template updates like Remix v2.3.1 (#117)
* epic v2.3: NEW .env.example; csrf security * epic v2.3: NEW .env.example; csrf security * Comment about potentially unneccesary & readme Co-authored-by: plocket <[email protected]> Co-authored-by: Gavin Kimball <[email protected]> Co-authored-by: Clayton Schneider <[email protected]> Co-authored-by: Jeff Korenstein <[email protected]> Co-authored-by: Tai <[email protected]> Co-authored-by: Tai Phuong <[email protected]> --------- Co-authored-by: plocket <[email protected]> Co-authored-by: Gavin Kimball <[email protected]> Co-authored-by: Clayton Schneider <[email protected]> Co-authored-by: Jeff Korenstein <[email protected]> Co-authored-by: Tai <[email protected]>
- Loading branch information
1 parent
43d1f53
commit 4e7a068
Showing
90 changed files
with
6,270 additions
and
4,003 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"recommendations": [ | ||
"bradlc.vscode-tailwindcss", | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"prisma.prisma", | ||
"qwtel.sqlite-viewer", | ||
"yoavbls.pretty-ts-errors", | ||
"github.vscode-github-actions" | ||
] | ||
} |
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
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
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { useNavigation } from '@remix-run/react' | ||
import { useEffect, useRef, useState } from 'react' | ||
import { useSpinDelay } from 'spin-delay' | ||
import { cn } from '#app/utils/misc.tsx' | ||
import { Icon } from './ui/icon.tsx' | ||
|
||
function EpicProgress() { | ||
const transition = useNavigation() | ||
const busy = transition.state !== 'idle' | ||
const delayedPending = useSpinDelay(busy, { | ||
delay: 600, | ||
minDuration: 400, | ||
}) | ||
const ref = useRef<HTMLDivElement>(null) | ||
const [animationComplete, setAnimationComplete] = useState(true) | ||
|
||
useEffect(() => { | ||
if (!ref.current) return | ||
if (delayedPending) setAnimationComplete(false) | ||
|
||
const animationPromises = ref.current | ||
.getAnimations() | ||
.map(({ finished }) => finished) | ||
|
||
Promise.allSettled(animationPromises).then(() => { | ||
if (!delayedPending) setAnimationComplete(true) | ||
}) | ||
}, [delayedPending]) | ||
|
||
return ( | ||
<div | ||
role="progressbar" | ||
aria-hidden={delayedPending ? undefined : true} | ||
aria-valuetext={delayedPending ? 'Loading' : undefined} | ||
className="fixed inset-x-0 left-0 top-0 z-50 h-[0.20rem] animate-pulse" | ||
> | ||
<div | ||
ref={ref} | ||
className={cn( | ||
'h-full w-0 bg-foreground duration-500 ease-in-out', | ||
transition.state === 'idle' && | ||
(animationComplete | ||
? 'transition-none' | ||
: 'w-full opacity-0 transition-all'), | ||
delayedPending && transition.state === 'submitting' && 'w-5/12', | ||
delayedPending && transition.state === 'loading' && 'w-8/12', | ||
)} | ||
/> | ||
{delayedPending && ( | ||
<div className="absolute flex items-center justify-center"> | ||
<Icon | ||
name="update" | ||
size="md" | ||
className="m-1 animate-spin text-foreground" | ||
aria-hidden | ||
/> | ||
</div> | ||
)} | ||
</div> | ||
) | ||
} | ||
|
||
export { EpicProgress } |
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
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
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
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
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
Oops, something went wrong.