Skip to content

Commit

Permalink
[Wallet] george / cashier header animation (heigth transition + opaci…
Browse files Browse the repository at this point in the history
…ty) (deriv-com#10965)

* style: 💄 add height transition with opacity

* fix: fixed the height issue for desktop wallets-cashier-content (#41)

---------

Co-authored-by: Aum Bhatt <125039206+aum-deriv@users.noreply.github.com>
  • Loading branch information
heorhi-deriv and aum-deriv authored Oct 26, 2023
1 parent 64a549c commit 5618278
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
6 changes: 5 additions & 1 deletion packages/wallets/src/features/cashier/WalletCashier.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
.wallets-cashier {
display: flex;
flex-direction: column;
height: calc(100svh - 4rem);
height: calc(100vh - (4.8rem + 3.6rem));

@include mobile {
height: calc(100svh - 4rem);
}
}

.wallets-cashier-content {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

@include mobile {
padding-top: 0rem;
transition: height 0.2s ease-in;
height: fit-content;
}

Expand Down Expand Up @@ -40,9 +39,9 @@
align-items: center;

@include mobile {
visibility: visible;
transition: visibility 0s, height 0.2s ease;
height: 2rem;
opacity: 1;
max-height: 2rem;
transition: opacity 0.25s ease, max-height 0.25s ease;
gap: 0.8rem;
}

Expand Down Expand Up @@ -74,9 +73,10 @@
gap: 0.8rem;
}

&__icon {
&__icon > :first-child {
@include mobile {
transition: visibility 0s, height 0.2s ease;
max-height: 4.8rem;
transition: opacity 0.2s ease, max-height 0.2s ease;
}
}
}
Expand Down Expand Up @@ -124,9 +124,14 @@
}
}
}
}

.wallets-hide-details {
height: 0;
visibility: hidden;
&__hide-details {
max-height: 0;
opacity: 0;
}

&__hide-currency-icon > :first-child {
max-height: 0;
opacity: 0;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { useHistory, useLocation } from 'react-router-dom';
import classNames from 'classnames';
import { useHistory, useLocation } from 'react-router-dom';
import { useActiveWalletAccount } from '@deriv/api';
import { WalletCardIcon } from '../../../../components/WalletCardIcon';
import { WalletGradientBackground } from '../../../../components/WalletGradientBackground';
Expand Down Expand Up @@ -35,7 +35,7 @@ const WalletCashierHeader = ({ hideWalletDetails }: { hideWalletDetails: boolean
<div className='wallets-cashier-header__info__top-left'>
<div
className={classNames('wallets-cashier-header__info__top-left__details', {
'wallets-hide-details': isMobile && hideWalletDetails,
'wallets-cashier-header__hide-details': isMobile && hideWalletDetails,
})}
>
<h1 className='wallets-cashier-header__info__top-left__details__title'>
Expand All @@ -51,7 +51,7 @@ const WalletCashierHeader = ({ hideWalletDetails }: { hideWalletDetails: boolean
{data?.wallet_currency_type && (
<div
className={classNames('wallets-cashier-header__info__top-right__icon', {
'wallets-hide-details': isMobile && hideWalletDetails,
'wallets-cashier-header__hide-currency-icon': isMobile && hideWalletDetails,
})}
>
<WalletCardIcon size='xl' type={data?.wallet_currency_type} />
Expand Down

0 comments on commit 5618278

Please sign in to comment.