-
Notifications
You must be signed in to change notification settings - Fork 54
Conversation
type ClaimIntroductionProps = Pick<ClaimCommonTypes, 'hasClaims' | 'handleChangeAccount'> & { | ||
isAirdropOnly: boolean | ||
} | ||
type ClaimIntroductionProps = Pick<ClaimCommonTypes, 'hasClaims' | 'handleChangeAccount' | 'isAirdropOnly'> |
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.
Refactored props for a couple of components
export default function ClaimsTable({ isAirdropOnly, claims, hasClaims }: ClaimsTableProps) { | ||
const { selectedAll, selected, activeClaimAccount, claimStatus, isInvestFlowActive } = useClaimState() | ||
|
||
const { setSelectedAll, setSelected } = useClaimDispatchers() | ||
|
||
const pendingClaimsSet = useAllClaimingTransactionIndices() | ||
|
||
const userClaimData = useUserEnhancedClaimData(activeClaimAccount) | ||
|
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.
Passing down as props to avoid fetching the same thing in 3 different places and cause additional UI delays
import EligibleBanner from './EligibleBanner' | ||
import FooterNavButtons from './FooterNavButtons' | ||
import InvestmentFlow from './InvestmentFlow' | ||
import { ClaimSummary } from './ClaimSummary' |
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.
A lot of noise I know, but the imports were a mess.
Split them by "category"
* | ||
* @param account | ||
*/ | ||
export function useUserHasAvailableClaim(account: Account): boolean { |
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.
Was not in use
|
Great! |
To take claims as parameter to avoid unnecessary hook calls
9dc89da
to
7e8b7ca
Compare
* Removed unused hook * Made claim loading return an isLoading state * Refactored ClaimsTable and Investment flow To take claims as parameter to avoid unnecessary hook calls * Added a very ugly loader to claims page * Organized a bit claim/index imports mess * Refactoring claim page components props * Start hook loading by default * Show loader inside modal. Still ugly Co-authored-by: Leandro <[email protected]>
* fix: only try SafeApp connection in an iframe Improves non-iframe pageload by 300ms. Fixes #2338. The Gnosis check for a SafeApp races a postMessage and a 300ms timeout [1]. The SafeApp embeds the interface in an iframe, so this avoids the check when not in iframes. [1]: https://github.com/gnosis/safe-apps-sdk/blob/f224869dd5ae810db8cecad08fbbcfaa6c046d9d/packages/safe-apps-web3-react/src/connector.ts#L52 * refactor: IS_IN_IFRAME const
Summary
Closes #2245
Hide claims until loading is finished
For now I'm using a very ugly basic loader
Not in the scope of this PR to make it look nice
To Test