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

Hamlet template rewrite #3

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
6 changes: 5 additions & 1 deletion .umirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import packageJson from './package.json';
const DYN_API_ADDR = 'outb-demo.agolos.ru'
const DEF_API_PORT = '80'

const apiAddr = process.env['BACKEND_API'] || `http://${DYN_API_ADDR}:${DEF_API_PORT}`
const apiAddr =
process.env['BACKEND_API'] && process.env['BACKEND_API'] != ''
? `http://${process.env['BACKEND_API']}`
: `http://${DYN_API_ADDR}:${DEF_API_PORT}`

// tslint:disable-next-line: no-console
console.log('Using following back-end API URL: %s. You can change setting env BACKEND_API var.', apiAddr)
// ref: https://umijs.org/config/
Expand Down
24 changes: 18 additions & 6 deletions src/containers/bootstrap/default-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,25 @@ export const breadcrumb: React.FC = () => {
}

export interface BootstrapLayoutProps extends RouteComponentProps {
appVersion?: string;
breadcrumb?: ReactNode;
appVersion?: {
number: string,
extraLabel?: string
},
breadcrumb?: ReactNode
}

const layoutContainer: React.FC<BootstrapLayoutProps> = props => {
const appVerExtra = props.appVersion && props.appVersion.extraLabel || null
const appVersion = props.appVersion
? (
<small className="text-muted">
v{props.appVersion.number}
{` `}
{appVerExtra && <small className="text-lowercase">{appVerExtra}</small>}
</small>
)
: null

return (
<div>
<nav
Expand Down Expand Up @@ -212,10 +226,8 @@ const layoutContainer: React.FC<BootstrapLayoutProps> = props => {
<div className="col pt-3" style={{ background: '#e9ecef' }}>
<p className="text-center">
_[MsgCurrencyExchangeService] «OutBirds»
<small className="text-muted">
v{props.appVersion}
<small className="text-lowercase">_[MsgVerPublicBeta]</small>
</small>
{` `}
{appVersion}
</p>
</div>
</div>
Expand Down
18 changes: 18 additions & 0 deletions src/containers/desktop/client/deposit/request/amount/Deposit.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';


export default function () {
return (
<div>
<big>
<s>#[ac]#</s>
<b>#[ac]#</b>
<small className="text-muted">#[currSign c]</small>
</big>
<br/>
<small className="text-muted">#[sign]#[cents2dblT f]#
Copy link
Owner Author

Choose a reason for hiding this comment

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

Move #[sign]#[cents2dblT f]# to new line

<small>#[currSign c] ^[d]</small>
</small>
</div>
)
}
49 changes: 49 additions & 0 deletions src/containers/desktop/client/order/list/row/Orders.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React from 'react';


export default function () {
return (
<div>
<tr
id="order-data-#{fromSqlKey orderId}"
className="data-row"
>
<td className="text-muted text-center">
<small>
#[renderDateTimeRow l tzo (exchangeOrderCreated order)]
</small>
</td>
<td className="text-center">
<big>#[renderOrderExchange order]</big>
</td>
<td className="text-center">
<small className="text-muted">x# \#[renderOrderRate order]&nbsp;#</small>
<small className="text-muted">#[renderOrderNRatioSign order]</small>
</td>
<td>#[renderOrderRemainderExecuted l tzo order]</td>
<td className="controls">
<a href="#{urlRender (ClientOrderViewR orderId)}">
<i
className="control fas fa-info-circle"
title="#{messageRender MsgViewOrderHistory}"
/>
<i
className="order-cancel-button control fas fa-times-circle"
title="#{messageRender MsgCancelOrder}"
/>
<form
method="post"
action="#{urlRender ClientOrderCancelR}"
>
<input
type="hidden"
name="order-id"
value="#{fromSqlKey orderId}"
/>
</form>
</a>
</td>
</tr>
</div>
)
}
40 changes: 40 additions & 0 deletions src/containers/desktop/client/order/operation/row/Orders.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from 'react';


export default function () {
return (
<div>
<tr className="data-row">
<td className="text-center">
<small>
#[renderDateTimeRow l tzo (exchangeOrderExecutionTime op)]
</small>
</td>
<td>
<small>_[MsgExchange] #</small>
<span>
<b>#[cents2dblT transfered]#</b>
<small className="text-muted">#[renderPairOut pair]</small>
<small>_[MsgOrderWasExecuted] #</small>
</span>
</td>
<td className="text-center align-middle">+#<span>
Copy link
Owner Author

Choose a reason for hiding this comment

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

Move <span> to new line

<b>#[cents2dblT (income - fee)]#</b>
<small className="text-muted">#[renderPairIn pair]</small>
</span>
<br className="d-md-none"/>
<small className="d-md-none">-#
<span>#[cents2dblT fee]
Copy link
Owner Author

Choose a reason for hiding this comment

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

Tag content to new line

<small className="text-muted">#[renderPairIn pair]</small>
</span>
</small>
</td>
<td className="d-none d-md-table-cell text-center align-middle">-#
<span>#[cents2dblT fee]
Copy link
Owner Author

Choose a reason for hiding this comment

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

Move tag contents to new line

<small className="text-muted">#[renderPairIn pair]</small>
</span>
</td>
</tr>
</div>
)
}
31 changes: 31 additions & 0 deletions src/containers/desktop/client/withdrawal/layout/Withdrawal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react';


export default function () {
return (
<div>
<div className="row">
<div className="col-10 mx-auto">
<div className="alert alert-warning">
<div className="error">#[e]</div>
</div>
</div>
</div>
<form
id="#{formId}"
method="post"
encType="#{enctype}"
action="@{WithdrawalCreateR}"
className="col-12 col-sm-10 col-md-8 mx-auto"
>^[widget]
Copy link
Owner Author

Choose a reason for hiding this comment

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

Move tag contents to new line

<div className="form-group row justify-content-center">
<button
className="btn btn-lg btn-outline-primary mt-2"
type="submit"
>вывод
Copy link
Owner Author

Choose a reason for hiding this comment

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

Move tag contents to new line

</button>
</div>
</form>^[withdrawalHistory]
Copy link
Owner Author

Choose a reason for hiding this comment

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

Move ^[withdrawalHistory] to new line

</div>
)
}
43 changes: 43 additions & 0 deletions src/containers/desktop/client/withdrawal/list/row/Withdrawal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React from 'react';


export default function () {
return (
<div>
<tr
className="data-row"
id="data-row-#{fromSqlKey ident}"
>
<td>^[dateTimeRowW withdrawalRequestCreated\</td>
<td className="align-middle">
<s>^[valueW]</s>
<b>^[valueW]</b>
<span>^[valueW]</span>
<br/>
<small className="text-muted">
_[transferMethodMsg withdrawalRequestMethod]
</small>
</td>
<td className="align-middle">^[expected]</td>
<td className="align-middle">^[status]</td>
<td className="controls align-middle">
<i
className="request-cancel-button control fas fa-times-circle"
title="_{MsgCancelRequest}"
/>
<form
className="request-cancel-form d-none"
method="post"
action="@{ClientCancelWithdrawalR}"
>
<input
type="hidden"
name="request-id"
value="#{fromSqlKey ident}"
/>
</form>
</td>
</tr>
</div>
)
}
19 changes: 19 additions & 0 deletions src/containers/desktop/profile/desc/deposit/Profile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';


export default function () {
return (
<div>
<td>#[renderAmount cents c]</td>
<td>
<span>_[MsgBalanceDeposit]#</span>
<span>: #</span>
<a
href="@{DepositR}/#data-row-#{requestIdStr eRequest}"
title="_{MsgViewRequestDetails}"
>\_[MsgRequest] ##[requestIdStr eRequest]
Copy link
Owner Author

Choose a reason for hiding this comment

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

Tag contents to new line

</a>
</td>
</div>
)
}
19 changes: 19 additions & 0 deletions src/containers/desktop/profile/desc/order/cancellation/Profile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';


export default function () {
return (
<div>
<td>#[renderAmount cents c]#</td>
<td>
<span>_[MsgOrderCancellation]#</span>
<span>: #</span>
<a
href="@{ClientOrderViewR (exchangeOrderCancellationOrderId ec)}"
title="_{MsgViewOrderDetails}"
>\_[MsgOrder] ##[requestIdStr eRequest]
Copy link
Owner Author

Choose a reason for hiding this comment

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

Newline

</a>
</td>
</div>
)
}
19 changes: 19 additions & 0 deletions src/containers/desktop/profile/desc/order/creation/Profile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';


export default function () {
return (
<div>
<td>#[renderAmount cents c]#</td>
<td>
<span>_[MsgOrderCreated]#</span>
<span>: #</span>
<a
href="@{ClientOrderViewR eid}"
title="_{MsgViewOrderDetails}"
>\_[MsgOrder] ##[requestIdStr eRequest]
Copy link
Owner Author

Choose a reason for hiding this comment

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

Newline

</a>
</td>
</div>
)
}
19 changes: 19 additions & 0 deletions src/containers/desktop/profile/desc/order/execution/Profile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';


export default function () {
return (
<div>
<td>#[renderAmount cents c]#</td>
<td>
<span>_[MsgOrderExecution]#</span>
<span>: #</span>
<a
href="@{ClientOrderViewR (exchangeOrderExecutionOrderId e)}"
title="_{MsgViewOrderDetails}"
>\_[MsgOrder] ##[requestIdStr eRequest]
Copy link
Owner Author

Choose a reason for hiding this comment

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

Newline

</a>
</td>
</div>
)
}
19 changes: 19 additions & 0 deletions src/containers/desktop/profile/desc/withdrawal/Profile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';


export default function () {
return (
<div>
<td>#[renderAmount cents c]#</td>
<td>
<span>_[MsgBalanceWithdrawal]#</span>
<span>: #</span>
<a
href="@{WithdrawalR}/#data-row-#{requestIdStr eRequest}"
title="_{MsgViewRequestDetails}"
>\_[MsgRequest] ##[requestIdStr eRequest]
Copy link
Owner Author

Choose a reason for hiding this comment

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

Newline

</a>
</td>
</div>
)
}
19 changes: 19 additions & 0 deletions src/containers/desktop/profile/desc/withdrawal/cancel/Profile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';


export default function () {
return (
<div>
<td>#[renderAmount cents c]#</td>
<td>
<span>_[MsgBalanceReturn]#</span>
<span>: #</span>
<a
href="@{WithdrawalR}/#data-row-#{requestIdStr eRequest}"
title="_{MsgViewRequestDetails}"
>\_[MsgRequest] ##[requestIdStr eRequest]
Copy link
Owner Author

Choose a reason for hiding this comment

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

Newline

</a>
</td>
</div>
)
}
19 changes: 19 additions & 0 deletions src/containers/desktop/profile/desc/withdrawal/reject/Profile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';


export default function () {
return (
<div>
<td>#[renderAmount cents c]#</td>
<td>
<span>_[MsgBalanceReturn]#</span>
<span>: #</span>
<a
href="@{WithdrawalR}/#data-row-#{requestIdStr eRequest}"
title="_{MsgViewRequestDetails}"
>\_[MsgRequest] ##[requestIdStr eRequest]
Copy link
Owner Author

Choose a reason for hiding this comment

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

Newline

</a>
</td>
</div>
)
}
Loading