Skip to content

Commit

Permalink
Merge pull request #527 from bitholla/2.0
Browse files Browse the repository at this point in the history
2.0
  • Loading branch information
abeikverdi authored Feb 3, 2021
2 parents 747913a + bd63b2c commit f149144
Show file tree
Hide file tree
Showing 21 changed files with 140 additions and 31 deletions.
2 changes: 1 addition & 1 deletion server/api/swagger/swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
swagger: "2.0"
info:
version: "2.0.3"
version: "2.0.4"
title: HollaEx Kit
host: api.hollaex.com
basePath: /v2
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.0.3",
"version": "2.0.4",
"private": false,
"description": "HollaEx Kit",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.3
2.0.4
2 changes: 1 addition & 1 deletion web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hollaex-kit",
"version": "2.0.3",
"version": "2.0.4",
"private": true,
"dependencies": {
"@ant-design/compatible": "1.0.5",
Expand Down
16 changes: 8 additions & 8 deletions web/public/assets/images/initialize-quick-trade.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 12 additions & 8 deletions web/src/actions/appActions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { setLanguage as storeLanguageInBrowser } from '../utils/string';
import { hasTheme } from 'utils/theme';
import { DEFAULT_LANGUAGE, LANGUAGE_KEY, PLUGIN_URL } from '../config/constants';
import { DEFAULT_LANGUAGE, LANGUAGE_KEY, PLUGIN_URL } from 'config/constants';
import axios from 'axios';

export const SET_NOTIFICATION = 'SET_NOTIFICATION';
Expand Down Expand Up @@ -48,6 +48,7 @@ export const RISKY_ORDER = 'RISKY_ORDER';
export const LOGOUT_CONFORMATION = 'LOGOUT_CONFORMATION';
export const SET_CURRENCIES = 'SET_CURRENCIES';
export const SET_CONFIG = 'SET_CONFIG';
export const SET_PLUGINS = 'SET_PLUGINS';
export const REQUEST_XHT_ACCESS = 'REQUEST_XHT_ACCESS';
export const SET_INFO = 'SET_INFO';
export const SET_WAVE_AUCTION = 'SET_WAVE_AUCTION';
Expand Down Expand Up @@ -219,13 +220,7 @@ export const setCurrencies = (coins) => ({
});

export const setConfig = (constants = {}) => {
let enabledPlugins = [];
let features = {};
if (constants) {
if (constants.plugins && constants.plugins.enabled) {
enabledPlugins = constants.plugins.enabled.split(',');
}
}
if (constants) {
if (constants.features) {
features = constants.features;
Expand All @@ -235,12 +230,20 @@ export const setConfig = (constants = {}) => {
type: SET_CONFIG,
payload: {
constants,
enabledPlugins,
features,
},
};
};

export const setPlugins = (enabledPlugins) => {
return {
type: SET_PLUGINS,
payload: {
enabledPlugins,
},
};
};

export const setInfo = (info) => ({
type: SET_INFO,
payload: {
Expand All @@ -257,6 +260,7 @@ export const openRiskPortfolioOrderWarning = (data = {}) =>
export const logoutconfirm = (data = {}) =>
setNotification(LOGOUT_CONFORMATION, data, true);

export const requestPlugins = () => axios.get(`${PLUGIN_URL}/plugins`);
export const requestInitial = () => axios.get('/kit');
export const requestConstant = () => axios.get('/constants');
export const requestAdminData = () => axios.get('/admin/kit');
Expand Down
13 changes: 12 additions & 1 deletion web/src/components/AdminForm/hoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,20 @@ const Form = (name, className = '', allowPristine = false) => {
buttonType,
small,
buttonClass = '',
submitOnKeyDown = false,
}) => {
return (
<form className={className}>
<form
className={className}
onKeyDown={(e) => {
if (e.key === 'Enter' && !e.shiftKey) {
if (submitOnKeyDown && !submitting && valid && !error) {
e.preventDefault();
handleSubmit(onSubmit)();
}
}
}}
>
{fields && renderFields(fields)}
{error && (
<div>
Expand Down
10 changes: 9 additions & 1 deletion web/src/containers/Admin/AppWrapper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ class AppWrapper extends React.Component {
};

renderMenuItem = ({ path, label, routeKey, ...rest }, index) => {
const { constants: { logo_image } = {} } = this.props;
let showLabel = label;
if (routeKey === 'main') {
showLabel = this.props.constants.api_name || '';
Expand All @@ -250,8 +251,15 @@ class AppWrapper extends React.Component {
}
>
<ReactSVG
src={STATIC_ICONS.HEX_PATTERN_ICON}
src={logo_image || STATIC_ICONS.HEX_PATTERN_ICON}
className="sidebar-icon"
fallback={() => (
<img
src={logo_image || STATIC_ICONS.HEX_PATTERN_ICON}
alt="exchange-logo"
className="sidebar-icon"
/>
)}
/>
<div>
<div>DASHBOARD</div>
Expand Down
1 change: 1 addition & 0 deletions web/src/containers/Admin/General/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ class General extends Component {
}
this.setState((prevState) => ({
...prevState,
loading: false,
pendingPublishIcons: merge({}, prevState.pendingPublishIcons, {
[iconKey]: icons,
}),
Expand Down
14 changes: 13 additions & 1 deletion web/src/containers/Admin/SetupWizard/AccountSecurity.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ const AccountSecurity = ({
message.error(_error);
});
};

const open = () => {
if (window) {
window.open(
'https://support.google.com/accounts/answer/1066447?hl=en',
'_blank'
);
}
};

return (
<div className="security-content">
{user.otp_enabled ? (
Expand Down Expand Up @@ -98,7 +108,9 @@ const AccountSecurity = ({
<div>{user.otp.secret ? user.otp.secret : ''}</div>
<div>
Don't know what to do?{' '}
<span className="step-link">Click here for directions.</span>
<span className="step-link" onClick={open}>
Click here for directions.
</span>
</div>
<div className="form-wrapper">
<Form name="security-form" onFinish={handleSubmit}>
Expand Down
43 changes: 38 additions & 5 deletions web/src/containers/Admin/SetupWizard/Assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,26 @@ const Assets = ({
if (Object.keys(coins).length !== 0) {
if (coins['usdt']) {
return coins['usdt'].symbol;
} else {
const firstCoinKey = Object.keys(coins)[0];
return coins[firstCoinKey].symbol;
}

const [firstFiatCoinKey] =
Object.entries(coins).find(
([_, { meta: { is_fiat } = {} }]) => is_fiat
) || [];
if (firstFiatCoinKey) {
return coins[firstFiatCoinKey].symbol;
}

if (coins['btc']) {
return coins['btc'].symbol;
}

if (coins['eth']) {
return coins['eth'].symbol;
}

const firstCoinKey = Object.keys(coins)[0];
return coins[firstCoinKey].symbol;
}
};

Expand All @@ -45,6 +61,13 @@ const Assets = ({
};
updateConstants(formValues, () => handleNext(3));
};

const open = (link) => {
if (window) {
window.open(link, '_blank');
}
};

return (
<div className="asset-content show-scroll">
<div className="title-text">Native currency</div>
Expand All @@ -70,7 +93,12 @@ const Assets = ({
<div className="title-text">Review assets</div>
<div>
Don't see your asset?{' '}
<span className="step-link">Create or add your asset here.</span>
<span
className="step-link"
onClick={() => open('https://dash.bitholla.com/financial')}
>
Create or add your asset here.
</span>
</div>
<div className="coin-wrapper">
{Object.keys(coins).map((symbol, index) => {
Expand All @@ -86,7 +114,12 @@ const Assets = ({
<div className="title-text">Review pairs</div>
<div>
Don't see your pair?{' '}
<span className="step-link">Create or add your pair here.</span>
<span
className="step-link"
onClick={() => open('https://dash.bitholla.com/trade')}
>
Create or add your pair here.
</span>
</div>
<div className="coin-wrapper last">
{Object.keys(pairs).map((pair, index) => {
Expand Down
6 changes: 6 additions & 0 deletions web/src/containers/Admin/SetupWizard/SetupComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ class ExchangeSetup extends Component {
? null
: 'icon-align'
}
beforeInjection={(svg) => {
if (value.icon === STATIC_ICONS.SETUP_QUICK_TRADE) {
svg.setAttribute('width', '216px');
svg.setAttribute('height', '216px');
}
}}
/>
</div>
<div className="setup-field-label">{value.title}</div>
Expand Down
1 change: 1 addition & 0 deletions web/src/containers/Admin/Tiers/ModalForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ class NewTierForm extends Component {
<Editor
wrapperClassName="text-editor-wrapper"
editorClassName="text-editor"
toolbarClassName="text-editor-toolbar"
editorState={editorState}
onEditorStateChange={this.onEditorStateChange}
/>
Expand Down
4 changes: 3 additions & 1 deletion web/src/containers/Admin/Tiers/Tiers.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ const TiersContainer = ({
</div>
<div className="mx-3 f-1">
<div>
<div>Account Tier {tier}</div>
<div>
{tierData.name ? tierData.name : `Account Tier ${tier}`}
</div>
<div className="description">{tierData.description}</div>
</div>
<div className="requirement-divider"></div>
Expand Down
3 changes: 3 additions & 0 deletions web/src/containers/Admin/Tiers/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
border-radius: 4px;
min-height: 200px;
}
.new-tier-form .text-editor-toolbar {
color: black;
}
.table-tier-icon {
height: 2.5rem;
width: 2.5rem;
Expand Down
6 changes: 6 additions & 0 deletions web/src/containers/App/Socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ import {
setSnackDialog,
setConfig,
setInfo,
setPlugins,
requestPlugins,
requestInitial,
requestConstant,
} from '../../actions/appActions';
Expand Down Expand Up @@ -70,6 +72,9 @@ class Container extends Component {
if (!this.props.fetchingAuth) {
this.initSocketConnections();
}
requestPlugins().then(({ data = {} }) => {
if (data.data && data.data.length !== 0) this.props.setPlugins(data.data);
});
}

UNSAFE_componentWillReceiveProps(nextProps) {
Expand Down Expand Up @@ -722,6 +727,7 @@ const mapDispatchToProps = (dispatch) => ({
setConfig: bindActionCreators(setConfig, dispatch),
setInfo: bindActionCreators(setInfo, dispatch),
getMe: bindActionCreators(getMe, dispatch),
setPlugins: bindActionCreators(setPlugins, dispatch),
});

export default connect(mapStateToProps, mapDispatchToProps)(Container);
1 change: 1 addition & 0 deletions web/src/containers/Init/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const Login = (props) => {
}}
onSubmit={handleSubmit}
buttonText={'Proceed'}
submitOnKeyDown={true}
/>
</div>
</div>
Expand Down
9 changes: 9 additions & 0 deletions web/src/containers/Init/_Init.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ $color-white: #ffffff;
flex: 1;
height: 100%;

input {
border: 1px solid #c4c4c4;
}

input:focus {
border: 1px solid #ffffff;
outline: 1px solid #ffffff;
}

.message {
color: $color-white;
width: 100%;
Expand Down
5 changes: 5 additions & 0 deletions web/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -3592,6 +3592,11 @@ table th {
.init-container {
flex: 1;
height: 100%; }
.init-container input {
border: 1px solid #c4c4c4; }
.init-container input:focus {
border: 1px solid #ffffff;
outline: 1px solid #ffffff; }
.init-container .message {
color: #ffffff;
width: 100%;
Expand Down
Loading

0 comments on commit f149144

Please sign in to comment.