Skip to content

Commit

Permalink
Merge pull request #864 from crypto-com/dev
Browse files Browse the repository at this point in the history
Internal Release v0.5.8
  • Loading branch information
crypto-matto authored Dec 7, 2021
2 parents 109ecd5 + f0b8011 commit 976c924
Show file tree
Hide file tree
Showing 21 changed files with 222 additions and 89 deletions.
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
*Unreleased*

*Released*
## [v0.5.8] - 2021-12-07

### Additions
- Adapt to Christmas app icon
- Add memo field support in Address Book
- Add Address Book support in custom destination address on Cronos Bridge
- Update dependencies to stable versions

### Bug fixes
- Update deprecated balance retrieval endpoint for Crypto.org Mainnet upgrade

## [v0.5.7] - 2021-12-02

Expand Down Expand Up @@ -309,7 +319,6 @@ All notable changes to this project will be documented in this file.

- Replace previous pre-encryption disk persistence by temporary memory state that's flushed later on


## [v0.0.13] - 2021-01-07

### Added Features
Expand All @@ -322,6 +331,5 @@ All notable changes to this project will be documented in this file.

### Known Limitation

- This wallet is only testnet-ready, do not use in mainnet.
- Do not transfer any ERC20 tokens to addresses generated by this sample code as it can cause loss of funds.
- Crypto.com is not liable for any potential damage, loss of data/files arising from the use of the wallet.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@ Please refer to the [Instructions on Multi-Language Content Management](./CONTEN
[Apache 2.0](./LICENSE)

## Manual Build for Development

### For M1 Chip Macs 💻
At this moment, the project could only be compiled with `node` in `x64` binary version.

Please check the installed binary version of your `node`:

```
node -p process.arch
x64
```
If `arm64` is returned, open your favourite Shell in Rosetta

```
arch -x86_64 /bin/bash
```

Reinstall `node` 14 or 15 under Rosetta. The reinstalled `node` will be in `x64` binary version by default.

### Installation

```
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chain-desktop-wallet",
"version": "0.5.7",
"version": "0.5.8",
"description": "Crypto.com Chain Desktop Wallet App",
"repository": "github:crypto-com/chain-desktop-wallet",
"author": "Crypto.org <[email protected]>",
Expand Down Expand Up @@ -330,6 +330,7 @@
"trim-newlines": "3.0.1",
"normalize-url": "5.3.1",
"tar": "6.1.9",
"glob-parent": "5.1.2"
"glob-parent": "6.0.2",
"json-schema": "0.4.0"
}
}
Binary file modified public/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 16 additions & 5 deletions src/components/AddressBookInput/AddressBookInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,26 @@ interface IAddressBookInputProps {
userAsset: UserAsset;
currentSession: Session;
onChange: (value: string, addressBookContact?: AddressBookContact) => void;
disabled?: boolean;
initialValue?: string;
isDefaultInput?: boolean;
}

const AddressBookInput = (props: IAddressBookInputProps) => {
const { userAsset, currentSession, onChange } = props;
const {
userAsset,
currentSession,
onChange,
initialValue,
disabled = false,
isDefaultInput = false,
} = props;

const [, setNavbarSelectedKey] = useRecoilState(navbarMenuSelectedKeyState);
const history = useHistory();
const [t] = useTranslation();

const [value, setValue] = useState<string>();
const [value, setValue] = useState<string>(initialValue ?? '');
const [contacts, setContacts] = useState<AddressBookContact[]>([]);

const walletId = currentSession.wallet.identifier;
Expand Down Expand Up @@ -56,6 +66,7 @@ const AddressBookInput = (props: IAddressBookInputProps) => {
<AutoComplete
showSearch
allowClear
disabled={disabled}
dropdownRender={menu => (
<div>
{menu}
Expand All @@ -77,7 +88,7 @@ const AddressBookInput = (props: IAddressBookInputProps) => {
</div>
)}
showArrow={false}
value={value}
value={initialValue ?? value}
autoFocus
options={contacts.map(contact => {
return {
Expand Down Expand Up @@ -119,7 +130,7 @@ const AddressBookInput = (props: IAddressBookInputProps) => {
});
}}
>
{currentContact ? (
{currentContact && !isDefaultInput ? (
<Select
mode="multiple"
size="large"
Expand Down Expand Up @@ -171,7 +182,7 @@ const AddressBookInput = (props: IAddressBookInputProps) => {
}}
/>
) : (
<Input />
<Input disabled={disabled} value={initialValue ?? value} />
)}
</AutoComplete>
</div>
Expand Down
12 changes: 12 additions & 0 deletions src/components/AddressBookModal/AddAddressModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const FormKeys = {
asset: 'asset',
label: 'label',
address: 'address',
memo: 'memo',
};

const AddAddressModal = (props: IAddAddressModalProps) => {
Expand Down Expand Up @@ -119,6 +120,7 @@ const AddAddressModal = (props: IAddAddressModalProps) => {
const address: string = form.getFieldValue(FormKeys.address);
const network: string = form.getFieldValue(FormKeys.network);
const assetSymbol: string = form.getFieldValue(FormKeys.asset);
const memo: string = form.getFieldValue(FormKeys.memo);

const validateFiles = [label, address, network, assetSymbol];

Expand All @@ -133,6 +135,7 @@ const AddAddressModal = (props: IAddAddressModalProps) => {
assetSymbol,
label,
address,
memo,
);
if (!success) {
message.error(t('settings.addressBook.message.updateFailed'));
Expand All @@ -146,6 +149,7 @@ const AddAddressModal = (props: IAddAddressModalProps) => {
assetSymbol,
label,
address,
memo,
});

if (!contactCreated) {
Expand Down Expand Up @@ -248,6 +252,14 @@ const AddAddressModal = (props: IAddAddressModalProps) => {
>
<Input placeholder={t('settings.addressBook.form.enterAddress')} />
</Form.Item>
<Form.Item
name={FormKeys.memo}
label={t('send.modal1.label5')}
initialValue={contact?.memo}
hasFeedback
>
<Input />
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit" style={{ marginLeft: '0' }}>
{isEditing
Expand Down
11 changes: 11 additions & 0 deletions src/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,17 @@
}
}

.ant-select-clear,
.ant-form-item-children-icon {
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
}
.ant-select-clear {
right: 48px !important;
}

body {
margin: 0;
font-weight: 500;
Expand Down
4 changes: 4 additions & 0 deletions src/language/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
"navbar.receive": "Receive",
"navbar.assets": "Assets",
"navbar.bridge": "Cronos Bridge",
"navbar.dapp": "DApp Browser",
"navbar.governance": "Governance",
"navbar.nft": "My NFT",
"navbar.settings": "Settings",
Expand Down Expand Up @@ -342,6 +343,7 @@
"bridge.form.fee": "Fee: ",
"bridge.form.destination": "Destination: ",
"bridge.form.toAddress": "To Address: ",
"bridge.form.toAddressLabel": "Destination Address",
"bridge.form.customAddress.message": "I want to send funds to a custom destination address.",
"bridge.form.transfer": "Transfer Asset",
"bridge.form.receiving": "Receiving",
Expand Down Expand Up @@ -384,6 +386,8 @@
"bridge.transactionHistory.table.toAddress": "To (Network)",
"bridge.transactionHistory.table.time": "Time",
"bridge.transactionHistory.table.status": "Status",
"dapp.title": "DApp Browser",
"dapp.description": "Connect and access DApps on Cronos Chain",
"staking.title": "Staking",
"staking.tab1": "Staking Rewards",
"staking.tab2": "Delegate Funds",
Expand Down
3 changes: 3 additions & 0 deletions src/language/ko-KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
"navbar.receive": "수신",
"navbar.assets": "금액",
"navbar.bridge": "Cronos 브릿지",
"navbar.dapp": "DApp 브라우저",
"navbar.governance": "거버넌스",
"navbar.nft": "나의 NFT",
"navbar.settings": "설정",
Expand Down Expand Up @@ -340,6 +341,7 @@
"bridge.form.fee": "수수료",
"bridge.form.destination": "목적지",
"bridge.form.toAddress": "수신인 주소",
"bridge.form.toAddressLabel": "수신인 주소",
"bridge.form.customAddress.message": "지정된 주소로 송금하고 싶습니다",
"bridge.form.transfer": "전송 자산",
"bridge.form.receiving": "수신 중",
Expand Down Expand Up @@ -382,6 +384,7 @@
"bridge.transactionHistory.table.toAddress": "수신인(네트워크)",
"bridge.transactionHistory.table.time": "시간",
"bridge.transactionHistory.table.status": "상태",
"dapp.title": "DApp 브라우저",
"staking.title": "스테이킹",
"staking.tab1": "스테이킹 보상",
"staking.tab2": "금액 위임",
Expand Down
4 changes: 4 additions & 0 deletions src/language/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
"navbar.receive": "接收",
"navbar.assets": "资产",
"navbar.bridge": "Cronos 跨链桥",
"navbar.dapp": "DApp 浏览器",
"navbar.governance": "治理",
"navbar.nft": "我的NFT",
"navbar.settings": "设置",
Expand Down Expand Up @@ -342,6 +343,7 @@
"bridge.form.fee": "费用:",
"bridge.form.destination": "目标地址:",
"bridge.form.toAddress": "收款人地址:",
"bridge.form.toAddressLabel": "收款人地址",
"bridge.form.customAddress.message": "我想转移至另一自定收款人地址",
"bridge.form.transfer": "转移资产",
"bridge.form.receiving": "将会收到",
Expand Down Expand Up @@ -384,6 +386,8 @@
"bridge.transactionHistory.table.toAddress": "到(网络)",
"bridge.transactionHistory.table.time": "时间",
"bridge.transactionHistory.table.status": "状态",
"dapp.title": "DApp 浏览器",
"dapp.description": "于 Cronos链 上连接和访问 DApp",
"staking.title": "抵押",
"staking.tab1": "抵押奖励",
"staking.tab2": "委托资金",
Expand Down
4 changes: 4 additions & 0 deletions src/language/zh-HK.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
"navbar.receive": "接收",
"navbar.assets": "資產",
"navbar.bridge": "Cronos 跨鏈橋",
"navbar.dapp": "DApp 瀏覽器",
"navbar.governance": "治理",
"navbar.nft": "我的NFT",
"navbar.settings": "設置",
Expand Down Expand Up @@ -342,6 +343,7 @@
"bridge.form.fee": "費用:",
"bridge.form.destination": "目標地址:",
"bridge.form.toAddress": "收款人地址:",
"bridge.form.toAddressLabel": "收款人地址",
"bridge.form.customAddress.message": "我想轉移至另一自定收款人地址",
"bridge.form.transfer": "轉移資產",
"bridge.form.receiving": "將會收到",
Expand Down Expand Up @@ -384,6 +386,8 @@
"bridge.transactionHistory.table.toAddress": "到(網絡)",
"bridge.transactionHistory.table.time": "時間",
"bridge.transactionHistory.table.status": "狀態",
"dapp.title": "DApp 瀏覽器",
"dapp.description": "於 Cronos鏈 上連接和訪問 DApp",
"staking.title": "抵押",
"staking.tab1": "抵押獎勵",
"staking.tab2": "委託資金",
Expand Down
2 changes: 2 additions & 0 deletions src/models/AddressBook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface AddressBookContact {
assetSymbol: string;
label: string;
address: string;
memo: string;
}

// for persistence
Expand All @@ -16,6 +17,7 @@ export interface AddressBookContactModel {
assetSymbol: string;
label: string;
address: string;
memo: string;
}

interface AddressBookNetwork {
Expand Down
4 changes: 4 additions & 0 deletions src/pages/assets/components/FormSend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ const FormSend: React.FC<FormSendProps> = props => {
walletAsset.name,
walletAsset.symbol,
toAddress,
memo,
);
}

Expand Down Expand Up @@ -271,6 +272,9 @@ const FormSend: React.FC<FormSendProps> = props => {
form.setFieldsValue({
recipientAddress: value,
});
form.setFieldsValue({
memo: contact?.memo,
});
setCurrentAddressBookContact(contact);
}}
currentSession={currentSession}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/bridge/components/CronosBridgeForm.less
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
text-align: left;
}
.ant-form-item-has-feedback .ant-input {
padding-right: 44px;
padding-right: 68px;
}
}
}
Loading

0 comments on commit 976c924

Please sign in to comment.