Skip to content
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

Fix/5143/ledger routing #5226

Closed
wants to merge 6 commits into from
Closed

Fix/5143/ledger routing #5226

wants to merge 6 commits into from

Conversation

pete-watters
Copy link
Contributor

@pete-watters pete-watters commented Apr 12, 2024

Building Leather at commit 21fa317

WIP:

@pete-watters pete-watters force-pushed the fix/5143/ledger-routing branch 3 times, most recently from c7f8485 to 32eba94 Compare April 12, 2024 13:55
</Box>
</Flex>
));
export function AccountListUnavailable() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no point using memo on components that don't receive any props

@@ -25,8 +25,8 @@ export default function PluggingInLedgerCableAnimation(props: BoxProps) {

return (
<Box height="200px" overflow="hidden" position="relative" width="100%" {...props}>
<Box position="absolute" left={0} right={0}>
<Lottie options={options} width={380} style={invertStyle} />
<Box position="absolute" left={0} right={0} style={invertStyle}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were getting a runtime error for invalid props to Lottie so I moved these styles up a level

@@ -17,8 +17,8 @@ export function MessagePreviewBox({ message, hash }: MessageBoxProps) {
py="space.05"
overflowX="auto"
>
{message.split(/\r?\n/).map(line => (
<styled.span key={line} textStyle="label.01">
{message.split(/\r?\n/).map((line, index) => (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was throwing a duplicate keys runtime error

@@ -34,10 +38,14 @@ export const ChooseAccount = memo(() => {
{url && <RequesterFlag requester={url.toString()} />}
<LogomarkIcon width="248px" height="58px" />
<Stack gap="space.04">
<styled.h1 textStyle="heading.05">Choose an account to connect</styled.h1>
<styled.h1 textStyle="heading.05">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I improvised and added a message here:

Screenshot 2024-04-15 at 10 31 02

When using Ledger, you an connect BTC and not STX. If this is the case and you try and connect your wallet with Gamma / some service you got a popup saying 'Choose an account to connect' but no accounts are listed.

I initially changed it to the below, however I didn't think it made sense to say 'Choose account' then 'No Accounts'
Screenshot 2024-04-15 at 10 22 55

const { chain } = useCurrentNetwork();

const [isLoading, setIsLoading] = useState(false);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code stops the button from having a loading spinner if you close the dialog and start again.

@@ -9,7 +9,7 @@ import { pxStringToNumber } from '@shared/utils/px-string-to-number';

export interface DialogProps {
isShowing: boolean;
onClose(): void;
onClose?(): void;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some dialogs can't be closed


export interface DialogHeaderProps {
isWaitingOnPerformedAction?: boolean;
onClose?(): void;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onClose gets cloned from the <Dialog onClose=

@pete-watters pete-watters force-pushed the fix/5143/ledger-routing branch from 2552e7d to 4c3ef03 Compare April 16, 2024 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant