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

Changes for the New deposit/withdrawal page notion task #2793

Merged
merged 35 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e0923af
Changes for the New deposit/withdrawal page notion task
May 3, 2024
19d2f94
Merge branch 'develop' of https://github.com/bitholla/hollaex-kit int…
May 8, 2024
3bf0643
Merge branch 'develop' of https://github.com/bitholla/hollaex-kit int…
May 8, 2024
2555b68
updated the workflows on the withdraw page and fixed the ope order me…
May 8, 2024
35dd2dd
commanded the onHandleFiat function
May 8, 2024
4220a17
Merge branch 'develop' of https://github.com/bitholla/hollaex-kit int…
May 9, 2024
aac213b
Updated the withdraw page workflows
May 9, 2024
7546017
Merge branch 'develop' of https://github.com/bitholla/hollaex-kit int…
May 10, 2024
8e1e661
Tested and fixed the known bugs on the withdrawal workflow
May 10, 2024
c94db2b
Merge branch 'develop' of https://github.com/bitholla/hollaex-kit int…
May 13, 2024
4c709cf
Merge branch 'develop' of https://github.com/bitholla/hollaex-kit int…
jsmitrah May 13, 2024
2d8d10a
Merge branch 'develop' of https://github.com/bitholla/hollaex-kit int…
May 14, 2024
baebb3e
Merge branch 'develop' of https://github.com/bitholla/hollaex-kit int…
May 14, 2024
7a62776
Initial commit for the deposit workflow
May 14, 2024
41ed7d8
Merge branch 'develop-ram' of https://github.com/bitholla/hollaex-kit…
jsmitrah May 14, 2024
3e6adcf
Updated the logic for the deposit page workflows
May 15, 2024
ce99220
Updated the mobile view and fixed some minor issues
May 17, 2024
2d59668
Merge branch 'develop-ram' of https://github.com/bitholla/hollaex-kit…
jsmitrah May 17, 2024
c7932fc
Updated the disable state logic and fixed minor issues
May 17, 2024
5e629fa
Merge branch 'develop-ram' of https://github.com/bitholla/hollaex-kit…
jsmitrah May 20, 2024
91826c6
Merge branch 'develop' of https://github.com/bitholla/hollaex-kit int…
jsmitrah May 20, 2024
9e61bf3
Merge branch 'develop' of https://github.com/bitholla/hollaex-kit int…
May 20, 2024
40f0718
Merge branch 'develop' of https://github.com/bitholla/hollaex-kit int…
May 22, 2024
05e4f55
Merge branch 'develop' of https://github.com/bitholla/hollaex-kit int…
May 22, 2024
1245021
Initial commit for the email workflow
May 22, 2024
6aceaba
Merge branch 'develop-ram' of https://github.com/bitholla/hollaex-kit…
jsmitrah May 22, 2024
d5db259
Merge branch 'develop' of https://github.com/bitholla/hollaex-kit int…
jsmitrah May 22, 2024
bbe5690
Merge branch 'develop' of https://github.com/bitholla/hollaex-kit int…
May 22, 2024
7e394a2
Updated the logic for the email withdrawal workflow
May 22, 2024
9cf1ad5
Merge branch 'develop' of https://github.com/bitholla/hollaex-kit int…
May 23, 2024
f9abe3c
Tested and Fixed some minor bugs on the deposit/withdrawal workflow
May 23, 2024
cafcedc
Merge branch 'develop-ram' of https://github.com/bitholla/hollaex-kit…
jsmitrah May 24, 2024
f7cf3d6
Merge branch 'develop' of https://github.com/bitholla/hollaex-kit int…
jsmitrah May 24, 2024
07b2a87
Fixed some minor UI issue in withdraw page
jsmitrah May 24, 2024
8d81d5c
Pushed the missed button label in the appbar
jsmitrah May 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions web/public/assets/images/deposit-box.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion web/public/assets/images/mini-qr-code.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions web/public/assets/images/withdraw-out-box.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions web/src/actions/appActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,20 @@ export const SET_ADMIN_WALLET_SORT = 'SET_ADMIN_WALLET_SORT';
export const SET_ADMIN_DIGITAL_ASSETS_SORT = 'SET_ADMIN_DIGITAL_ASSETS_SORT';
export const SET_SELECTED_ACCOUNT = 'SET_SELECTED_ACCOUNT';
export const SET_SELECTED_STEP = 'SET_SELECTED_STEP';
export const SET_WITHDRAW_CURRENCY = 'SET_WITHDRAW_CURRENCY';
export const SET_WITHDRAW_NETWORK = 'SET_WITHDRAW_NETWORK';
export const SET_WITHDRAW_NETWORK_OPTIONS = 'SET_WITHDRAW_NETWORK_OPTIONS';
export const SET_WITHDRAW_ADDRESS = 'SET_WITHDRAW_ADDRESS';
export const SET_WITHDRAW_AMOUNT = 'SET_WITHDRAW_AMOUNT';
export const SET_WITHDRAW_FEE = 'SET_WITHDRAW_FEE';
export const SET_DEPOSIT_AND_WITHDRAW = 'SET_DEPOSIT_AND_WITHDRAW';
export const SET_VALID_ADDRESS = 'SET_VALID_ADDRESS';
export const SET_DEPOSIT_CURRENCY = 'SET_DEPOSIT_CURRENCY';
export const SET_DEPOSIT_NETWORK = 'SET_DEPOSIT_NETWORK';
export const SET_DEPOSIT_NETWORK_OPTIONS = 'SET_DEPOSIT_OPTIONS';
export const SET_SELECTED_METHOD = 'SET_SELECTED_METHOD';
export const SET_RECEIVER_EMAIL = 'SET_RECEIVER_EMAIL';
export const SET_WITHDRAW_OTIONAL_TAG = 'SET_WITHDRAW_OTIONAL_TAG';

export const SORT = {
VOL: 'volume',
Expand Down Expand Up @@ -675,3 +689,73 @@ export const getWithdrawalMax = (currency, network) => {
`/user/withdrawal/max?currency=${currency}&network=${network}`
);
};

export const withdrawCurrency = (currency) => ({
type: SET_WITHDRAW_CURRENCY,
payload: currency,
});

export const withdrawNetwork = (network) => ({
type: SET_WITHDRAW_NETWORK,
payload: network,
});

export const withdrawNetworkOptions = (networkOptions) => ({
type: SET_WITHDRAW_NETWORK_OPTIONS,
payload: networkOptions,
});

export const withdrawAddress = (address) => ({
type: SET_WITHDRAW_ADDRESS,
payload: address,
});

export const withdrawAmount = (amount) => ({
type: SET_WITHDRAW_AMOUNT,
payload: amount,
});

export const setFee = (amount) => ({
type: SET_WITHDRAW_FEE,
payload: amount,
});

export const setDepositAndWithdraw = (val) => ({
type: SET_DEPOSIT_AND_WITHDRAW,
payload: val,
});

export const setIsValidAdress = (val) => ({
type: SET_VALID_ADDRESS,
payload: val,
});

export const depositCurrency = (currency) => ({
type: SET_DEPOSIT_CURRENCY,
payload: currency,
});

export const depositNetwork = (network) => ({
type: SET_DEPOSIT_NETWORK,
payload: network,
});

export const depositNetworkOptions = (networkOptions) => ({
type: SET_DEPOSIT_NETWORK_OPTIONS,
payload: networkOptions,
});

export const setSelectedMethod = (method) => ({
type: SET_SELECTED_METHOD,
payload: method,
});

export const setReceiverEmail = (email) => ({
type: SET_RECEIVER_EMAIL,
payload: email,
});

export const setWithdrawOptionaltag = (tag) => ({
type: SET_WITHDRAW_OTIONAL_TAG,
payload: tag,
});
7 changes: 7 additions & 0 deletions web/src/actions/walletActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,3 +461,10 @@ export const getEstimatedDust = (assets = []) => {
const data = { assets };
return axios.post(ENDPOINTS.DUST_ESTIMATION, data);
};

export const activeTabFromWallet = (tab) => ({
type: 'ACTIVE_TAB_FROM_WALLET',
payload: {
tab,
},
});
4 changes: 3 additions & 1 deletion web/src/components/ActionNotification/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ const ActionNotification = ({
showActionText,
hideActionText = false,
disable = false,
isFromWallet = false,
}) => {
const isVisibale = isFromWallet ? isFromWallet : !isMobile;
// This is to prevent action when edit string or upload icons are clicked
const onActionClick = ({ target: { dataset = {} } }) => {
const { stringId, iconId } = dataset;
Expand Down Expand Up @@ -69,7 +71,7 @@ const ActionNotification = ({
)}
onClick={onActionClick}
>
{!hideActionText && (showActionText || !isMobile) && (
{!hideActionText && (showActionText || isVisibale) && (
<div
className={classnames(
'action_notification-text',
Expand Down
18 changes: 17 additions & 1 deletion web/src/components/AppBar/_AppBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,22 @@ $app-menu-width: calc(100vw - 40rem);
stroke: $base_top-bar-navigation_text-inactive;
}
}

.app-bar-deposit-btn {
background-color: $link;
padding: 2px 10px 0px 10px;
border-radius: 3px;
cursor: pointer;
font-size: 11px;
.margin-aligner {
margin-bottom: unset;
margin-right: unset;
svg {
width: 15px !important;
height: 15px !important;
}
}
}
}

.app_bar-pair-overflow {
Expand Down Expand Up @@ -1126,7 +1142,7 @@ $app-menu-width: calc(100vw - 40rem);
// }

.app-menu-bar-content {
width: 12rem;
width: 10rem;
}
}
.app-bar-add-tab-menu {
Expand Down
26 changes: 25 additions & 1 deletion web/src/components/AppBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ import { DEFAULT_URL } from 'config/constants';
import MenuList from './MenuList';
import { MobileBarWrapper, EditWrapper, ButtonLink, Image } from 'components';
import { isLoggedIn } from 'utils/token';
import { getTickers, changeTheme, setLanguage } from 'actions/appActions';
import {
getTickers,
changeTheme,
setLanguage,
setDepositAndWithdraw,
} from 'actions/appActions';
import { updateUserSettings, setUserData } from 'actions/userAction';
import ThemeSwitcher from './ThemeSwitcher';
import withEdit from 'components/EditProvider/withEdit';
Expand Down Expand Up @@ -216,6 +221,12 @@ class AppBar extends Component {
);
};

onHandleDeposit = () => {
const { setDepositAndWithdraw, router } = this.props;
setDepositAndWithdraw(true);
router.push('/wallet/deposit');
};

render() {
const {
user,
Expand All @@ -229,6 +240,7 @@ class AppBar extends Component {
isHome,
activeLanguage,
changeLanguage,
icons,
} = this.props;
const { securityPending, verificationPending, walletPending } = this.state;

Expand Down Expand Up @@ -304,6 +316,17 @@ class AppBar extends Component {
id="trade-nav-container"
className="d-flex app-bar-account justify-content-end"
>
<div
className="app-bar-deposit-btn d-flex"
onClick={this.onHandleDeposit}
>
<Image
iconId={'DEPOSIT_TITLE'}
icon={icons['DEPOSIT_TITLE']}
wrapperClassName="form_currency-ball margin-aligner"
/>
<span className="ml-2">{STRINGS['ACCORDIAN.DEPOSIT_LABEL']}</span>
</div>
<div className="d-flex app_bar-quicktrade-container">
<LanguageSwitcher
selected={activeLanguage}
Expand Down Expand Up @@ -352,6 +375,7 @@ const mapDispatchToProps = (dispatch) => ({
changeTheme: bindActionCreators(changeTheme, dispatch),
setUserData: bindActionCreators(setUserData, dispatch),
changeLanguage: bindActionCreators(setLanguage, dispatch),
setDepositAndWithdraw: bindActionCreators(setDepositAndWithdraw, dispatch),
});

export default connect(
Expand Down
7 changes: 5 additions & 2 deletions web/src/components/Form/validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const passwordsMatch = (value, allValues) =>
export const username = (value = '') =>
!usernameRegEx.test(value) ? STRINGS['INVALID_USERNAME'] : undefined;

export const validAddress = (symbol = '', message, network) => {
export const validAddress = (symbol = '', message, network, key = '') => {
let currency = network ? network.toUpperCase() : symbol.toUpperCase();
return (address) => {
let valid;
Expand All @@ -48,7 +48,10 @@ export const validAddress = (symbol = '', message, network) => {

const supported = WAValidator.findCurrency(currency);
if (supported) {
valid = WAValidator.validate(address, currency);
valid = WAValidator.validate(
address ? address : (address = key),
currency
);
} else {
valid = true;
}
Expand Down
3 changes: 3 additions & 0 deletions web/src/config/icons/dark.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ const nestedIcons = {

FOOTERBAR_ASSETS_TRADE: '/assets/images/asset-prices-mobile-tab-01.svg',
WALLET_FOOTER: '/assets/images/wallet-mobile-tab-02-01 (1).svg',

WITHDRAW_TITLE: '/assets/images/withdraw-out-box.svg',
DEPOSIT_TITLE: '/assets/images/deposit-box.svg',
};

const icons = flatten(nestedIcons, options);
Expand Down
2 changes: 1 addition & 1 deletion web/src/config/icons/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ const icons = {
SWITCH_ASSET_FOR_FEES: '/assets/images/switch-asset-for-fees.svg',
CLOCK: '/assets/images/clock.svg',
QR_CODE_SHOW: '/assets/images/mini-qr-code.svg',
QR_CODE_SCAN: '/assets/images/camera-scan.svg',
// QR_CODE_SCAN: '/assets/images/camera-scan.svg',
CLOUD_BASIC: '/assets/images/Path 4813.svg',
CLOUD_CRYPTO: '/assets/images/Path 4815.svg',
CLOUD_FIAT: '/assets/images/Group 5179.svg',
Expand Down
30 changes: 28 additions & 2 deletions web/src/config/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,7 @@
"QUOTE_SUCCESS_REVIEW_MESSAGE": "You have successfully {0} {1} {2}",
"COUNTDOWN_ERROR_MESSAGE": "Countdown is finished",
"WITHDRAW_PAGE": {
"WITHDRAW": "Withdraw",
"BANK_TO_WITHDRAW": "Bank to Withdraw to",
"MESSAGE_ABOUT_SEND": "You are about to send",
"MESSAGE_BTC_WARNING": "Please ensure the accuracy of this address since {0} transfers are irreversible",
Expand All @@ -1084,7 +1085,17 @@
"WITHDRAWAL_CONFIRM_ADDRESS": "Address",
"WITHDRAWAL_CONFIRM_NETWORK": "Network",
"WITHDRAWAL_CANCEL_BUTTON": "CLOSE",
"WITHDRAWAL_CONFIRM_BUTTON": "CONFIRM WITHDRAWAL"
"WITHDRAWAL_CONFIRM_BUTTON": "CONFIRM WITHDRAWAL",
"REMOVE_TAG_NOTE_1": "You've made a selection to remove the Tag (also known as memo, Digital ID, Label and Notes)",
"REMOVE_TAG_NOTE_2": "Most exchange, wallets and other platforms do require a Tag. {0} {1}",
"REMOVE_TAG_NOTE_3": "Please double-check",
"REMOVE_TAG_NOTE_4": "that the Tag is in fact required before removing it.",
"BACK_BTN": "BACK",
"REMOVE_TAG": "YES, REMOVE TAG",
"GENERATE_DEPOSIT_TEXT_1": "No deposit address detected",
"GENERATE_DEPOSIT_TEXT_2": "Generate one below:",
"WITHDRAW_ADDRESS": "Withdrawal address",
"WITHDRAW_EMAIL_ADDRESS": "Withdrawal email"
},
"WALLET_BUTTON_BASE_DEPOSIT": "deposit",
"WALLET_BUTTON_BASE_WITHDRAW": "withdraw",
Expand Down Expand Up @@ -1704,7 +1715,22 @@
"ACCORDIAN": {
"ACCORDIAN_ASSETS": "All wallet assets",
"ACCORDIAN_INFO": "ASSET INFO PAGE",
"ACCORDIAN_HISTORY": "HISTORY"
"ACCORDIAN_HISTORY": "HISTORY",
"DEPOSIT": "DEPOSIT",
"WITHDRAW": "WITHDRAW",
"SELECT_ASSET": "Select asset:",
"SELECT_NETWORK": "Select network:",
"DESTINATION": "Destination:",
"AMOUNT": "Amount:",
"ESTIMATED": "Estimated Withdrawal value",
"TRANSACTION_FEE": "Transaction fee to be added:",
"SCAN": "SCAN",
"ADDRESS": "address:",
"OPTIONAL_TAG": "Tag (optional)",
"TAG": "Tag",
"DISABLED_DEPOSIT_CONTENT": "The deposit functionality is temporarily unavailable.",
"DISABLED_WITHDRAW_CONTENT": "The withdrawal functionality is temporarily unavailable.",
"DEPOSIT_LABEL": "Deposit"
},
"ASYNC_LINK": {
"TITLE": "Page not opening automatically?",
Expand Down