-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(wallets): replace Loader with WalletLoader component across the …
…application (#17864) Co-authored-by: Jim Daniels Wasswa <[email protected]>
- Loading branch information
1 parent
1ebece6
commit 48d0f0c
Showing
44 changed files
with
211 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
packages/wallets/src/components/Base/WalletLoader/WalletLoader.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** @define barspinner */ | ||
.wallets-barspinner { | ||
margin: auto; | ||
width: 6rem; | ||
height: 2rem; | ||
white-space: nowrap; | ||
|
||
&__rect { | ||
margin: 0.4rem; | ||
border-radius: 20px; | ||
height: 40%; | ||
width: 0.6rem; | ||
display: inline-block; | ||
@include createBarspinnerAnimation(5, 1.2s, 0.1); | ||
} | ||
} | ||
|
||
@keyframes sk-stretchdelay { | ||
0%, | ||
40%, | ||
100% { | ||
transform: scaleY(1); | ||
} | ||
20% { | ||
transform: scaleY(2); | ||
} | ||
} | ||
|
||
/** @define initial-loader */ | ||
.wallets-initial-loader { | ||
width: 100%; | ||
height: 100%; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
display: flex; | ||
background: transparent; | ||
|
||
&--fullscreen { | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
} | ||
|
||
&__barspinner { | ||
margin: 5rem auto; | ||
|
||
&--rect { | ||
background-color: var(--brand-secondary); | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
packages/wallets/src/components/Base/WalletLoader/WalletLoader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
import classNames from 'classnames'; | ||
import './WalletLoader.scss'; | ||
|
||
type TWalletLoaderProps = { | ||
className?: string; | ||
isFullScreen?: boolean; | ||
}; | ||
|
||
const WalletLoader: React.FC<TWalletLoaderProps> = ({ className, isFullScreen = true }) => { | ||
return ( | ||
<div | ||
className={classNames( | ||
'wallets-initial-loader', | ||
{ | ||
'wallets-initial-loader--fullscreen': isFullScreen, | ||
}, | ||
className | ||
)} | ||
data-testid='dt_initial_loader' | ||
> | ||
<div className={classNames('wallets-initial-loader__barspinner', 'wallets-barspinner')}> | ||
{Array.from(new Array(5)).map((_, idx) => ( | ||
<div | ||
className={`wallets-initial-loader__barspinner--rect wallets-barspinner__rect wallets-barspinner__rect--${ | ||
idx + 1 | ||
} rect${idx + 1}`} | ||
key={idx} | ||
/> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default WalletLoader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as WalletLoader } from './WalletLoader'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/wallets/src/features/cashier/flows/WalletDeposit/WalletDeposit.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.