-
Notifications
You must be signed in to change notification settings - Fork 67
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: sync url with filters #148
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Mostly looks good!
<SearchError | ||
show={show} | ||
imgSrc={ErrorIcon} | ||
text="Sorry, the origin or destination chain is invalid. Please try choosing another chain or cleaning your filters." |
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.
text="Sorry, the origin or destination chain is invalid. Please try choosing another chain or cleaning your filters." | |
text="Sorry, either the origin or the destination chain is invalid. Please choose a different chain or clear your search filters." |
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.
done
isValidInput && | ||
isValidOrigin && | ||
isValidDestination && | ||
isAnyMessageFound && |
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.
Long list, should we make a var above to combine these?
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.
created a showMessageTable
variable to combine these
@@ -21,6 +22,11 @@ export function isValidSearchQuery(input: string) { | |||
return !!searchValueToPostgresBytea(input); | |||
} | |||
|
|||
export function isValidDomainId(domainId: string | null, multiProvider: MultiProvider) { | |||
if (!domainId) return false; | |||
return !!multiProvider.tryGetDomainId(domainId); |
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.
return !!multiProvider.tryGetDomainId(domainId); | |
return multiProvider.hasChain(domainId); |
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.
Didn't know there was a function for this, thanks!
src/utils/queryParams.ts
Outdated
if (value) { | ||
if (newQuery.get(key) !== value) { |
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.
Awkward structure, combine these
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.
done
src/utils/queryParams.ts
Outdated
} else { | ||
if (newQuery.has(key)) { |
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.
Ditto
fixes #145
origin
anddestination
and their value will be adomainId
. Inputting an invaliddomainId
will prompt theSearchChainError
component to showstartTime
andendTime
and their value is a number. The initial load of the values are validated by the functiontryToDecimalNumber()