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: last acc hidden in switch acc list, closes #5975 #5987

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/pages/choose-account/components/accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function AddAccountAction() {
<Box mx="space.05" py="space.02" onClick={onCreateAccount} {...bind}>
<HStack alignItems="center">
<PlusIcon />
Generate new account
<styled.span textStyle="label.02">Generate new account</styled.span>
</HStack>
{component}
Comment on lines 86 to 90
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't the container just be changed such that the height of the list stops when it gets to the button, and doesn't go under it?

</Box>
Expand Down
5 changes: 2 additions & 3 deletions src/app/ui/components/virtuoso.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function VirtuosoWrapper({ children, hasFooter, isPopup }: VirtuosoWrappe
const [key, setKey] = useState(0);
const isAtLeastMd = useViewportMinWidth('md');
const virtualHeight = isAtLeastMd ? '70vh' : '100vh';
const headerHeight = isPopup ? 230 : 60;
const headerHeight = isPopup ? 300 : 80;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems like a bad choice to me that the core virtuoso component has these hard coded header/footer heights.

What if i use the component again with a different footer?

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 didn't want to start huge refactoring here

Copy link
Contributor

Choose a reason for hiding this comment

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

This code isn't ideal but we have had this issue for a long time and this was the simplest fix. We only use this 3 times and twice with a footer.

We could refactor to pass the values in but I think it's OK

const footerHeight = hasFooter ? 95 : 0;
const heightOffset = headerHeight + footerHeight;
const height = vhToPixels(virtualHeight) - heightOffset;
Expand All @@ -33,10 +33,9 @@ export function VirtuosoWrapper({ children, hasFooter, isPopup }: VirtuosoWrappe
return (
<Box
key={key}
pt="space.03"
overflow="hidden"
style={{
height: height,
height,
marginBottom: hasFooter ? `${footerHeight}px` : '10px',
}}
>
Expand Down
Loading