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
19 changes: 19 additions & 0 deletions src/containers/bootstrap/breadcrumb.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';


export const breadcrumb: React.FC = () => {
return (
<div className="container-fluid my-3">
<div className="row">
<div className="col-11 mx-auto">
<ul className="breadcrumb">
<li className="breadcrumb-item">
<a href="@{fst bc}">#[snd bc]</a>
</li>
<li className="breadcrumb-item active">#[title]</li>
</ul>
</div>
</div>
</div>
)
}
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
165 changes: 165 additions & 0 deletions src/containers/bootstrap/layout/nav.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
import React, { ReactNode, ReactNodeArray } from 'react';
import { RouteComponentProps } from 'react-router';
import navbarLogo from '@/assets/logo/logo-header.png';
import { NavLink, Link } from 'react-router-dom';


export type GroupItemProps = {
label?: ReactNode,
route: string
}

const menuLeftGroupItem: React.FC<GroupItemProps> = (props) => {
return (
<li className="nav-item mx-2">
<NavLink className="nav-link" to={props.route}>
{props.label || props.children}
</NavLink>
</li>
)
}

type Props = {
left?: ReactNode | ReactNodeArray
}

const layoutNavContainer: React.FC<Props> = props => {
return (
<nav
className="navbar sticky-top navbar-dark navbar-expand-lg"
style={{ backgroundColor: 'black' }}
>
<button
className="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#main-nav-menu"
aria-controls="main-nav-menu"
aria-expanded="false"
aria-label="Показать меню"
>
<span className="navbar-toggler-icon" />
</button>
<NavLink className="navbar-brand" to="/">
<img src={navbarLogo} style={{ maxHeight: '20px' }} alt="OutBirds" />
</NavLink>
<div
id="main-nav-menu"
className="collapse navbar-collapse justify-content-between"
>
<ul className="navbar-nav">
{props.left}
</ul>
<span className="navbar-text d-flex d-lg-none">
<i className="fas fa-wallet align-self-center" />
<span className="d-block ml-2"> _[MsgBalance]</span>
</span>
<span className="navbar-text font-weight-bold d-flex d-lg-none wallet-balance-val">
#[cents2dblT cents]&nbsp;
<span className="font-weight-normal">#[currSign cur]</span>
</span>
<span className="navbar-text d-block d-lg-none">#[userName]</span>
<ul className="navbar-nav d-flex d-lg-none">
<li className="nav-item">
<a className="nav-link" href="@{route}">
#[label]
</a>
</li>
</ul>
<ul className="navbar-nav">
<li className="nav-item mx-2">
<a className="nav-link" href="@{route}">
#[label]
</a>
</li>
</ul>
<ul className="navbar-nav d-flex">
<li id="#navWalletDropdownId" className="nav-item dropdown">
<a
id="#navWalletDropdownId-toggle"
className="nav-link dropdown-toggle"
data-toggle="dropdown"
href="#"
role="button"
aria-expanded="false"
aria-haspopup="true"
>
<i className="fas fa-wallet" />
</a>
<div
className="dropdown-menu"
aria-labelledby="#navWalletDropdownId-toggle"
>
<a
className="dropdown-item font-weight-bold wallet-balance-val"
href="#"
>
#[cents2dblT cents]&nbsp;
<span className="font-weight-normal">#[currSign cur]</span>
</a>
</div>
</li>
<li id="#navManageDropdownId" className="nav-item dropdown">
<a
id="#navManageDropdownId-toggle"
className="nav-link dropdown-toggle"
data-toggle="dropdown"
href="#"
role="button"
aria-expanded="false"
aria-haspopup="true"
>
_[MsgManage]
</a>
<div
className="dropdown-menu"
aria-labelledby="#navManageDropdownId-toggle"
>
<span className="navbar-text d-flex px-3 text-uppercase">
<i className="fas fa-pen-nib align-self-center" />
<span className="d-block ml-2">_[MsgEditMenuTitle]</span>
</span>

<a className="dropdown-item" href="@{route}">
#[label]
</a>
<span className="navbar-text d-flex px-3 text-uppercase">
<i className="fas fa-donate align-self-center" />
<span className="d-block ml-2">_[MsgRequestsMenuTitle]</span>
</span>
<a className="dropdown-item" href="@{route}">
#[label]
</a>
<a className="dropdown-item" href="@{route}">
#[label]
</a>
</div>
</li>
<li id="#navUserDropdownId" className="nav-item dropdown mr-5">
<a
id="#navUserDropdownId-toggle"
className="nav-link dropdown-toggle"
data-toggle="dropdown"
href="#"
role="button"
aria-expanded="false"
aria-haspopup="true"
>
#[userName]
</a>
<div
className="dropdown-menu"
aria-labelledby="#navUserDropdownId-toggle"
>
<a className="dropdown-item" href="@{route}">
#[label]
</a>
</div>
</li>
</ul>
</div>
</nav>
)
}

export default layoutNavContainer;
19 changes: 19 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,19 @@
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]#
<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>
)
}
43 changes: 43 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,43 @@
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>
<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]
<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]
<small className="text-muted">#[renderPairIn pair]</small>
</span>
</td>
</tr>
</div>
)
}
32 changes: 32 additions & 0 deletions src/containers/desktop/client/withdrawal/layout/Withdrawal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
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]
<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>
)
}
Loading