-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE]: improve user experience (slow 3G) with page transitions wh…
…en fetching data (#68) * feature: needed native tailwind colours for gradient map effect * feature: page transition for fetching data--gradient map
- Loading branch information
1 parent
d00fa86
commit bc5a5b3
Showing
6 changed files
with
108 additions
and
65 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from "react"; | ||
import type { PropsWithChildren } from "react"; | ||
import { useTransition } from "@remix-run/react"; | ||
import classNames from "classnames"; | ||
|
||
const GradientMapTransition = ({ | ||
children, | ||
classNameProps, | ||
}: PropsWithChildren<{ classNameProps?: Array<string> }>) => { | ||
const transition = useTransition(); | ||
|
||
if (transition.state === "loading") { | ||
return ( | ||
<div className={classNames(classNameProps?.join(" "))}> | ||
<div className="h-full w-full animate-ping bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-rose-100 to-teal-100" /> | ||
</div> | ||
); | ||
} | ||
|
||
return <>{children}</>; | ||
}; | ||
|
||
export default GradientMapTransition; |
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 |
---|---|---|
@@ -1,4 +1,9 @@ | ||
import MorphingTransition from "./MorphingTransition"; | ||
import FlowerBlobTransition from "./FlowerBlobTransition"; | ||
import GradientMapTransition from "./GradientMapTransition"; | ||
|
||
export { MorphingTransition, FlowerBlobTransition }; | ||
export default { | ||
MorphingTransition, | ||
FlowerBlobTransition, | ||
GradientMapTransition, | ||
}; |
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