-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Short APR and Short ROI toggle (#1136)
* Upgrade hyperdrive-viem to latest hyperdrive-js-core * Rename useCurrentFixedRate -> useFixedRate, useImpliedRate -> useShortRate * Implement short roi/apr, cleanup hooks * Remove unused code * Use block wells to prevent layout shift * Reuse type
- Loading branch information
1 parent
5e23ea1
commit d377536
Showing
13 changed files
with
100 additions
and
123 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,17 @@ | ||
import { FetchStatus, QueryStatus } from "@tanstack/react-query"; | ||
export type QueryStatusWithIdle = QueryStatus | "idle"; | ||
|
||
export function getStatus( | ||
status: QueryStatus, | ||
fetchStatus: FetchStatus, | ||
): QueryStatus | "idle" { | ||
let queryStatus: QueryStatusWithIdle = status; | ||
|
||
// In cases where a query is disabled, it will still going into a loading | ||
// status. However, the fetch status will be idle. | ||
if (fetchStatus === "idle" && status === "loading") { | ||
queryStatus = "idle"; | ||
} | ||
|
||
return queryStatus; | ||
} |
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
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.