Skip to content

Commit

Permalink
Merge pull request #67 from SmartCash/feature/improvements
Browse files Browse the repository at this point in the history
Feature/improvements
  • Loading branch information
brunohenz authored Jul 6, 2021
2 parents c6e6626 + 2873223 commit 97299d4
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 23 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "beehivedesktop",
"version": "1.0.7",
"version": "1.0.8",
"description": "A decentralized Smartcash wallet.",
"private": true,
"author": "SmartCash",
Expand Down
6 changes: 5 additions & 1 deletion src/presentation/components/Wallet.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.wBalance{
width: 90%;
}

.btnCopy {
width: 20px;
height: 20px;
Expand Down Expand Up @@ -42,7 +46,7 @@
.numberVersion{
text-align: right;
float: right;
width: 400px;
width: 100%;
}
.version{
color: var(--primary);
Expand Down
4 changes: 2 additions & 2 deletions src/presentation/components/Wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ function Wallet({ wallet, isCurrent }) {
return (
<div className={`wallet ${isCurrent && 'wallet-current'}`} role="button">
<div className="symbol" onClick={() => setWalletCurrent(wallet)}>
</div>
<div className="content">
<div onClick={() => setWalletCurrent(wallet)}>
<div onClick={() => setWalletCurrent(wallet)} className="wBalance">
<p className="amount">
<Balance value={ wallet.balance.unlocked } />
</p>
Expand Down
8 changes: 5 additions & 3 deletions src/presentation/components/login-modal/login-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function LoginModal() {
const [showModal, setShowModal] = useState(true);
const [loading, setLoading] = useState(false);
const [savePasswordInContext, setSavePasswordInContext] = useState(false);

const handleDecryptWallets = async () => {
setLoading(true);
const wallets = await decryptWallets(_password);
Expand All @@ -40,7 +40,8 @@ export function LoginModal() {
<p className="version">v{pjson.version}</p>
</div>
<div className={style['modal-body']}>
<div className={style['address-content']}>
<form onSubmit={e => { e.preventDefault(); handleDecryptWallets(e); }}>
<div className={style['address-content']}>
{!loading && (
<React.Fragment>
<div className={style['password-wrapper']}>
Expand Down Expand Up @@ -73,7 +74,7 @@ export function LoginModal() {
</div>

<div className={style.buttonArea}>
<button className={style.btnOpen} onClick={handleDecryptWallets}>Start BeeHive</button>
<button type="submit" className={style.btnOpen}>Start BeeHive</button>
</div>
</React.Fragment>
)}
Expand All @@ -83,6 +84,7 @@ export function LoginModal() {
</p>
)}
</div>
</form>
</div>
</div>
</div>
Expand Down
9 changes: 6 additions & 3 deletions src/presentation/components/modal/modal.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@
font-weight: 700;
line-height: 1;
color: #000;
opacity: 0.3;
opacity: 0.7;
cursor: pointer;
border: none;
background-color: transparent;
}

.modal-title {
color: var(--primary);
margin-bottom: -10px;
}

.address-content {
Expand Down Expand Up @@ -138,7 +140,9 @@
}

.buttonArea{
margin-top: 40px;
margin-top: 40px;
width: 100%;
text-align: center;
}

.inputPass{
Expand Down Expand Up @@ -178,5 +182,4 @@
font-family: inherit;
margin: 26px 0 0;
cursor: pointer;
margin-left: -170px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export function PasswordModal(props) {

return (
<Modal title="Password" onClose={onClose}>
<form onSubmit={e => { e.preventDefault(); handleCallback(e); }}>
<p>Please, input your password to complete this action.</p>
<p>Check the flag "Remember Password" to hide this modal in future actions.</p>

Expand Down Expand Up @@ -71,7 +72,8 @@ export function PasswordModal(props) {
)}


<button className={style.sendbutton} onClick={handleCallback}>Send</button>
<button type="submit" className={style.sendbutton}>Send</button>
</form>
</Modal>
);
}
4 changes: 3 additions & 1 deletion src/presentation/pages/chat/Chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@

.page-chat .message {
width: 60%;
word-wrap: normal !important;
overflow-wrap: normal !important;
}

.page-chat .transaction-messages {
Expand Down Expand Up @@ -181,7 +183,7 @@
padding: 0;
color: var(--primary);
font-size: 16px;
word-break: break-all;
word-break: normal;
}

.page-chat .transaction button {
Expand Down
9 changes: 7 additions & 2 deletions src/presentation/pages/chat/Chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ function ChatComponent() {
handleCalculateChatFee(message, getRecipientRSAPublicKey());
}, 1000);

async function refreshButton(){
await _getTransactionHistory();
setTimeout(() => messagesRef?.current?.scrollToBottom(), 50);
};

return (
<Page className="page-chat">
{!hasPass() && (
Expand All @@ -180,7 +185,7 @@ function ChatComponent() {
<div className="header">
<span className="title">Chats</span>
{<button onClick={() => handleSetNewChat()}>Start chat</button>}
<button onClick={() => _getTransactionHistory()}>Refresh</button>
<button onClick={() => refreshButton()}>Refresh</button>
</div>
{error && <p className="error">{error}</p>}
<Scrollbars renderThumbVertical={(props) => <div {...props} className="thumb-vertical" />}>
Expand Down Expand Up @@ -229,7 +234,7 @@ function ChatComponent() {
X
</button>
<p>
<strong>Message has been sent. Refresh to show message.</strong>
<strong>Message has been sent. Refresh to show message.</strong>
</p>
<div className="msgSuccess">Transaction ID: </div>
<strong className="txID">{TXID}</strong>
Expand Down
9 changes: 5 additions & 4 deletions src/presentation/pages/receive/Receive.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
right: -200px;
bottom: 0;
width: 190px;
display: inline;
flex-direction: column;
}

.page-receive .qrcode .btnWrapper button ~ button {
Expand Down Expand Up @@ -67,6 +65,8 @@
object-fit: contain;
fill: #fff;
position: relative;
float: left;
margin-right: 10px;
}

.page-receive .btnCopy:active {
Expand All @@ -91,8 +91,9 @@
}

.page-receive .descIcon{
color: var(--primary);
float: right;
color: var(--primary);
font-size: 12px;
margin: 0 0 0 8px;
width: 350px;
text-align: left;
}
6 changes: 4 additions & 2 deletions src/presentation/pages/receive/Receive.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ function Receive() {
}}
>
<IconDownload className="btnCopy" />
<p className="descIcon">Download the QR Code image</p>
</button>
<p className="descIcon">Download the QR Code image</p>

</div>

<div className="btnIcon">
Expand All @@ -75,8 +76,9 @@ function Receive() {
}}
>
<IconCopy className="btnCopy" />
<p className="descIcon">Copy QR Code image</p>
</button>
<p className="descIcon">Copy QR Code image</p>

</div>
</div>
</div>
Expand Down
3 changes: 0 additions & 3 deletions src/presentation/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,6 @@ body {
display: inline;
padding: 1px 5px;
}
.wallet .btnCopy {
margin-left: 16px;
}

/* FormControl */
.form-control {
Expand Down

0 comments on commit 97299d4

Please sign in to comment.