-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(rakki): UI enhancement #1434
Merged
Merged
Changes from 4 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
0f582be
feat(rakki): Show user's ticket counts
WaDadidou 5a652e0
chore: make generate
WaDadidou eb33b36
Merge branch 'main' into feat-rakki-ui
n0izn0iz 6fc2abc
chore(rakki): Split components
WaDadidou d17f0ce
chore(rakki): Use better svg
WaDadidou 6d49861
fix(rakki): Better UI
WaDadidou 1d38b5b
fix(rakki): remove unset prop usage
WaDadidou f4f6ab2
fix(rakki): Remove Deposit flow
WaDadidou 58be73a
Merge branch 'main' into feat-rakki-ui
WaDadidou 24ffd31
fix(rakki): After merge
WaDadidou 2f5bf64
fix(rakki): Use userId in hook, restore TODO
WaDadidou 70ff903
feat(rakki): Replace placeholders with contract values
WaDadidou a6f190e
Merge branch 'main' into feat-rakki-ui
WaDadidou a7b0f81
fix(rakki): replace fee percent placeholder
WaDadidou a1ada4e
fix(rakki): Use enabled in useQuery, remove unused code
WaDadidou f6f6349
Merge branch 'main' into feat-rakki-ui
hthieu1110 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { useQuery } from "@tanstack/react-query"; | ||
|
||
import { RakkiQueryClient } from "../../contracts-clients/rakki/Rakki.client"; | ||
import { | ||
NetworkFeature, | ||
getNetworkFeature, | ||
getNonSigningCosmWasmClient, | ||
} from "../../networks"; | ||
|
||
export const useRakkiTicketsCountByUser = ( | ||
networkId: string, | ||
userAddress?: string, | ||
) => { | ||
n0izn0iz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const { data: ticketsCount = null, ...other } = useQuery( | ||
["rakkiTicketsCountByUser", networkId], | ||
n0izn0iz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
async () => { | ||
if (!userAddress) { | ||
return null; | ||
} | ||
const rakkiFeature = getNetworkFeature( | ||
networkId, | ||
NetworkFeature.CosmWasmRakki, | ||
); | ||
if (!rakkiFeature) { | ||
return null; | ||
} | ||
const cosmWasmClient = await getNonSigningCosmWasmClient(networkId); | ||
if (!cosmWasmClient) { | ||
return null; | ||
} | ||
const client = new RakkiQueryClient( | ||
cosmWasmClient, | ||
rakkiFeature.contractAddress, | ||
); | ||
return await client.ticketsCountByUser({ userAddr: userAddress }); | ||
}, | ||
{ staleTime: Infinity, refetchInterval: 10000 }, | ||
); | ||
return { ticketsCount, ...other }; | ||
}; |
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we reduce size of this image ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I used a PNG version because the SVG exported from Figma is glitched.
I asked help to Leonid