diff --git a/README.md b/README.md index 44471668..6bd9bc2f 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Unlike other centralized messaging apps BChat never collect any user data like p The message you sent using BChat will be highly secure and anonymous. No one (even us) can have control of your data that has been shared in BChat. Wtih BChat you own your data.

-![BChatDesktop](https://bchat.beldex.io/blog/wp-content/uploads/2022/10/Your-Profile.png) +![BChatDesktop](https://bchat.beldex.io/img/Profile.png) Contributing code ----------------- diff --git a/build/afterPackHook.js b/build/afterPackHook.js index 84c2e580..d31828a5 100644 --- a/build/afterPackHook.js +++ b/build/afterPackHook.js @@ -24,7 +24,7 @@ module.exports = async function(context) { return; } // eslint-disable-next-line no-console - // console.log('afterPack hook triggered', context); + const executableName = context.packager.executableName; const sourceExecutable = path.join(context.appOutDir, executableName); diff --git a/package.json b/package.json index ece28f53..07ee19ac 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "bchat-desktop", "productName": "BChat", "description": "Private messaging from your desktop", - "version": "2.5.0", + "version": "2.5.1", "license": "GPL-3.0", "author": { "name": "Beldex team", diff --git a/stylesheets/_avatar.scss b/stylesheets/_avatar.scss index 08a2a138..6ed10c7e 100644 --- a/stylesheets/_avatar.scss +++ b/stylesheets/_avatar.scss @@ -10,8 +10,8 @@ $borderAvatarColor: unquote( // border-radius: 50%; flex-shrink: 0; // border-radius: 7px; - overflow: hidden; - border-radius: 12px; + // overflow: hidden; + // border-radius: 12px; img { object-fit: cover; @@ -97,11 +97,11 @@ $borderAvatarColor: unquote( } .module-avatar__icon-closed { - .module-avatar:first-child{ - z-index: 1; - // box-shadow: 3px 3px 0px 0px rgba(0,0,0 ,75%); - box-shadow: 2px 2px 2px 0px var(--color-chatHeader); - } + // .module-avatar:first-child{ + // z-index: 1; + // // box-shadow: 3px 3px 0px 0px rgba(0,0,0 ,75%); + // box-shadow: 2px 2px 2px 0px var(--color-chatHeader); + // } .module-avatar:last-child { position: absolute; right: 0px; diff --git a/stylesheets/_bchat.scss b/stylesheets/_bchat.scss index 8ff4286b..6c49d75f 100644 --- a/stylesheets/_bchat.scss +++ b/stylesheets/_bchat.scss @@ -80,7 +80,7 @@ textarea { opacity: 0.3; } -.button-group>div { +.button-group > div { display: inline-flex; margin-inline-start: 5px; margin-inline-end: 5px; @@ -397,7 +397,6 @@ textarea { &.brand, &.medium { &.secondary:hover:not(.disabled) { - background-color: var(--color-secondary-btn-hover-bg); } @@ -639,7 +638,6 @@ label { } .audio-message { - // height: 40px; .timer { width: 60px; @@ -767,21 +765,21 @@ label { padding: 25px; padding-bottom: 0px; - font-family: $bchat-font-poppins-bold; + // font-family: $bchat-font-poppins-bold; // text-align: center; line-height: 18px; - font-size: $bchat-font-h3; - font-weight: 500; + font-size: $bchat-font-h2; + font-weight: 700; margin-top: 10px; &.reverse { flex-direction: row-reverse; - .bchat-modal__header__close>div { + .bchat-modal__header__close > div { float: right; } - .bchat-modal__header__icons>div { + .bchat-modal__header__icons > div { float: left; padding-inline-start: 0px; padding-inline-end: 10px; @@ -816,13 +814,13 @@ label { float: right; } - &__close>div { + &__close > div { float: left; padding: $bchat-margin-xs; margin: 0px; } - &__icons>div { + &__icons > div { float: right; padding-inline-start: 10px; } @@ -841,7 +839,6 @@ label { // } .message { text-align: center; - } .bchat-id-editable { @@ -1167,15 +1164,32 @@ label { font-size: 16px; text-align: left; } + .currency-search { + height: 60px; + /* margin-inline-end: 1px; */ + /* margin-bottom: 10px; */ + display: inline-flex; + flex-shrink: 0; + padding: 0 21px; + border-radius: 16px; + border: 2px solid var(--color-search-border); + display: flex; + align-items: center; + width: 450px; + background-color: var(--color-confirm-modal-inner-bg); + input{ + background-color: unset; + } + } &__walletModel { - width: 390px; - margin: 10px 10px 25px; + width: 450px; + margin: 10px 4px 25px; // font-family: 'Poppins'; background-color: var(--color-confirm-modal-inner-bg); border-radius: 16px; padding: 20px 20px 0px; - max-height: 300px; + max-height: 241px; overflow-x: hidden; } @@ -1583,7 +1597,15 @@ label { font-weight: 300; } - .react-contexify__item:not(.react-contexify__item--disabled):hover>.react-contexify__item__content { + .react-contexify__item:not(.react-contexify__item--disabled):focus + > .react-contexify__item__content, + .react-contexify__item:not(.react-contexify__item--disabled):hover + > .react-contexify__item__content { + background-color: var(--color-context-menu-hover-bg) !important; + border-radius: 14px; + } + .react-contexify__item:not(.react-contexify__item--disabled):hover + > .react-contexify__item__content { border-radius: 14px; // background: #333842; // color: var(--color-text-menu-highlighted); @@ -1598,7 +1620,7 @@ label { &.react-contexify__submenu { top: 0px !important; // height of an item element - + // right: 300px !important; .react-contexify__item__content { justify-content: start; } @@ -1801,7 +1823,7 @@ label { left: 50%; margin: -40px 0 0 -40px; - &>div { + & > div { display: block; } } @@ -2021,7 +2043,6 @@ label { border-bottom: 0.5px solid var(--color-search-border); border-radius: unset; } - } .bchat-settings { @@ -3373,7 +3394,6 @@ label { // } &-syncStatus { - // position: relative; // height: 30px; // // width: 66.5%; @@ -3449,7 +3469,8 @@ label { &-filterInput { // width: 315px; - width: 150px; + // width: 150px; + width: 220px; border: none; outline: none; height: 40px; @@ -3594,7 +3615,6 @@ label { // width: 605px; // width: 75%; margin-left: 15px; - &-amount { cursor: pointer; @@ -3752,11 +3772,11 @@ label { transition: $bchat-transition-duration; } - input:hover+label:before { + input:hover + label:before { background: var(--color-accent); } - input:checked+label:before { + input:checked + label:before { background: var(--color-accent); } } @@ -3954,7 +3974,7 @@ input { width: 100%; // max-height: 400px; overflow-y: auto; - height: 53%; + height: 100%; // margin: auto 0 auto 0; // border: var(--border-bchat); // border-bottom: var(--border-bchat); @@ -4023,7 +4043,7 @@ input { } } - .floated-downArrow-btn-wrapper+.downArrow-unreadCountBox { + .floated-downArrow-btn-wrapper + .downArrow-unreadCountBox { background-color: #ffffff; color: #000; } @@ -4155,7 +4175,7 @@ input { opacity: 0.8; } - &__avatar>div { + &__avatar > div { margin-bottom: 0px !important; } @@ -4253,4 +4273,4 @@ input { &:hover { color: var(--color-context-menu-hover-bg); } -} \ No newline at end of file +} diff --git a/stylesheets/_bchat_constants.scss b/stylesheets/_bchat_constants.scss index ac1dfea8..e629ef73 100644 --- a/stylesheets/_bchat_constants.scss +++ b/stylesheets/_bchat_constants.scss @@ -228,7 +228,8 @@ $bchat-subtle-factor: 0.6; // Default Components $bchat-search-input-height: 34px; // $main-view-header-height: 63px; -$main-view-header-height: 70px; +// $main-view-header-height: 70px; +$main-view-header-height: 90px; $bchat-left-pane-width: 300px; diff --git a/stylesheets/_bchat_left_pane.scss b/stylesheets/_bchat_left_pane.scss index 727792fd..f264f575 100644 --- a/stylesheets/_bchat_left_pane.scss +++ b/stylesheets/_bchat_left_pane.scss @@ -11,10 +11,8 @@ $bchat-compose-margin: 20px; } .module-conversation { - // default conversation list item text color &__user__profile { - &-number, &-name { // font-weight: bold;bchat-noMsgRequest @@ -141,6 +139,13 @@ $bchat-compose-margin: 20px; } } } +.appVersion { + color: #a7a7ba; + font-size: 12px; + font-style: normal; + font-weight: 400; + line-height: normal; +} .offline-msg { margin: 11px; @@ -170,7 +175,7 @@ $bchat-compose-margin: 20px; display: flex; align-items: center; justify-content: center; - color: #108D32; + color: #108d32; margin-right: 10px; } @@ -203,7 +208,6 @@ $bchat-compose-margin: 20px; } @keyframes dot-blink { - 0%, 80%, 100% { @@ -437,6 +441,7 @@ $bchat-compose-margin: 20px; margin: 15px; padding: 15px; position: relative; + height: 475px; .avatar-Wrapper { display: flex; @@ -797,17 +802,17 @@ $bchat-compose-margin: 20px; align-items: center; // .search { - // margin-top: 13px; - // display: flex; - // justify-content: center; - // justify-items: center; - // align-items: center; - // width: 32px; - // height: 32px; - // &:hover { - // background-color: var(--color-profile-close); - // border-radius: 20px; - // } + // margin-top: 13px; + // display: flex; + // justify-content: center; + // justify-items: center; + // align-items: center; + // width: 32px; + // height: 32px; + // &:hover { + // background-color: var(--color-profile-close); + // border-radius: 20px; + // } // } .bchat-icon-button { @@ -922,7 +927,6 @@ $bchat-compose-margin: 20px; } .left-pane-contact { - &-section, &-content { display: flex; @@ -931,7 +935,6 @@ $bchat-compose-margin: 20px; flex: 1; .module-conversation-list-item { - &__header__date, &__message { display: none; @@ -1058,7 +1061,7 @@ $bchat-compose-margin: 20px; margin-top: -7px; } - &>div { + & > div { display: block; } @@ -1146,4 +1149,4 @@ $bchat-compose-margin: 20px; font-family: $bchat-font-default; font-size: $bchat-font-sm; } -} \ No newline at end of file +} diff --git a/stylesheets/_bchat_signin.scss b/stylesheets/_bchat_signin.scss index 7dd91de4..8690c631 100644 --- a/stylesheets/_bchat_signin.scss +++ b/stylesheets/_bchat_signin.scss @@ -72,7 +72,18 @@ &-registration { padding-inline-end: 128px; } + .signUp-btn { + .bchat-button.default.primary:hover { + background-color: #00B72A !important; + } + + } + .signIn-btn { + .bchat-button.default-outline.primary:hover { + background-color: #108d32 !important; + } + } &-header { display: flex; flex-direction: row; @@ -135,9 +146,9 @@ // padding-top: 20px; // margin-left: 26px; margin-bottom: $bchat-margin-md; - width: 417px + width: 417px; } - + &__content1 { width: 100%; padding-top: 20px; @@ -221,7 +232,7 @@ &-loadingGif { background: #101010ad; position: absolute; - width: 60%; + width: 55%; height: 100%; top: 0px; right: 0px; @@ -253,7 +264,7 @@ .iconBox:hover { // transform: scale(1.1); // color: #1ced23; - background-color: #2E333D; + background-color: #2e333d; border-radius: 10px; // opacity: 0.5; } @@ -343,14 +354,14 @@ &-recovery-phrase-txt { color: #f0f0f0; - font-size: 14px; + font-size: 18px; margin: 0; padding: 10px 10px 10px 0px; } &-recovery-phrase-hintTxt { color: #a9aeba; - font-size: 11px; + font-size: 16px; span { color: #ff9649; @@ -359,10 +370,10 @@ } &-restore-seed { - &__address-container { - // width: 90%; - // margin: 0 auto; - } + // &__address-container { + // width: 90%; + // margin: 0 auto; + // } &-parent-box { // display: flex; @@ -423,7 +434,7 @@ &:hover { // opacity: 0.5; // background-color: var(--color-profile-close); - background-color: #2E333D; + background-color: #2e333d; } } } @@ -548,7 +559,7 @@ height: 35px; color: white; opacity: 1; - background-image: url("../images/bchat/calendar.svg"); + background-image: url('../images/bchat/calendar.svg'); background-repeat: no-repeat; background-position: center; background-size: 27px; @@ -561,7 +572,7 @@ // width: 35px; // height: 35px; // padding: 10px; - background-color: #2E333D; + background-color: #2e333d; } } @@ -663,4 +674,4 @@ @include bchat-color-subtle(var(--color-text)); font-size: 13px; -} \ No newline at end of file +} diff --git a/ts/bchat/apis/file_server_api/FileServerApiV2.ts b/ts/bchat/apis/file_server_api/FileServerApiV2.ts index 529a4293..b278ab7d 100644 --- a/ts/bchat/apis/file_server_api/FileServerApiV2.ts +++ b/ts/bchat/apis/file_server_api/FileServerApiV2.ts @@ -46,7 +46,6 @@ export const uploadFileToFsV2 = async ( endpoint: FILES_ENDPOINT, queryParams, }; - // console.log('FILES_ENDPOINT:result:', request); const result = await sendApiV2Request(request); console.log('FILES_ENDPOINT:result:', result); const statusCode = parseStatusCodeFromOnionRequest(result); @@ -158,11 +157,10 @@ export const getLatestDesktopReleaseFileToFsV2 = async (): Promise = {}; import { Snode } from '../../../data/data'; import { ERROR_CODE_NO_CONNECT } from './SNodeAPI'; import { Onions } from '.'; -import { hrefPnServerDev, hrefPnServerProd } from '../push_notification_api/PnServer'; +import { hrefPnServerProd } from '../push_notification_api/PnServer'; import { callUtilsWorker } from '../../../webworker/workers/util_worker_interface'; export const resetSnodeFailureCount = () => { @@ -127,7 +127,7 @@ async function buildOnionCtxs( let target = '/beldex/v2/lsrpc'; const isCallToPn = - finalRelayOptions?.host === hrefPnServerDev || finalRelayOptions?.host === hrefPnServerProd; + finalRelayOptions?.host === hrefPnServerProd; if (!isCallToPn) { target = '/beldex/v3/lsrpc'; } @@ -137,6 +137,7 @@ async function buildOnionCtxs( target, method: 'POST', }; + // FIXME http Social groups v2 are not working // tslint:disable-next-line: no-http-string if (finalRelayOptions?.protocol === 'http') { diff --git a/ts/bchat/utils/String.ts b/ts/bchat/utils/String.ts index 9a1ecde3..220cf971 100644 --- a/ts/bchat/utils/String.ts +++ b/ts/bchat/utils/String.ts @@ -45,7 +45,9 @@ export const stringToUint8Array = (str: string): Uint8Array => { }; // Regex to match all characters which are forbidden in display names -const forbiddenDisplayCharRegex = /\uFFD2*/g; +// const forbiddenDisplayCharRegex = /\uFFD2*/g ; +// Regex to match alphanumeric characters which are forbidden in display names +const forbiddenDisplayCharRegex =/[^a-zA-Z0-9]/g; /** * diff --git a/ts/bchat/utils/calling/CallManager.ts b/ts/bchat/utils/calling/CallManager.ts index 5473857f..1855561b 100644 --- a/ts/bchat/utils/calling/CallManager.ts +++ b/ts/bchat/utils/calling/CallManager.ts @@ -40,6 +40,7 @@ import { showLeftPaneSection, showSettingsSection, } from '../../../state/ducks/section'; +import moment from 'moment'; // tslint:disable: function-name @@ -1040,10 +1041,9 @@ export async function handleCallTypeOffer( } window.log.info('handling callMessage OFFER with uuid: ', remoteCallUUID); - if (!getCallMediaPermissionsSettings()) { + if (!getCallMediaPermissionsSettings() ) { const cachedMsg = getCachedMessageFromCallMessage(callMessage, incomingOfferTimestamp); pushCallMessageToCallCache(sender, remoteCallUUID, cachedMsg); - await handleMissedCall(sender, incomingOfferTimestamp, 'permissions'); return; } @@ -1131,14 +1131,22 @@ export async function handleMissedCall( incomingCallConversation?.getNickname() || incomingCallConversation?.getProfileName() || 'Unknown'; - const openPrivacySettings = () => { - window.inboxStore?.dispatch(showLeftPaneSection(SectionType.Settings)); - window.inboxStore?.dispatch(showSettingsSection(BchatSettingCategory.Privacy)); - }; + + + + const openPrivacySettings = () => { + window.inboxStore?.dispatch(showLeftPaneSection(SectionType.Settings)); + window.inboxStore?.dispatch(showSettingsSection(BchatSettingCategory.Privacy)); + }; + const momentTimestamp = moment(incomingOfferTimestamp); + const currentDate = moment(); + // Calculate one minute ago from the current date + const oneMinuteAgo = currentDate.subtract(1, 'minutes'); + const timeValidation=momentTimestamp?.isSameOrAfter(oneMinuteAgo) switch (reason) { case 'permissions': - window.inboxStore?.dispatch( + timeValidation&& window.inboxStore?.dispatch( updateConfirmModal({ title: window.i18n('callMissedTitle'), message: window.i18n('callMissedCausePermission', [displayname]), @@ -1154,8 +1162,7 @@ export async function handleMissedCall( iconSize: 30, }) ); - - ToastUtils.pushedMissedCallCauseOfPermission(displayname); + timeValidation && ToastUtils.pushedMissedCallCauseOfPermission(displayname); break; case 'another-call-ongoing': ToastUtils.pushedMissedCall(displayname); diff --git a/ts/components/BchatMainPanel.tsx b/ts/components/BchatMainPanel.tsx index e8079e29..21c14725 100644 --- a/ts/components/BchatMainPanel.tsx +++ b/ts/components/BchatMainPanel.tsx @@ -40,9 +40,7 @@ export const BchatMainPanel = () => { // }, []); - // const walletPassWordValidation = () => { - // // console.log('WalletSyncInitiatedWithChat ::',WalletSyncInitiatedWithChat); - + // const walletPassWordValidation = () => { // if (chatwithWallet && !walletSyncBarShowInChat && !isSettingsView) { // dispatch(updateBchatWalletPasswordModal({})) diff --git a/ts/components/BchatPasswordPrompt.tsx b/ts/components/BchatPasswordPrompt.tsx index 32c00fc7..99e0266a 100644 --- a/ts/components/BchatPasswordPrompt.tsx +++ b/ts/components/BchatPasswordPrompt.tsx @@ -60,7 +60,6 @@ class BchatPasswordPromptInner extends React.PureComponent<{}, State> { public render() { const showResetElements = this.state.errorCount >= MAX_LOGIN_TRIES; let checkError: any = this.state.error; - // console.log("checkError:",checkError) if (checkError) { // console.log("checkErrorr:try:",checkError) } diff --git a/ts/components/MainViewController.tsx b/ts/components/MainViewController.tsx index 3ffe8a81..786ae403 100644 --- a/ts/components/MainViewController.tsx +++ b/ts/components/MainViewController.tsx @@ -120,7 +120,8 @@ export const AddNewContactInEmptyConvo = () => { const StartConvoWrapper = styled.div` width: 24vw; max-width: 470px; -margin-left: 43px; +// margin-left: 43px; +margin-left: 100px; `; // ///////////////////////////////////// diff --git a/ts/components/avatar/AvatarPlaceHolder/AvatarPlaceHolder.tsx b/ts/components/avatar/AvatarPlaceHolder/AvatarPlaceHolder.tsx index 314f23e5..b74f73a5 100644 --- a/ts/components/avatar/AvatarPlaceHolder/AvatarPlaceHolder.tsx +++ b/ts/components/avatar/AvatarPlaceHolder/AvatarPlaceHolder.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import { getInitials } from '../../../util/getInitials'; +// import { getInitials } from '../../../util/getInitials'; type Props = { diameter: number; @@ -22,8 +22,8 @@ const cachedHashes = new Map(); const avatarPlaceholderColors = [ { - bgColor: '#4AAC67', - bodyColor: '#2C7040', + bgColor: '#9A58CD', + bodyColor: '#623882', }, { bgColor: '#A9D1FD', @@ -93,7 +93,11 @@ function useHashBasedOnPubkey(pubkey: string) { } export const AvatarPlaceHolder = (props: Props) => { - const { pubkey, diameter, name } = props; + const { + pubkey, + diameter, + // name + } = props; const { hash, loading } = useHashBasedOnPubkey(pubkey); @@ -122,17 +126,23 @@ export const AvatarPlaceHolder = (props: Props) => { ); } - const initials = getInitials(name); + // const initials = getInitials(name); - const fontSize = Math.floor(initials.length > 1 ? diameter * 0.4 : diameter * 0.5); + // const fontSize = Math.floor(initials.length > 1 ? diameter * 0.4 : diameter * 0.5); const bgColorIndex = hash % avatarPlaceholderColors.length; const avatarColors = avatarPlaceholderColors[bgColorIndex]; - console.log(avatarColors.bgColor, fontSize); return ( -
+
void; }; -function getClosedGroupAvatarsSize(size: AvatarSize): AvatarSize { - // Always use the size directly under the one requested - switch (size) { - case AvatarSize.S: - return AvatarSize.XS; - case AvatarSize.M: - return AvatarSize.S; - case AvatarSize.L: - return AvatarSize.M; - case AvatarSize.XL: - return AvatarSize.L; - case AvatarSize.HUGE: - return AvatarSize.XL; - default: - throw new Error(`Invalid size request for closed group avatar: ${size}`); - } -} +// function getClosedGroupAvatarsSize(size: AvatarSize): AvatarSize { +// // Always use the size directly under the one requested +// switch (size) { +// case AvatarSize.S: +// return AvatarSize.XS; +// case AvatarSize.M: +// return AvatarSize.S; +// case AvatarSize.L: +// return AvatarSize.M; +// case AvatarSize.XL: +// return AvatarSize.L; +// case AvatarSize.HUGE: +// return AvatarSize.XL; +// default: +// throw new Error(`Invalid size request for closed group avatar: ${size}`); +// } +// } export const ClosedGroupAvatar = (props: Props) => { const { closedGroupId, size, onAvatarClick } = props; + const darkMode = useSelector(getTheme) === 'dark'; const memberAvatars = useMembersAvatars(closedGroupId); - const avatarsDiameter = getClosedGroupAvatarsSize(size); + // const avatarsDiameter = getClosedGroupAvatarsSize(size); + const avatarsDiameter = size; + const firstMemberId = memberAvatars?.[0]; - const secondMemberID = memberAvatars?.[1]; + // const secondMemberID = memberAvatars?.[1]; return (
- + + + + {/* */}
); }; + +const ScrtGrpProfileWrapper = styled.div` + position: absolute; + top: 44px; + right: -10px; + z-index: 2; +`; diff --git a/ts/components/basic/BchatInput.tsx b/ts/components/basic/BchatInput.tsx index b9196ffd..f96dd452 100644 --- a/ts/components/basic/BchatInput.tsx +++ b/ts/components/basic/BchatInput.tsx @@ -17,6 +17,7 @@ type Props = { autoFocus?: boolean; ref?: any; inputDataTestId?: string; + max?:string; }; const LabelItem = (props: { inputValue: string; label?: string }) => { @@ -63,6 +64,7 @@ export const BchatInput = (props: Props) => { label, onValueChanged, inputDataTestId, + max } = props; const [inputValue, setInputValue] = useState(''); const [forceShow, setForceShow] = useState(false); @@ -94,6 +96,7 @@ export const BchatInput = (props: Props) => { minLength={minLength} autoFocus={autoFocus} data-testid={inputDataTestId} + max={max} onChange={updateInputValue} className={classNames(enableShowHide ? 'bchat-input-floating-label-show-hide' : '')} // just incase onChange isn't triggered diff --git a/ts/components/conversation/BchatMessagesList.tsx b/ts/components/conversation/BchatMessagesList.tsx index 5950fd3a..8c138924 100644 --- a/ts/components/conversation/BchatMessagesList.tsx +++ b/ts/components/conversation/BchatMessagesList.tsx @@ -102,9 +102,6 @@ export const BchatMessagesList = (props: { } } - // console.log('messageProps ::', messagesProps); - // console.log('messagesProps[0]::',messagesProps[0],messagesProps[1]) - return ( <> diff --git a/ts/components/conversation/BchatMessagesListContainer.tsx b/ts/components/conversation/BchatMessagesListContainer.tsx index 2ac50e37..810d109c 100644 --- a/ts/components/conversation/BchatMessagesListContainer.tsx +++ b/ts/components/conversation/BchatMessagesListContainer.tsx @@ -92,8 +92,6 @@ class BchatMessagesListContainerInner extends React.Component { if (!conversationKey || !conversation) { return null; } - // console.log('conversationKey ::',conversationKey) - // console.log("conversation render",conversation) // let displayedName = null; // if (conversation.type === ConversationTypeEnum.PRIVATE) { // displayedName = getConversationController().getContactProfileNameOrShortenedPubKey( diff --git a/ts/components/conversation/BchatRightPanel.tsx b/ts/components/conversation/BchatRightPanel.tsx index a8de67c6..f7616ab6 100644 --- a/ts/components/conversation/BchatRightPanel.tsx +++ b/ts/components/conversation/BchatRightPanel.tsx @@ -177,7 +177,6 @@ const ProfileName = (props: { onCloseEdit: () => void; grpName: any }) => { }, 3000); } // const onClickOK = useCallback(() => { - // console.log('Save icon clicked', selectedConversation); // // Handle the save action // }, [profileName]); @@ -256,7 +255,7 @@ const HeaderItem = () => { isBnsHolder={isBnsHolder} size={{ width: '20', height: '20' }} > - + @@ -328,7 +327,7 @@ export const BchatRightPanelWithDetails = () => { existingMembers ); const darkMode = useSelector(getTheme) === 'dark'; - const { uniqueValues: selectedContacts } = useSet(); + // const { uniqueValues: selectedContacts } = useSet(); const zoomLevel = window.getSettingValue('zoom-factor-setting'); useEffect(() => { let isRunning = true; @@ -401,7 +400,6 @@ export const BchatRightPanelWithDetails = () => { }, }; }); - // console.log('disappearingMessagesOptions --->', disappearingMessagesOptions); const showUpdateGroupNameButton = isGroup && (!isPublic || (isPublic && weAreAdmin)) && !commonNoShow; const showAddRemoveModeratorsButton = weAreAdmin && !commonNoShow && isPublic; @@ -517,7 +515,6 @@ export const BchatRightPanelWithDetails = () => { setRemoveMem(false); } if (addMem) { - console.log('selectedContacts ...', selectedContacts); // await submitForClosedGroup(id, selectedContacts); await ref.current?.onclick(); setAddMem(false); diff --git a/ts/components/conversation/BnsVerification.ts b/ts/components/conversation/BnsVerification.ts index 75b85ad1..08768f14 100644 --- a/ts/components/conversation/BnsVerification.ts +++ b/ts/components/conversation/BnsVerification.ts @@ -30,7 +30,6 @@ export function bnsVerificationConvo( isPrivateConversationMessage ) { senderConversationModel.setIsBnsHolder(false); - console.log('verify tag disabled'); } else { isPrivateConversationMessage && senderConversationModel.setIsBnsHolder(envelope.isBnsHolder); } @@ -39,7 +38,6 @@ export async function isLinkedBchatIDWithBnsForDeamon(bnsName?: string) { try { const i18n = window.i18n; const ourBnsName = bnsName || window.getLocalValue('ourBnsName'); - console.log(' ourBnsName -------->', ourBnsName); if (!ourBnsName) { return false; } diff --git a/ts/components/conversation/ConversationHeader.tsx b/ts/components/conversation/ConversationHeader.tsx index 85080bd4..997de1e3 100644 --- a/ts/components/conversation/ConversationHeader.tsx +++ b/ts/components/conversation/ConversationHeader.tsx @@ -216,12 +216,12 @@ const AvatarHeader = (props: { { // do not allow right panel to appear if another button is shown on the BchatConversation if (onAvatarClick && !showBackButton) { diff --git a/ts/components/conversation/ConversationRequestButtons.tsx b/ts/components/conversation/ConversationRequestButtons.tsx index 5766e22d..c7a4b2e3 100644 --- a/ts/components/conversation/ConversationRequestButtons.tsx +++ b/ts/components/conversation/ConversationRequestButtons.tsx @@ -48,7 +48,6 @@ export const ConversationMessageRequestButtons = () => { const showMsgRequestUI = convoModel && convoModel.isIncomingRequest(); const handleDeclineConversationRequest = () => { - console.log("handleDeclineConversationRequest:") const customIcon = declineConversationWithConfirm(selectedConversation.id, true, customIcon); }; diff --git a/ts/components/conversation/ExpireTimer.tsx b/ts/components/conversation/ExpireTimer.tsx index c3446648..a4ce3d1b 100644 --- a/ts/components/conversation/ExpireTimer.tsx +++ b/ts/components/conversation/ExpireTimer.tsx @@ -6,6 +6,8 @@ import { getTimerBucketIcon } from '../../util/timer'; import useInterval from 'react-use/lib/useInterval'; import styled from 'styled-components'; import { BchatIcon } from '../icon/BchatIcon'; +import { useSelector } from 'react-redux'; +import { getTheme } from '../../state/selectors/theme'; type Props = { expirationLength: number; @@ -15,18 +17,24 @@ type Props = { const ExpireTimerCount = styled.div<{ color: string; + isdark: boolean; }>` - margin-inline-start: 6px; - font-size: 11px; + margin-inline-end: 10px; + margin-inline-start: 10px; + font-size: 14px; line-height: 16px; letter-spacing: 0.3px; text-transform: uppercase; user-select: none; color: ${props => props.color}; + border-radius: 40px; + background: ${props => (props.isdark ? '#202329' : '#F8F8F8')}; + padding: 3px 10px; `; const ExpireTimerBucket = styled.div` - margin-inline-start: 6px; + margin-inline-end: 10px; + margin-inline-start: 10px; font-size: 11px; line-height: 16px; letter-spacing: 0.3px; @@ -40,7 +48,7 @@ export const ExpireTimer = (props: Props) => { const initialTimeLeft = Math.max(Math.round(((expirationTimestamp || 0) - Date.now()) / 1000), 0); const [timeLeft, setTimeLeft] = useState(initialTimeLeft); - + const darkMode = useSelector(getTheme) === 'dark'; const update = useCallback(() => { if (expirationTimestamp) { const newTimeLeft = Math.max(Math.round((expirationTimestamp - Date.now()) / 1000), 0); @@ -57,16 +65,21 @@ export const ExpireTimer = (props: Props) => { return null; } - const expireTimerColor = 'var(--color-text)'; + const expireTimerColor = darkMode ? '#A7A7BA' : '#858598'; if (timeLeft <= 60) { - return {timeLeft}; + return ( + + {timeLeft} + + ); } + const bucket = getTimerBucketIcon(expirationTimestamp, expirationLength); return ( - + ); }; diff --git a/ts/components/conversation/Image.tsx b/ts/components/conversation/Image.tsx index c2582be8..1d767429 100644 --- a/ts/components/conversation/Image.tsx +++ b/ts/components/conversation/Image.tsx @@ -5,7 +5,7 @@ import { Spinner } from '../basic/Spinner'; import { AttachmentType, AttachmentTypeWithPath } from '../../types/Attachment'; import { useEncryptedFileFetch } from '../../hooks/useEncryptedFileFetch'; import { useDisableDrag } from '../../hooks/useDisableDrag'; -import { BchatIconButton } from '../icon'; +import { BchatIcon } from '../icon'; type Props = { alt: string; @@ -150,18 +150,16 @@ export const Image = (props: Props) => { // }} // className="module-image__close-button" // /> -
- { e.stopPropagation(); if (onClickClose) { onClickClose(attachment); } }} - /> + > +
) : // null} diff --git a/ts/components/conversation/InviteContacts.tsx b/ts/components/conversation/InviteContacts.tsx index d9cacf4b..326d8ba5 100644 --- a/ts/components/conversation/InviteContacts.tsx +++ b/ts/components/conversation/InviteContacts.tsx @@ -44,7 +44,6 @@ type Props = { // pubkeyStr, // ConversationTypeEnum.PRIVATE // ); -// console.log('privateConvo::',privateConvo,groupInvitation) // if (privateConvo) { // void privateConvo.sendMessage({ // body: '', diff --git a/ts/components/conversation/WaveFormAudioPlayer.tsx b/ts/components/conversation/WaveFormAudioPlayer.tsx index 50673f6b..df371d42 100644 --- a/ts/components/conversation/WaveFormAudioPlayer.tsx +++ b/ts/components/conversation/WaveFormAudioPlayer.tsx @@ -29,19 +29,19 @@ const WaveFormAudioPlayerWithEncryptedFile: React.FC = const darkMode = useSelector(getTheme) === 'dark'; function validColor() { const incomingColors = { - waveColor: darkMode ? '#647494' : '#ACACAC', + waveColor: darkMode ? '#16191F' : '#ACACAC', progressColor: '#2F8FFF', cursorColor: '#2F8FFF', }; const outgoingColors = { - waveColor: '#00AA2E', - progressColor: '#00DE16', - cursorColor: '#00DE16', + waveColor: '#1C581C', + progressColor: '#C0FFC9', + cursorColor: '#C0FFC9', + }; const colors = direction === 'incoming' ? incomingColors : outgoingColors; - // console.log(direction, { colors }); return colors; } @@ -50,13 +50,12 @@ const WaveFormAudioPlayerWithEncryptedFile: React.FC = if (waveformRef.current) { surfer = WaveSurfer.create({ container: waveformRef.current, - waveColor: validColor().waveColor, progressColor: validColor().progressColor, cursorColor: validColor().cursorColor, barWidth: 3, - barRadius: 1, // This is crucial for rounded bars + barRadius: 4, // This is crucial for rounded bars cursorWidth: 0, height: 50, barGap: 2, @@ -64,9 +63,9 @@ const WaveFormAudioPlayerWithEncryptedFile: React.FC = }); surfer.load(urlToLoad); - surfer.on('ready', () => { waveSurferRef.current = surfer; + const remainingTime = (surfer.getDuration() - surfer.getCurrentTime()) / 60; setRemainingTime(remainingTime.toFixed(2)); setPlaybackSpeed(surfer.getPlaybackRate()); @@ -85,8 +84,8 @@ const WaveFormAudioPlayerWithEncryptedFile: React.FC = const currentTime = surfer.getCurrentTime(); const remainingTime = (totalTime - currentTime) / 60; if (remainingTime.toFixed(2) == '0.00') { - const remainingTime = (surfer.getDuration()) / 60; - setRemainingTime(remainingTime.toFixed(2)); + const remainingTime = surfer.getDuration() / 60; + setRemainingTime(remainingTime.toFixed(2)); } else { setRemainingTime(remainingTime.toFixed(2)); } @@ -94,7 +93,6 @@ const WaveFormAudioPlayerWithEncryptedFile: React.FC = }); // setWavesurfer(surfer); } - console.log('surfer', surfer) return () => surfer.destroy(); }, [urlToLoad]); @@ -115,7 +113,13 @@ const WaveFormAudioPlayerWithEncryptedFile: React.FC = return (
- + = {playbackSpeed}x
-
-
{remainingTime}
+
+ +
{remainingTime}
{/* */}
diff --git a/ts/components/conversation/composition/CompositionBox.tsx b/ts/components/conversation/composition/CompositionBox.tsx index 6cad19c3..308c0990 100644 --- a/ts/components/conversation/composition/CompositionBox.tsx +++ b/ts/components/conversation/composition/CompositionBox.tsx @@ -293,11 +293,12 @@ class CompositionBoxInner extends React.Component { const { selectedConversation, WalletSyncBarShowInChat, isMe } = this.props; const { draft } = this.state; const getSyncStatus = window.getSettingValue('syncStatus'); - const re = /^\d+\.?\d*$/; - + // const re = /^\d+\.?\d*$/; + const re = /^\d+(\.\d{1,5})?$/; const results = selectedConversation?.type === 'private' && re.test(draft) && + Number(draft) >= 0.1 && // && (draft.length-1 - draft.indexOf(".")) < 4 selectedConversation?.isApproved && selectedConversation?.didApproveMe && @@ -305,7 +306,8 @@ class CompositionBoxInner extends React.Component { this.chatwithWallet && WalletSyncBarShowInChat && !isMe && - getSyncStatus && draft.length <= 16; + getSyncStatus && + draft.length <= 16; return results; } @@ -350,7 +352,7 @@ class CompositionBoxInner extends React.Component { okTheme: BchatButtonColor.Green, address: this.props.selectedConversation?.walletAddress, amount: messagePlaintext, - fee: priority === 'Flash' ? 0.0042 : 0.0014, + fee: priority === 'Flash' ? 0.0291 : 0.0096, Priority: priority, onClickOk: async () => { await this.sendFund(); @@ -376,9 +378,7 @@ class CompositionBoxInner extends React.Component { window.inboxStore?.dispatch(updateSendConfirmModal(null)); window.inboxStore?.dispatch(updateTransactionInitModal(null)); // return ToastUtils.pushToastError('notEnoughBalance', 'Not enough unlocked balance..'); - return window.inboxStore?.dispatch(updateInsufficientBalanceModal(true)); - - + return window.inboxStore?.dispatch(updateInsufficientBalanceModal(true)); } let decimalValue: any = window.getSettingValue(walletSettingsKey.settingsDecimal) || '2 - Two (0.00)'; @@ -582,7 +582,9 @@ class CompositionBoxInner extends React.Component { ? 0 : ((100 * currentHeight) / valdatedDaemonHeight).toFixed(1); - let percentage = pct == 100.0 && currentHeight < valdatedDaemonHeight ? 99.9 : pct; + const percentage = pct == 100.0 && currentHeight < valdatedDaemonHeight ? 99.9 : pct; + window.setSettingValue('syncStatus', percentage >= 99); + return percentage; } @@ -603,12 +605,12 @@ class CompositionBoxInner extends React.Component { return ( <> {selectedConversation?.type === 'private' && - selectedConversation?.isApproved && - selectedConversation?.didApproveMe && - !selectedConversation?.isBlocked && - // re.test(draft) && - this.chatwithWallet && - WalletSyncBarShowInChat ? ( + selectedConversation?.isApproved && + selectedConversation?.didApproveMe && + !selectedConversation?.isBlocked && + // re.test(draft) && + this.chatwithWallet && + WalletSyncBarShowInChat ? ( <>{this.renderCurcularBar()} ) : ( this.chatWithWalletInstruction()} /> @@ -623,7 +625,6 @@ class CompositionBoxInner extends React.Component { // const { selectedConversation, isMe, WalletSyncBarShowInChat ,walletSyncStatus} = this.props; // const getSyncStatus = window.getSettingValue('syncStatus'); - // console.log("walletSyncStatus:",walletSyncStatus) // if ( // selectedConversation?.type === 'private' && // re.test(draft) && @@ -656,13 +657,13 @@ class CompositionBoxInner extends React.Component { this.sendConfirmModal()} /> ) : */} - this.onSendMessage()} />{/* } */} + this.onSendMessage()} /> + {/* } */} ); } private renderCurcularBar(ispopover?: boolean) { - // console.log('this.percentageCalc() ----->', this.percentageCalc()); const pathColor = this.percentageCalc() !== 0 ? '#108D32' : '#FDB12A'; return ( @@ -758,16 +759,9 @@ class CompositionBoxInner extends React.Component { this.percentageCalc() === 0 ? 'Scanning..' : this.percentageCalc() > 0 && this.percentageCalc() < 98 - ? 'Syncronizing..' - : 'Synchronized'; - - // console.log( - // 'stagedAttachments.length!==0 --> ', - // stagedAttachments.length !== 0, - // draft || stagedAttachments.length !== 0, - // 'typingEnabled', - // typingEnabled && (draft || stagedAttachments.length !== 0) - // ); + ? 'Syncronizing..' + : 'Synchronized'; + // const {WalletSyncBarShowInChat}=this.props return ( <> @@ -813,7 +807,13 @@ class CompositionBoxInner extends React.Component { > {this.renderTextArea()} -
+
{selectedConversation?.isPrivate && typingEnabled && !isMe ? this.bchatWalletView() : ''} diff --git a/ts/components/conversation/media-gallery/MediaGridItem.tsx b/ts/components/conversation/media-gallery/MediaGridItem.tsx index 3b5d9ef9..a92418a8 100644 --- a/ts/components/conversation/media-gallery/MediaGridItem.tsx +++ b/ts/components/conversation/media-gallery/MediaGridItem.tsx @@ -29,7 +29,6 @@ const MediaGridItemContent = (props: Props) => { const onImageError = () => { // tslint:disable-next-line no-console - // console.log('MediaGridItem: Image failed to load; failing over to placeholder'); setImageBroken(true); }; diff --git a/ts/components/conversation/message/message-content/MessageAttachment.tsx b/ts/components/conversation/message/message-content/MessageAttachment.tsx index d732385e..08bfe8b6 100644 --- a/ts/components/conversation/message/message-content/MessageAttachment.tsx +++ b/ts/components/conversation/message/message-content/MessageAttachment.tsx @@ -126,7 +126,6 @@ export const MessageAttachment = (props: Props) => { // const { loading, urlToLoad } = useEncryptedFileFetch(attachments[0]?.url || '', attachments[0]?.contentType, false); // // data will be url if loading is finished and '' if not // const srcData = !loading ? urlToLoad : ''; - // console.log('message__attachment ::',srcData,'displayBgBlur -->',displayBgBlur) return (
{ } // const width = getWidth({ previews, attachments }); - // console.log('width --->',width); // const isShowingImage = getIsShowingImage({ attachments, imageBroken, previews, text }); const hasText = Boolean(text); // const hasQuote = !isEmpty(quote); const hasAttachment=attachments.length>0; const hasContentAfterAttachmentAndQuote = !isEmpty(previews) || !isEmpty(text); - // console.log('isShowingImage->',isShowingImage,'hasText->',hasText,'hasQuote',hasQuote,'attachments->',hasAttachment) - // const bgShouldBeTransparent = isShowingImage && !hasText && !hasQuote; const toolTipTitle = moment(serverTimestamp || timestamp).format('llll'); diff --git a/ts/components/conversation/message/message-content/MessageContentWithStatus.tsx b/ts/components/conversation/message/message-content/MessageContentWithStatus.tsx index 353a9717..5db82ae3 100644 --- a/ts/components/conversation/message/message-content/MessageContentWithStatus.tsx +++ b/ts/components/conversation/message/message-content/MessageContentWithStatus.tsx @@ -6,6 +6,7 @@ import { MessageRenderingProps } from '../../../../models/messageType'; import { toggleSelectedMessageId } from '../../../../state/ducks/conversations'; import { getMessageContentWithStatusesSelectorProps, + getMessageStatusProps, isMessageSelectionMode, } from '../../../../state/selectors/conversations'; @@ -13,6 +14,7 @@ import { MessageAuthorText } from './MessageAuthorText'; import { MessageContent } from './MessageContent'; import { MessageContextMenu } from './MessageContextMenu'; import { MessageStatus } from './MessageStatus'; +import { ExpireTimer } from '../../ExpireTimer'; export type MessageContentWithStatusSelectorProps = Pick< MessageRenderingProps, @@ -24,14 +26,23 @@ type Props = { ctxMenuID: string; isDetailView?: boolean; dataTestId?: string; + + expirationLength?: number | null; + expirationTimestamp?: number | null; }; export const MessageContentWithStatuses = (props: Props) => { const contentProps = useSelector(state => getMessageContentWithStatusesSelectorProps(state as any, props.messageId) ); + const dispatch = useDispatch(); const multiSelectMode = useSelector(isMessageSelectionMode); + const selected = useSelector(state => getMessageStatusProps(state as any, props.messageId)); + if (!selected) { + return null; + } + const { status } = selected; const onClickOnMessageOuterContainer = useCallback( (event: React.MouseEvent) => { @@ -62,7 +73,14 @@ export const MessageContentWithStatuses = (props: Props) => { } }; - const { messageId, ctxMenuID, isDetailView, dataTestId } = props; + const { + messageId, + ctxMenuID, + isDetailView, + dataTestId, + expirationLength, + expirationTimestamp, + } = props; if (!contentProps) { return null; } @@ -78,23 +96,39 @@ export const MessageContentWithStatuses = (props: Props) => { style={{ width: hasAttachments && isTrustedForAttachmentDownload ? 'min-content' : 'auto' }} data-testid={dataTestId} > - - + {expirationLength && expirationTimestamp && (status === 'sent' || status === 'read') ? ( + + ) : ( + + )} +
- - + {expirationLength && expirationTimestamp ? ( + + ) : ( + + )} + {!isDeleted && }
); diff --git a/ts/components/conversation/message/message-item/GenericReadableMessage.tsx b/ts/components/conversation/message/message-item/GenericReadableMessage.tsx index 2c55f63e..ffe4a2c0 100644 --- a/ts/components/conversation/message/message-item/GenericReadableMessage.tsx +++ b/ts/components/conversation/message/message-item/GenericReadableMessage.tsx @@ -15,7 +15,7 @@ import { isMessageSelectionMode, } from '../../../../state/selectors/conversations'; import { getIncrement } from '../../../../util/timer'; -import { ExpireTimer } from '../../ExpireTimer'; +// import { ExpireTimer } from '../../ExpireTimer'; import { MessageAvatar } from '../message-content/MessageAvatar'; import { MessageContentWithStatuses } from '../message-content/MessageContentWithStatus'; import { ReadableMessage } from './ReadableMessage'; @@ -203,26 +203,28 @@ export const GenericReadableMessage = (props: Props) => { )}
- {expirationLength && expirationTimestamp && ( + {/* {expirationLength && expirationTimestamp && ( - )} + )} */} - {expirationLength && expirationTimestamp && ( + {/* {expirationLength && expirationTimestamp && ( - )} + )} */}
{!isIncoming && isSelectionMode && (
diff --git a/ts/components/conversation/message/message-item/GroupUpdateMessage.tsx b/ts/components/conversation/message/message-item/GroupUpdateMessage.tsx index 148ee462..c154ffbe 100644 --- a/ts/components/conversation/message/message-item/GroupUpdateMessage.tsx +++ b/ts/components/conversation/message/message-item/GroupUpdateMessage.tsx @@ -17,8 +17,6 @@ const ChangeItemJoined = (added: Array): string => { } const names = useConversationsUsernameWithQuoteOrFullPubkey(added); const joinKey = added.length > 1 ? 'multipleJoinedTheGroup' : 'joinedTheGroup'; -// console.log("update grp names ::",names); - // return window.i18n(joinKey, [names.join(', ')]); return added.length > 1 ? window.i18n(joinKey, [names.join(', ')]) : window.i18n(joinKey, [names.join('')]); }; diff --git a/ts/components/conversation/message/message-item/MessageDetail.tsx b/ts/components/conversation/message/message-item/MessageDetail.tsx index ee52c02b..6b92d56f 100644 --- a/ts/components/conversation/message/message-item/MessageDetail.tsx +++ b/ts/components/conversation/message/message-item/MessageDetail.tsx @@ -105,7 +105,6 @@ export const MessageMoreInfoModal = (props:MessagePropsDetails) => { messageId, } = props; // const selectedMsg = useSelector(state => getMessageTextProps(state as any, messageId)); -// console.log('selected -->',selectedMsg) // const messageDetailProps = useSelector(getMessageDetailsViewProps); // const isDeletable = useSelector(state => // getMessageIsDeletable(state as any, messageDetailProps?.messageId || '') diff --git a/ts/components/conversation/message/message-item/PaymentMessage.tsx b/ts/components/conversation/message/message-item/PaymentMessage.tsx index 3ce5f8e7..3b66d724 100644 --- a/ts/components/conversation/message/message-item/PaymentMessage.tsx +++ b/ts/components/conversation/message/message-item/PaymentMessage.tsx @@ -46,7 +46,6 @@ export const PaymentMessage = (props: any) => { } function HindTxt() { - // console.log() const iconColor = 'var(--color-text)'; if (props.messageId === '1234-567-7890') { diff --git a/ts/components/dialog/BchatNicknameDialog.tsx b/ts/components/dialog/BchatNicknameDialog.tsx index 72c56b35..3f4ce8bd 100644 --- a/ts/components/dialog/BchatNicknameDialog.tsx +++ b/ts/components/dialog/BchatNicknameDialog.tsx @@ -18,8 +18,6 @@ export const BchatNicknameDialog = (props: Props) => { const { conversationId } = props; const [nickname, setNickname] = useState(''); // const usernames = String(useConversationUsername(conversationId)); - // console.log("username ::",usernames); - const dispatch = useDispatch(); /** diff --git a/ts/components/dialog/BchatWalletPasswordModal.tsx b/ts/components/dialog/BchatWalletPasswordModal.tsx index 92b54e12..a01e9dd6 100644 --- a/ts/components/dialog/BchatWalletPasswordModal.tsx +++ b/ts/components/dialog/BchatWalletPasswordModal.tsx @@ -81,6 +81,7 @@ export const BchatWalletPasswordModal = (props: any) => { return ToastUtils.pushToastError('walletInvalidPassword', openWallet.error?.message); } else { await wallet.startHeartbeat('inChat'); + daemon.daemonHeartbeat(); showSyncBar(); return; } @@ -102,7 +103,6 @@ export const BchatWalletPasswordModal = (props: any) => { }); function backToChat() { - // console.log('backToChat'); dispatch(clearSearch()); dispatch(setOverlayMode(undefined)); dispatch(showLeftPaneSection(0)); diff --git a/ts/components/dialog/BchatWalletSendConfirmModal.tsx b/ts/components/dialog/BchatWalletSendConfirmModal.tsx index 5df7cf29..45074d16 100644 --- a/ts/components/dialog/BchatWalletSendConfirmModal.tsx +++ b/ts/components/dialog/BchatWalletSendConfirmModal.tsx @@ -138,14 +138,10 @@ export const BchatSendConfirm = (props: BchatConfirmDialogProps) => { async function passwordVerify() { setConfirm(true); } - // useFocusMount(inputRef, true); - - // console.log('inputRef ::',inputRef) - return ( { - const [isEnlargedImageShown, setIsEnlargedImageShown] = useState(false); + // const [isEnlargedImageShown, setIsEnlargedImageShown] = useState(false); const convo = getConversationController().get(props.conversationId); - const size = isEnlargedImageShown ? AvatarSize.HUGE : AvatarSize.XL; + // const size = isEnlargedImageShown ? AvatarSize.HUGE : AvatarSize.XL; function closeDialog() { window.inboxStore?.dispatch(updateUserDetailsModal(null)); } @@ -66,17 +66,21 @@ export const UserDetailsDialog = (props: Props) => { { - setIsEnlargedImageShown(!isEnlargedImageShown); - }} + size={AvatarSize.HUGE} + // size={size} + // onAvatarClick={() => { + // setIsEnlargedImageShown(!isEnlargedImageShown); + // }} pubkey={props.conversationId} /> diff --git a/ts/components/icon/Icons.tsx b/ts/components/icon/Icons.tsx index 39ebd6f0..eb53c1cd 100644 --- a/ts/components/icon/Icons.tsx +++ b/ts/components/icon/Icons.tsx @@ -1,4 +1,5 @@ export type BchatIconType = + | 'accept' | 'addUser' | 'attachment' | 'appeareance' @@ -53,6 +54,7 @@ export type BchatIconType = | 'crown' | 'closedgroup' | 'clearData' + | 'decline' | 'delete' | 'deleteContact' | 'document' @@ -187,6 +189,12 @@ export type BchatIconType = export type BchatIconSize = 'tiny' | 'small' | 'medium' | 'large' | 'huge' | 'huge2' | 'max'; export const icons = { + accept: { + path: + 'M5.1001 8.6002C5.8001 9.3002 6.7001 9.7002 7.6001 9.9002C8.5001 10.1002 9.5001 10.0002 10.4001 9.6002C11.3001 9.2002 12.1001 8.6002 12.6001 7.8002C13.1001 7.0002 13.4001 6.1002 13.4001 5.1002C13.4001 3.8002 12.9001 2.6002 12.0001 1.7002C11.0001 0.800195 9.8001 0.200195 8.5001 0.200195C7.5001 0.200195 6.6001 0.500195 5.8001 1.0002C5.0001 1.6002 4.4001 2.4002 4.0001 3.3002C3.6001 4.2002 3.5001 5.1002 3.7001 6.1002C3.9001 7.0002 4.4001 7.9002 5.1001 8.6002ZM4.9001 3.6002C5.2001 2.9002 5.7001 2.3002 6.3001 1.9002C7.0001 1.5002 7.7001 1.2002 8.5001 1.2002C9.5001 1.2002 10.5001 1.6002 11.2001 2.3002C11.9001 3.0002 12.3001 4.0002 12.3001 5.0002C12.3001 5.8002 12.1001 6.5002 11.6001 7.2002C11.2001 7.8002 10.6001 8.3002 9.9001 8.6002C9.2001 8.9002 8.5001 9.10019 7.7001 8.9002C7.0001 8.80019 6.3001 8.4002 5.8001 7.9002C5.3001 7.4002 4.9001 6.7002 4.7001 5.9002C4.5001 5.1002 4.6001 4.4002 4.9001 3.6002ZM15.5999 13.7002L13.2999 16.3002L12.3999 15.2002C12.1999 15.0002 11.8999 15.0002 11.6999 15.1002C11.4999 15.3002 11.4999 15.6002 11.5999 15.8002L12.8999 17.3002C12.9999 17.4002 13.0999 17.5002 13.2999 17.5002C13.4999 17.5002 13.5999 17.4002 13.6999 17.3002L16.3999 14.3002C16.5999 14.1002 16.5999 13.8002 16.3999 13.6002C16.0999 13.4002 15.7999 13.5002 15.5999 13.7002ZM14.2 10.7002C15.3 10.7002 16.5 11.2002 17.3 12.0002C18.2 12.9002 18.6 14.0002 18.5 15.3002C18.5 16.1002 18.3 16.9002 17.9 17.6002C17.6 18.0002 17.3 18.3002 17 18.6002C16.2 19.3002 15.2 19.7002 14.1 19.7002C13.3 19.7002 12.6 19.5002 11.9 19.1002C11.2 18.7002 10.7 18.2002 10.3 17.5002C9.9 16.8002 9.7 16.0002 9.7 15.2002C9.7 14.4002 10 13.6002 10.4 12.9002C9.8 12.8002 9.1 12.7002 8.5 12.7002C4.5 12.7002 1.5 15.3002 1.5 18.3002V18.8002H0.5V18.3002C0.5 14.6002 4.2 11.7002 8.5 11.7002C9.3 11.7002 10.2 11.8002 11 12.0002L11.1 11.9002C12 11.1002 13.1 10.7002 14.2 10.7002ZM16.4 17.8002C16.7 17.6002 16.9 17.3002 17.1 17.0002C17.5 16.4002 17.6 15.8002 17.5 15.3002C17.5 14.4002 17.1 13.5002 16.5 12.9002C15.9 12.3002 15 11.9002 14.1 11.9002C13.2 11.9002 12.3 12.3002 11.7 12.9002C11.1 13.5002 10.7 14.4002 10.7 15.3002C10.7 16.0002 10.9 16.6002 11.2 17.1002C11.5 17.6002 11.9 18.0002 12.4 18.3002C12.9 18.5002 13.5 18.7002 14.1 18.7002C15 18.7002 15.8 18.4002 16.4 17.8002Z', + viewBox: '0 0 19 20', + ratio: 1, + }, addUser: { path: 'M8.85,2.17c-1.73,0-3.12,1.4-3.12,3.12s1.4,3.12,3.12,3.12c1.73,0,3.13-1.4,3.13-3.12S10.58,2.17,8.85,2.17z M8.85,0.08c2.88,0,5.21,2.33,5.21,5.21s-2.33,5.21-5.21,5.21s-5.2-2.33-5.2-5.21C3.65,2.42,5.98,0.08,8.85,0.08z M20.83,5.29 c0.54,0,0.98,0.41,1.04,0.93l0.01,0.11v2.08h2.08c0.54,0,0.98,0.41,1.04,0.93v0.12c0,0.54-0.41,0.98-0.93,1.04l-0.11,0.01h-2.08 v2.08c0,0.58-0.47,1.04-1.04,1.04c-0.54,0-0.98-0.41-1.04-0.93l-0.01-0.11v-2.08h-2.08c-0.54,0-0.98-0.41-1.04-0.93l-0.01-0.11 c0-0.54,0.41-0.98,0.93-1.04l0.11-0.01h2.08V6.34C19.79,5.76,20.26,5.29,20.83,5.29z M12.5,12.58c2.8,0,5.09,2.21,5.2,4.99v0.22 v2.08c0,0.58-0.47,1.04-1.04,1.04c-0.54,0-0.98-0.41-1.04-0.93l-0.01-0.11v-2.08c0-1.67-1.3-3.03-2.95-3.12h-0.18H5.21 c-1.67,0-3.03,1.3-3.12,2.95v0.18v2.08c0,0.58-0.47,1.04-1.04,1.04c-0.54,0-0.98-0.41-1.04-0.93L0,19.88V17.8 c0-2.8,2.21-5.09,4.99-5.2h0.22h7.29V12.58z', @@ -443,6 +451,12 @@ export const icons = { viewBox: '0 0 22 22', ratio: 1, }, + decline: { + path: + 'M6.36072 8.93001C7.02072 9.59001 7.84072 10.03 8.75072 10.21C9.05072 10.27 9.36072 10.3 9.66072 10.3C10.2707 10.3 10.8707 10.18 11.4407 9.94001C12.3007 9.59 13.0207 8.99001 13.5307 8.22001C14.0407 7.45001 14.3207 6.55001 14.3207 5.63001C14.3207 4.38001 13.8307 3.21001 12.9507 2.33001C11.4407 0.810006 8.86072 0.560006 7.06072 1.75001C6.29072 2.26001 5.70072 2.99001 5.34072 3.84001C4.99072 4.70001 4.89072 5.63001 5.07072 6.54001C5.25072 7.45001 5.69072 8.27001 6.35072 8.93001H6.36072ZM6.27072 4.23001C6.55072 3.56001 7.02072 2.99001 7.62072 2.58001C8.22072 2.18001 8.93072 1.96001 9.66072 1.96001C10.6307 1.96001 11.5707 2.35001 12.2507 3.03001C12.9407 3.72001 13.3207 4.64001 13.3207 5.62001C13.3207 6.35001 13.1107 7.05001 12.7007 7.66001C12.3007 8.27001 11.7307 8.73001 11.0507 9.01001C10.3707 9.29001 9.64072 9.36001 8.93072 9.22001C8.22072 9.08001 7.57072 8.73001 7.05072 8.22001C6.54072 7.70001 6.19072 7.06001 6.05072 6.34001C5.91072 5.63001 5.98072 4.89001 6.26072 4.22001L6.27072 4.23001ZM17.5103 12.24C17.1503 11.83 16.7203 11.51 16.2203 11.29C15.7203 11.07 15.1903 10.96 14.6603 10.96C14.1503 10.92 13.6603 11.06 13.1903 11.25C12.7203 11.45 12.3003 11.72 11.9503 12.08C11.2103 11.89 10.4503 11.78 9.68025 11.78H9.67025C5.45025 11.78 2.01025 14.62 2.01025 18.11C2.01025 18.39 2.23025 18.61 2.51025 18.61C2.79025 18.61 3.01025 18.39 3.01025 18.11C3.01025 15.17 6.00025 12.78 9.67025 12.78H9.68025C10.2303 12.78 10.7803 12.85 11.3103 12.96C11.2851 13.0103 11.2564 13.0588 11.228 13.1071C11.1885 13.1739 11.1493 13.2403 11.1203 13.31C10.9303 13.78 10.8303 14.27 10.8303 14.78C10.8303 15.48 11.0203 16.16 11.3803 16.75C11.5803 17.08 11.8203 17.38 12.1103 17.62C12.8103 18.26 13.7103 18.61 14.6503 18.61H14.6803C15.3403 18.61 15.9803 18.44 16.5603 18.11C17.1403 17.78 17.6203 17.31 17.9503 16.75C18.1603 16.41 18.3103 16.04 18.3903 15.68C18.4703 15.39 18.5103 15.08 18.5103 14.78C18.5103 13.83 18.1603 12.92 17.5303 12.22L17.5103 12.24ZM17.4003 15.47C17.3403 15.75 17.2303 16.02 17.0703 16.27C16.8203 16.69 16.4703 17.04 16.0403 17.28C15.6203 17.52 15.1403 17.65 14.6603 17.65H14.6403C13.9503 17.65 13.2803 17.39 12.7603 16.91C12.5503 16.73 12.3703 16.51 12.2203 16.27C11.9503 15.83 11.8103 15.33 11.8103 14.81C11.8103 14.44 11.8803 14.07 12.0203 13.73C12.1603 13.38 12.3703 13.07 12.6303 12.81C12.8903 12.55 13.2003 12.34 13.5503 12.2C13.8903 12.06 14.2603 11.99 14.6303 11.99C15.0003 11.95 15.4203 12.07 15.7803 12.23C16.1403 12.39 16.4603 12.63 16.7303 12.93C17.2003 13.45 17.4603 14.12 17.4603 14.82C17.4603 15.04 17.4303 15.26 17.3703 15.49L17.4003 15.47ZM15.8705 14.2699L15.3505 14.7899L15.3305 14.7999L15.8805 15.3399C16.0705 15.5399 16.0705 15.8499 15.8805 16.0499C15.7905 16.1499 15.6605 16.1999 15.5305 16.1999C15.4005 16.1999 15.2805 16.1499 15.1805 16.0499L14.6305 15.4999L14.1005 16.0299C14.0105 16.1299 13.8705 16.1799 13.7505 16.1799C13.6305 16.1799 13.5005 16.1299 13.4005 16.0299C13.2005 15.8299 13.2005 15.5199 13.4005 15.3199L13.9305 14.7899L13.4205 14.2799C13.2305 14.0799 13.2305 13.7699 13.4205 13.5699C13.6205 13.3699 13.9305 13.3799 14.1305 13.5699L14.6405 14.0799L15.1605 13.5599C15.3605 13.3599 15.6705 13.3599 15.8705 13.5599C16.0705 13.7599 16.0705 14.0699 15.8705 14.2699Z', + viewBox: '0 0 20 20', + ratio: 1, + }, delete: { path: 'M8.0997 2.71582C8.06565 2.82911 8.04151 2.96562 8.00631 3.17464L7.89581 3.83261C8.31373 3.82207 8.73182 3.81678 9.14998 3.81674C10.136 3.81674 11.1231 3.83436 12.1099 3.86923L11.9931 3.17911C11.922 2.74275 11.8808 2.62818 11.8273 2.56664C11.815 2.55229 11.6984 2.41675 11.0917 2.41675H8.90839C8.29249 2.41675 8.18014 2.54803 8.17224 2.55726C8.17212 2.5574 8.17231 2.55718 8.17224 2.55726C8.15872 2.57259 8.1311 2.61135 8.0997 2.71582ZM13.6428 3.93723C14.9553 4.00726 16.2666 4.1075 17.574 4.23707C17.9862 4.27792 18.2872 4.64518 18.2464 5.05737C18.2056 5.46957 17.8383 5.7706 17.4261 5.72976C14.675 5.45713 11.9081 5.31675 9.15013 5.31674M13.6428 3.93723L13.4736 2.93773C13.4735 2.937 13.4734 2.93626 13.4733 2.93553C13.4705 2.91861 13.4677 2.90104 13.4648 2.88287C13.4108 2.54589 13.3239 2.00257 12.9603 1.58353C12.5328 1.0909 11.886 0.916748 11.0917 0.916748H8.90839C8.12532 0.916748 7.47743 1.07728 7.04691 1.56548C6.68322 1.9779 6.59393 2.52025 6.53756 2.86269C6.53397 2.88447 6.53052 2.90544 6.52714 2.92552L6.36437 3.89471C5.61705 3.9365 4.87064 3.99509 4.12572 4.07044C4.12533 4.07048 4.12495 4.07051 4.12456 4.07055L2.42688 4.23699C2.01464 4.27741 1.71322 4.64435 1.75363 5.05659C1.79405 5.46883 2.161 5.77025 2.57323 5.72983L4.27323 5.56317L4.27555 5.56294C5.89522 5.39907 7.52219 5.3169 9.15013 5.31674M4.24341 6.86831C4.65676 6.84162 5.01348 7.15508 5.04016 7.56844L5.58155 15.956C5.5816 15.9567 5.58165 15.9574 5.5817 15.958C5.60534 16.2953 5.62484 16.553 5.66967 16.7756C5.71303 16.9909 5.77071 17.119 5.83652 17.2047C5.94118 17.341 6.23812 17.5834 7.32506 17.5834H12.6751C13.762 17.5834 14.0589 17.341 14.1636 17.2047C14.2294 17.119 14.2871 16.9909 14.3304 16.7756C14.3753 16.553 14.3948 16.2953 14.4184 15.958C14.4185 15.9574 14.4185 15.9567 14.4186 15.956L14.9599 7.56844C14.9866 7.15508 15.3433 6.84162 15.7567 6.86831C16.1701 6.89499 16.4835 7.25171 16.4568 7.66506L15.9149 16.0608L15.9135 16.08C15.8918 16.3912 15.8671 16.7429 15.8009 17.0717C15.7318 17.415 15.6082 17.7864 15.3532 18.1184C14.8162 18.8175 13.9131 19.0834 12.6751 19.0834H7.32506C6.08699 19.0834 5.18393 18.8175 4.64692 18.1184C4.3919 17.7864 4.26834 17.415 4.19919 17.0717C4.13297 16.7429 4.10835 16.3912 4.08657 16.08L4.08494 16.0567L3.54328 7.66506C3.5166 7.25171 3.83006 6.89499 4.24341 6.86831Z', @@ -949,7 +963,7 @@ export const icons = { }, resend: { path: -"M21.1002 15.5C20.8002 17.6 19.1002 19.1 17.0002 19.1C15.8002 19.1 14.9002 18.6999 14.1002 17.9L13.5002 18.5C13.4002 18.6 13.1002 18.6 13.0002 18.5C13.0002 18.5 12.9002 18.3 12.9002 18.2V16.2C12.9002 15.9 13.2002 15.6 13.5002 15.6H15.5002C15.5002 15.6 15.7002 15.6 15.8002 15.7C15.9002 15.8 15.9002 16.1 15.8002 16.2L15.0002 17C15.6002 17.5 16.3002 17.7999 17.0002 17.7999C18.5002 17.7999 19.8002 16.7 19.9002 15.2C19.9002 14.9 20.2002 14.7 20.5002 14.7C20.84 14.7 21.1794 14.9452 21.1002 15.5ZM21.0002 11.4C20.9002 11.3 20.6002 11.3 20.5002 11.4L19.9002 12C19.1002 11.2 18.1002 10.8 17.0002 10.8C14.9002 10.8 13.1002 12.4 12.9002 14.4C12.9002 14.6 12.9002 14.8 13.1002 15C13.2002 15 13.3002 15.1 13.5002 15.1C13.7002 15.1 13.7002 15.1 13.7002 15.1C13.9002 15.1 14.0002 14.8 14.1002 14.6C14.3002 13.1 15.5002 12 17.0002 12C18.5002 12 18.5002 12.3 19.1002 12.8L18.3002 13.6C18.2002 13.7 18.2002 14 18.3002 14.1C18.3002 14.1 18.5002 14.2 18.6002 14.2H20.6002C20.9002 14.2 21.2002 13.9 21.2002 13.6C21.2002 13.6 21.2002 11.7885 21.2002 11.7189C21.2002 11.6493 21.1002 11.5 21.0002 11.4ZM1.0002 5.79995C0.800195 5.69995 0.700195 5.39995 0.700195 5.19995V4.29995C0.700195 2.89995 1.9002 1.69995 3.3002 1.69995H16.9002C18.3002 1.69995 19.5002 2.89995 19.5002 4.29995V5.09995C19.5002 5.09995 19.5002 5.19995 19.5002 5.29995V10.1C19.5002 10.3 19.5002 10.5 19.3002 10.6H19.2002C19.2002 10.7 19.0002 10.6 19.0002 10.6C18.8002 10.5 18.5002 10.4 18.3002 10.3H18.1002V9.89995V6.49995L11.9002 11.2C11.4002 11.6 10.8002 11.7 10.2002 11.7C9.60019 11.7 9.0002 11.5 8.5002 11.2L1.0002 5.79995ZM9.2002 10.2C9.7002 10.5 10.4002 10.5 10.9002 10.2L17.9002 4.89995V4.39995C17.9002 3.79995 17.4002 3.29995 16.8002 3.29995H3.3002C2.7002 3.29995 2.2002 3.79995 2.2002 4.39995V4.89995L9.2002 10.2ZM11.5002 15H3.3002C2.7002 15 2.2002 14.5 2.2002 13.9V7.89995C2.2002 7.69995 2.2002 7.49995 2.0002 7.39995C1.9002 7.29995 1.6002 7.19995 1.5002 7.19995C1.1002 7.19995 0.700195 7.59995 0.800195 7.99995V14C0.800195 15.4 2.0002 16.6 3.4002 16.6H11.6002C11.9002 16.6 12.1002 16.5 12.3002 16.2C12.4002 16 12.4002 15.7 12.3002 15.4C12.2002 15.2 11.9002 15 11.6002 15H11.5002Z", + 'M21.1002 15.5C20.8002 17.6 19.1002 19.1 17.0002 19.1C15.8002 19.1 14.9002 18.6999 14.1002 17.9L13.5002 18.5C13.4002 18.6 13.1002 18.6 13.0002 18.5C13.0002 18.5 12.9002 18.3 12.9002 18.2V16.2C12.9002 15.9 13.2002 15.6 13.5002 15.6H15.5002C15.5002 15.6 15.7002 15.6 15.8002 15.7C15.9002 15.8 15.9002 16.1 15.8002 16.2L15.0002 17C15.6002 17.5 16.3002 17.7999 17.0002 17.7999C18.5002 17.7999 19.8002 16.7 19.9002 15.2C19.9002 14.9 20.2002 14.7 20.5002 14.7C20.84 14.7 21.1794 14.9452 21.1002 15.5ZM21.0002 11.4C20.9002 11.3 20.6002 11.3 20.5002 11.4L19.9002 12C19.1002 11.2 18.1002 10.8 17.0002 10.8C14.9002 10.8 13.1002 12.4 12.9002 14.4C12.9002 14.6 12.9002 14.8 13.1002 15C13.2002 15 13.3002 15.1 13.5002 15.1C13.7002 15.1 13.7002 15.1 13.7002 15.1C13.9002 15.1 14.0002 14.8 14.1002 14.6C14.3002 13.1 15.5002 12 17.0002 12C18.5002 12 18.5002 12.3 19.1002 12.8L18.3002 13.6C18.2002 13.7 18.2002 14 18.3002 14.1C18.3002 14.1 18.5002 14.2 18.6002 14.2H20.6002C20.9002 14.2 21.2002 13.9 21.2002 13.6C21.2002 13.6 21.2002 11.7885 21.2002 11.7189C21.2002 11.6493 21.1002 11.5 21.0002 11.4ZM1.0002 5.79995C0.800195 5.69995 0.700195 5.39995 0.700195 5.19995V4.29995C0.700195 2.89995 1.9002 1.69995 3.3002 1.69995H16.9002C18.3002 1.69995 19.5002 2.89995 19.5002 4.29995V5.09995C19.5002 5.09995 19.5002 5.19995 19.5002 5.29995V10.1C19.5002 10.3 19.5002 10.5 19.3002 10.6H19.2002C19.2002 10.7 19.0002 10.6 19.0002 10.6C18.8002 10.5 18.5002 10.4 18.3002 10.3H18.1002V9.89995V6.49995L11.9002 11.2C11.4002 11.6 10.8002 11.7 10.2002 11.7C9.60019 11.7 9.0002 11.5 8.5002 11.2L1.0002 5.79995ZM9.2002 10.2C9.7002 10.5 10.4002 10.5 10.9002 10.2L17.9002 4.89995V4.39995C17.9002 3.79995 17.4002 3.29995 16.8002 3.29995H3.3002C2.7002 3.29995 2.2002 3.79995 2.2002 4.39995V4.89995L9.2002 10.2ZM11.5002 15H3.3002C2.7002 15 2.2002 14.5 2.2002 13.9V7.89995C2.2002 7.69995 2.2002 7.49995 2.0002 7.39995C1.9002 7.29995 1.6002 7.19995 1.5002 7.19995C1.1002 7.19995 0.700195 7.59995 0.800195 7.99995V14C0.800195 15.4 2.0002 16.6 3.4002 16.6H11.6002C11.9002 16.6 12.1002 16.5 12.3002 16.2C12.4002 16 12.4002 15.7 12.3002 15.4C12.2002 15.2 11.9002 15 11.6002 15H11.5002Z', viewBox: '0 0 22 20', ratio: 1, }, diff --git a/ts/components/icon/SecretGrpProfile.tsx b/ts/components/icon/SecretGrpProfile.tsx new file mode 100644 index 00000000..acae2f70 --- /dev/null +++ b/ts/components/icon/SecretGrpProfile.tsx @@ -0,0 +1,20 @@ +import React from 'react'; + +const SecretGrpProfile = (props: { isDark: boolean }) => { + return ( + + + + + ); +}; + +export default SecretGrpProfile; diff --git a/ts/components/leftpane/ActionsPanel.tsx b/ts/components/leftpane/ActionsPanel.tsx index c2f9c69f..030de0f7 100644 --- a/ts/components/leftpane/ActionsPanel.tsx +++ b/ts/components/leftpane/ActionsPanel.tsx @@ -83,7 +83,7 @@ import { getIsOnline } from '../../state/selectors/onions'; import styled from 'styled-components'; import { ActionPanelOnionStatusLight } from '../dialog/OnionStatusPathDialog'; import { Flex } from '../basic/Flex'; -import { SpacerSM } from '../basic/Text'; +import { SpacerLG, SpacerSM } from '../basic/Text'; import useNetworkStatus from '../../hooks/useNetworkStatus'; import { getTheme } from '../../state/selectors/theme'; @@ -666,7 +666,7 @@ export const ActionsPanel = () => { iconColor={isdark ? '#F0F0F0' : '#333333'} />
- +
themeChanger('dark')} @@ -679,7 +679,9 @@ export const ActionsPanel = () => {
- + +
V {window.getVersion()}
+ diff --git a/ts/components/leftpane/LeftPane.tsx b/ts/components/leftpane/LeftPane.tsx index 4774190c..15b35850 100644 --- a/ts/components/leftpane/LeftPane.tsx +++ b/ts/components/leftpane/LeftPane.tsx @@ -69,7 +69,6 @@ const LeftPaneSection = () => { const focusedSection = useSelector(getFocusedSection); const zoomLevel = window.getSettingValue('zoom-factor-setting'); // const convoList = useSelector(getLeftPaneLists); -// console.log('focusedSection ::',focusedSection) if (focusedSection === SectionType.Message) { return ; } diff --git a/ts/components/leftpane/LeftPaneMessageSection.tsx b/ts/components/leftpane/LeftPaneMessageSection.tsx index 1459b583..6e2c86fd 100644 --- a/ts/components/leftpane/LeftPaneMessageSection.tsx +++ b/ts/components/leftpane/LeftPaneMessageSection.tsx @@ -110,11 +110,9 @@ export class LeftPaneMessageSection extends React.Component { public render(): JSX.Element { // const { overlayMode } = this.props; - // console.log('overlayMode 0-->',overlayMode) const { conversations, conversationRequestsUnread, directContact } = this.props; const convolen: boolean = conversations?.length === 0 && conversationRequestsUnread === 0 && directContact.length === 0; - // console.log('convolen ::',convolen,{directContact}) return (
{ // private renderClosableOverlay() { // const { overlayMode } = this.props; - // console.log('overlayMode -->',overlayMode) // switch (overlayMode) { // case 'open-group': // return ; diff --git a/ts/components/leftpane/MessageRequestsBanner.tsx b/ts/components/leftpane/MessageRequestsBanner.tsx index 2d206a2b..ccc5715c 100644 --- a/ts/components/leftpane/MessageRequestsBanner.tsx +++ b/ts/components/leftpane/MessageRequestsBanner.tsx @@ -5,7 +5,7 @@ import { useSelector } from 'react-redux'; import styled from 'styled-components'; import { getUnreadConversationRequests } from '../../state/selectors/conversations'; import { getHideMessageRequestBanner } from '../../state/selectors/userConfig'; -import { BchatIcon, BchatIconSize, BchatIconType } from '../icon'; +import { BchatIcon } from '../icon'; import { MemoMessageRequestBannerContextMenu } from '../menu/MessageRequestBannerContextMenu'; const StyledMessageRequestBanner = styled.div` @@ -66,9 +66,10 @@ const StyledGridContainer = styled.div` background-color: var(--color-request-banner-icon-background); `; -export const CirclularIcon = (props: { iconType: BchatIconType; iconSize: BchatIconSize }) => { - const { iconSize, iconType } = props; - console.log(iconSize,iconType) +export const CirclularIcon = () => { + // export const CirclularIcon = (props: { iconType: BchatIconType; iconSize: BchatIconSize }) => { + // const { iconSize, iconType } = props; + return ( diff --git a/ts/components/leftpane/conversation-list-item/ConversationListItem.tsx b/ts/components/leftpane/conversation-list-item/ConversationListItem.tsx index 4b1f4527..fd0dc227 100644 --- a/ts/components/leftpane/conversation-list-item/ConversationListItem.tsx +++ b/ts/components/leftpane/conversation-list-item/ConversationListItem.tsx @@ -86,12 +86,12 @@ const AvatarItem = () => {
@@ -121,7 +121,6 @@ const ConversationListItem = (props: Props) => { // window.getSettingValue(SettingsKey.settingChatwithWalletInstruction) : true; // const forceUpdate = useUpdate(); - // console.log('chatInstruction::', chatInstruction,window.getSettingValue(SettingsKey.settingChatwithWalletInstruction)) function useHeaderItemProps(conversationId: string) { const convoProps = useConversationPropsById(conversationId); if (!convoProps) { @@ -135,15 +134,8 @@ const ConversationListItem = (props: Props) => { }; } const convoProps = useHeaderItemProps(conversationId); - const activeAt = convoProps?.activeAt; - // console.log("activeAt:",activeAt) - // console.log("unreadCount ::",unreadCount); - - // console.log(activeAt); - const key = `conversation-item-${conversationId}`; - const triggerId = `${key}-ctxmenu`; const openConvo = useCallback( diff --git a/ts/components/leftpane/conversation-list-item/HeaderItem.tsx b/ts/components/leftpane/conversation-list-item/HeaderItem.tsx index 39b48850..85fcea32 100644 --- a/ts/components/leftpane/conversation-list-item/HeaderItem.tsx +++ b/ts/components/leftpane/conversation-list-item/HeaderItem.tsx @@ -47,8 +47,8 @@ const StyledConversationListItemIconWrapper = styled.div` `; const PinWrapper = styled.div` position: absolute; - top: -6px; - right: 12px; + top: -7px; + right: 0px; padding:1px 2px; background-color: #2f8fff; border-radius: 12px; @@ -56,7 +56,6 @@ const PinWrapper = styled.div` function useHeaderItemProps(conversationId: string) { const convoProps = useConversationPropsById(conversationId); - // console.log(); if (!convoProps) { return null; diff --git a/ts/components/leftpane/overlay/OverlayClosedGroup.tsx b/ts/components/leftpane/overlay/OverlayClosedGroup.tsx index d4bb8714..8a2b4211 100644 --- a/ts/components/leftpane/overlay/OverlayClosedGroup.tsx +++ b/ts/components/leftpane/overlay/OverlayClosedGroup.tsx @@ -78,7 +78,7 @@ export const OverlayClosedGroup = () => { dispatch(setOverlayMode(undefined)); return; } - setLoading(false); + setLoading(false); } useKey('Escape', closeOverlay); @@ -88,7 +88,7 @@ export const OverlayClosedGroup = () => { const subtitle = window.i18n('createSecretGroupNamePrompt'); const placeholder = window.i18n('createSecretGroupPlaceholder'); - const noContactsForClosedGroup = privateContactsPubkeys.length === 0 ; + const noContactsForClosedGroup = privateContactsPubkeys.length === 0; // function addContact() { // dispatch(showLeftPaneSection(0)); @@ -125,40 +125,48 @@ export const OverlayClosedGroup = () => { dataTestId="new-closed-group-name" />
+ + +
+ + +
+
+ +
+ { + handleSearch(e); + }} + placeholder={'Search Contact'} + maxLength={26} + /> +
+
)} - -
- - -
-
- -
- { - handleSearch(e); - }} - placeholder={'Search Contact'} - maxLength={26} - /> -
-
- {loading ? ( + {loading && ( - + - ) : ( -
100?"unset":'auto'}} > - {noContactsForClosedGroup ? ( -
-
- -

{window.i18n('noContactsYet')}

- - {/*
+ )} +
100 ? 'unset' : 'auto' }} + > + {noContactsForClosedGroup ? ( +
+
+ +

{window.i18n('noContactsYet')}

+ + {/*
*/} - {/* */} - {/* {window.i18n('noContactsForGroup')} */} -
- ) : ( + {/* */} + {/* {window.i18n('noContactsForGroup')} */} +
+ ) : ( +
100 ? 'unset' : 'auto' }} + >
{filteredNames.map((memberPubkey: string) => ( { /> ))}
- )} -
- )} +
+ )} +
- + {/* */} + {/* */}
{!noContactsForClosedGroup && ( -
+
diff --git a/ts/components/leftpane/overlay/OverlayMessage.tsx b/ts/components/leftpane/overlay/OverlayMessage.tsx index ae9121fc..ddcb76c4 100644 --- a/ts/components/leftpane/overlay/OverlayMessage.tsx +++ b/ts/components/leftpane/overlay/OverlayMessage.tsx @@ -27,7 +27,7 @@ import { CopyIconButton } from '../../icon/CopyIconButton'; import { BchatIconButton } from '../../icon'; import { QRView } from '../../dialog/EditProfileDialog'; import { Flex } from '../../basic/Flex'; -import { getLeftPaneLists } from '../../../state/selectors/conversations'; +// import { getLeftPaneLists } from '../../../state/selectors/conversations'; import classNames from 'classnames'; export const OverlayMessage = () => { @@ -43,10 +43,10 @@ export const OverlayMessage = () => { const [dispalyQR, setDispalyQR] = useState(false); const ourNumber = useSelector(getOurNumber); const ourconvo = getConversationController().get(ourNumber); - const convoList = useSelector(getLeftPaneLists); + // const convoList = useSelector(getLeftPaneLists); const walletAddress:any = localStorage.getItem('userAddress'); - const convolen: boolean =convoList?.contacts?.length === 0 || false; - console.log('convolen',convolen) + // const convolen: boolean =convoList?.contacts?.length === 0 || false; + // const title = window.i18n('newBchat'); // const buttonText = window.i18n('next'); diff --git a/ts/components/menu/Menu.tsx b/ts/components/menu/Menu.tsx index ad52d762..ba7f5a99 100644 --- a/ts/components/menu/Menu.tsx +++ b/ts/components/menu/Menu.tsx @@ -162,13 +162,8 @@ export const MenuWrapper = styled.span` /** Menu items standardized */ export const InviteContactMenuItem = (): JSX.Element | null => { - console.log("InviteContactMenuItem::") const convoId = useContext(ContextConversationId); const isPublic = useIsPublic(convoId); - console.log("convoId:", convoId) - // console.log("isPublic:", isPublic) - // console.log("showInviteContact(isPublic):", showInviteContact(isPublic)) - // console.log("showInviteContactByConvoId(convoId):", showInviteContactByConvoId(convoId)); if (showInviteContact(isPublic)) { return ( @@ -177,9 +172,8 @@ export const InviteContactMenuItem = (): JSX.Element | null => { showInviteContactByConvoId(convoId); }} > - + {window.i18n('inviteContacts')} - ); } @@ -302,12 +296,21 @@ export const LeaveGroupMenuItem = () => { return ( { - showLeaveGroupByConvoId(convoId, username, ); + showLeaveGroupByConvoId( + convoId, + username, + + ); }} > - + {window.i18n('leaveGroup')} - ); } @@ -458,7 +461,6 @@ export const DisappearingMessageMenuItem = (): JSX.Element | null => { const timerOptions = useSelector(getTimerOptions).timerOptions; const isRequest = useIsRequest(convoId); const ourNumber = useSelector(getOurNumber); - console.log("timerOptions:",timerOptions) if (ourNumber === convoId) { return null; } @@ -482,11 +484,11 @@ export const DisappearingMessageMenuItem = (): JSX.Element | null => { } arrow={} - > {timerOptions.map(item => ( -
- + { await setDisappearingMessagesByConvoId(convoId, item.value); @@ -495,7 +497,6 @@ export const DisappearingMessageMenuItem = (): JSX.Element | null => { {item.name}
- ))} ); @@ -514,7 +515,13 @@ export const NotificationForConvoMenuItem = (): JSX.Element | null => { const isMe = useIsMe(convoId); if ( - showNotificationConvo(Boolean(isKickedFromGroup), Boolean(left), Boolean(isBlocked), isRequest, isMe) + showNotificationConvo( + Boolean(isKickedFromGroup), + Boolean(left), + Boolean(isBlocked), + isRequest, + isMe + ) ) { // exclude mentions_only settings for private chats as this does not make much sense const notificationForConvoOptions = ConversationNotificationSetting.filter(n => @@ -525,8 +532,8 @@ export const NotificationForConvoMenuItem = (): JSX.Element | null => { n === 'all' || !n ? 'notificationForConvo_all' : n === 'disabled' - ? 'notificationForConvo_disabled' - : 'notificationForConvo_mentions_only'; + ? 'notificationForConvo_disabled' + : 'notificationForConvo_mentions_only'; return { value: n, name: window.i18n(keyToUse) }; }); @@ -545,25 +552,28 @@ export const NotificationForConvoMenuItem = (): JSX.Element | null => { } arrow={} - // label={window.i18n('notificationForConvo') as any} + // label={window.i18n('notificationForConvo') as any} > {(notificationForConvoOptions || []).map(item => { const disabled = item.value === currentNotificationSetting; return ( -
- + { await setNotificationForConvoId(convoId, item.value); }} // disabled={disabled} > -
- +
+
{item.name} @@ -689,7 +699,14 @@ export const AcceptMenuItem = () => { await approveConvoAndSendResponse(convoId, true); }} > - {window.i18n('accept')} + + {window.i18n('accept')} ); } @@ -699,7 +716,7 @@ export const AcceptMenuItem = () => { export const DeclineMenuItem = () => { const convoId = useContext(ContextConversationId); const isRequest = useIsRequest(convoId); - const customIcon = + const customIcon = ; if (isRequest) { return ( @@ -708,7 +725,14 @@ export const DeclineMenuItem = () => { declineConversationWithConfirm(convoId, true, customIcon); }} > - {window.i18n('decline')} + + {window.i18n('decline')} ); } diff --git a/ts/components/registration/RegistrationStages.tsx b/ts/components/registration/RegistrationStages.tsx index 3f54b5a7..09222351 100644 --- a/ts/components/registration/RegistrationStages.tsx +++ b/ts/components/registration/RegistrationStages.tsx @@ -13,6 +13,7 @@ import { wallet } from '../../wallet/wallet-rpc'; import { AccentText } from './AccentText'; import { TermsAndConditions } from './TermsAndConditions'; import { Flex } from '../basic/Flex'; +import { SpacerLG } from '../basic/Text'; export const MAX_USERNAME_LENGTH = 26; // tslint:disable: use-simple-attributes @@ -217,11 +218,9 @@ export const RegistrationStages = () => { }, []); const generateMnemonicAndKeyPairaa = async () => { - // console.log('registration'); await wallet.startWallet(); }; const imageValidator = (e: any) => { - console.log('imageValidator'); setImageCount(e); }; const displayImg = () => { @@ -247,7 +246,7 @@ export const RegistrationStages = () => { flexDirection="row" container={true} height="100%" - width="40%" + width="45%" justifyContent="flex-end" > @@ -259,7 +258,7 @@ export const RegistrationStages = () => { flexDirection="column" container={true} height="100%" - width="60%" + width="55%" justifyContent="center" >
@@ -288,6 +287,8 @@ export const RegistrationStages = () => { imageValidator={(e: Number) => imageValidator(e)} /> )} + + {/* */} {accent && }
diff --git a/ts/components/registration/SignInTab.tsx b/ts/components/registration/SignInTab.tsx index 162afcd4..6640b91a 100644 --- a/ts/components/registration/SignInTab.tsx +++ b/ts/components/registration/SignInTab.tsx @@ -21,6 +21,7 @@ import { mn_decode } from '../../bchat/crypto/mnemonic'; import { ToastUtils } from '../../bchat/utils'; import { WalletPassword } from './WalletPass'; import { Flex } from '../basic/Flex'; +import moment from 'moment'; // import { BchatIconButton } from '../icon/BchatIconButton'; const { clipboard } = require('electron'); @@ -46,13 +47,15 @@ export enum SignInMode { const RestoreUsingRecoveryPhraseButton = (props: { onRecoveryButtonClicked: () => any }) => { return ( - +
+ +
); }; @@ -107,7 +110,7 @@ const SignInButtons = (props: { export const SignInTab = (props: any) => { const { setRegistrationPhase, signInMode, setSignInMode } = useContext(RegistrationContext); - + const today = moment().format('YYYY-MM-DD'); const [password, setPassword] = useState(''); const [repassword, setRepassword] = useState(''); @@ -135,8 +138,12 @@ export const SignInTab = (props: any) => { // Seed is mandatory no matter which mode // const seedOK = (blockheight && !recoveryPhraseError) || (restoreDate && !recoveryPhraseError); + const year = moment(restoreDate).year(); - const activateContinueButton = displayNameOK && !loading && (blockheight || restoreDate); + const activateContinueButton = + displayNameOK && + !loading && + (blockheight || (Number(year) > 2019 && !moment(restoreDate).isAfter(today))); localStorage.setItem('walletUserName', displayName); const continueYourBchat = async () => { @@ -247,14 +254,18 @@ export const SignInTab = (props: any) => { ); } + const handleInputChange = (setter: React.Dispatch>, e: string) => { + const newValue = e.replace(/\s+/g, ''); + setter(newValue); + }; if (screenName === 2) { return ( setPassword(e)} - setRepassword={(e: any) => setRepassword(e)} + setPassword={(e: string) => handleInputChange(setPassword, e)} + setRepassword={(e: string) => handleInputChange(setRepassword, e)} backArrow={() => { setScreenName(1); props.imageValidator(LeftImage.recoveryseed); @@ -282,10 +293,10 @@ export const SignInTab = (props: any) => {
@@ -318,17 +329,21 @@ export const SignInTab = (props: any) => {
{window.i18n('restoreFromSeed')}
*/}
- { - props.assent(true); - setScreenName(1); - setPassword(''); - setRepassword(''); - setBlockheight(''); - setRestoreDate(''); - props.imageValidator(LeftImage.registration); - }} /> + { + props.assent(true); + setScreenName(1); + setPassword(''); + setRepassword(''); + setBlockheight(''); + setRestoreDate(''); + props.imageValidator(LeftImage.registration); + }} + />
- {window.i18n('restoreFromSeed')} + + {window.i18n('restoreFromSeed')} +
{ onValueChanged={(name: string) => { const sanitizedName = sanitizeBchatUsername(name); const trimName = sanitizedName.trim(); - setDisplayName(sanitizedName.replace(/\s/g, '')); + // const alphanumericName = sanitizedName.replace(/[^a-zA-Z0-9]/g, ''); + setDisplayName(sanitizedName); setDisplayNameError(!trimName ? window.i18n('displayNameEmpty') : undefined); }} // onEnterPressed={props.handlePressEnter} @@ -376,6 +392,7 @@ export const SignInTab = (props: any) => { { setDisplayName(''); setIsLoading(false); props.assent(false); - props.imageValidator(LeftImage.recoveryseed) + props.imageValidator(LeftImage.recoveryseed); }} onLinkDeviceButtonClicked={() => { setRegistrationPhase(RegistrationPhase.SignIn); diff --git a/ts/components/registration/SignUpTab.tsx b/ts/components/registration/SignUpTab.tsx index c6e2693f..1f8972e8 100644 --- a/ts/components/registration/SignUpTab.tsx +++ b/ts/components/registration/SignUpTab.tsx @@ -22,13 +22,17 @@ export enum SignUpMode { } const CreateBchatIdButton = ({ createBchatID }: { createBchatID: any }) => { + return ( +
+
); }; @@ -47,7 +51,7 @@ export const GoBackMainMenuButton = (props: any) => { iconSize="huge" iconType="KeyboardBackspaceArrow" // iconPadding="5px" - iconColor='#A9AEBA' + iconColor="#A9AEBA" onClick={() => { setRegistrationPhase(RegistrationPhase.Start); setSignInMode(SignInMode.Default); @@ -131,10 +135,10 @@ export const SignUpTab = (props: any) => {
@@ -184,16 +188,22 @@ export const SignUpTab = (props: any) => { if (displayNameScreen === 1) { setPassword(''); setRepassword(''); - props.imageValidator(LeftImage.registration) + props.imageValidator(LeftImage.registration); } }; + + const handleInputChange = (setter: React.Dispatch>, e: string) => { + const newValue = e.replace(/\s+/g, ''); + setter(newValue); + }; + if (displayNameScreen === 1) { return ( setPassword(e)} - setRepassword={(e: any) => setRepassword(e)} + setPassword={(e: string) => handleInputChange(setPassword, e)} + setRepassword={(e: string) => handleInputChange(setRepassword, e)} backArrow={goback} submit={passValid} /> @@ -213,9 +223,7 @@ export const SignUpTab = (props: any) => {
- - {window.i18n('displayName')} - + {window.i18n('displayName')} { onDisplayNameChanged={(name: string) => { const sanitizedName = sanitizeBchatUsername(name); const trimName = sanitizedName.trim(); + // const alphanumericName = sanitizedName.replace(/[^a-zA-Z0-9]/g, ''); setDisplayName(sanitizedName); setDisplayNameError(!trimName ? window.i18n('displayNameEmpty') : undefined); }} stealAutoFocus={true} /> -
+
{ verifyUserName(); }} buttonType={BchatButtonType.Default} buttonColor={BchatButtonColor.Primary} - text={window.i18n('continue')} + text={window.i18n('continue')} disabled={!displayName} />
diff --git a/ts/components/settings/BchatRecoverySeed.tsx b/ts/components/settings/BchatRecoverySeed.tsx index 49dc0074..8dd4b7d6 100644 --- a/ts/components/settings/BchatRecoverySeed.tsx +++ b/ts/components/settings/BchatRecoverySeed.tsx @@ -30,7 +30,6 @@ export const BchatRecoverySeed = (props: any) => { }; const onClickCancelHandler = () => { - console.log("sdnksnfksfkjf") // if (props.onClickCancel) { // onClickCancel(); // } diff --git a/ts/components/settings/BchatSettings.tsx b/ts/components/settings/BchatSettings.tsx index ad4ccf81..70ce06fc 100644 --- a/ts/components/settings/BchatSettings.tsx +++ b/ts/components/settings/BchatSettings.tsx @@ -283,7 +283,6 @@ export class BchatSettingsView extends React.Component public render() { const { category } = this.props; - // console.log("category setting ::",category) const shouldRenderPasswordLock = this.state.shouldLockSettings && this.state.hasPassword; const categoryLocalized: LocalizerKeys = category === BchatSettingCategory.Appearance diff --git a/ts/components/settings/BchatSettingsHeader.tsx b/ts/components/settings/BchatSettingsHeader.tsx index c64f1b82..077caee5 100644 --- a/ts/components/settings/BchatSettingsHeader.tsx +++ b/ts/components/settings/BchatSettingsHeader.tsx @@ -27,11 +27,7 @@ export const SettingsHeader = (props: Props) => { const multipleSelectionValue = useSelector(getMultipleSelection); const blockedNumbers = useSelector(getBlockedPubkeys); - // console.log("multipleSelectionValue:", multipleSelectionValue); - // console.log("blockedNumbers:", blockedNumbers) // const temp=useSelector(state=>state) - // console.log('multipleSelectionValue', multipleSelectionValue,temp); - // useEffect(() => { // if (multipleSelectionValue) { // color = 'var(--color-text)'; @@ -42,7 +38,7 @@ export const SettingsHeader = (props: Props) => { // forceUpdate() // } // }, [multipleSelectionValue]) - console.log('categoryTitle -->',category,BchatSettingCategory.Wallet,) + if(category === BchatSettingCategory.Wallet) { return <> diff --git a/ts/components/settings/BlockedUserSettings.tsx b/ts/components/settings/BlockedUserSettings.tsx index 3b78e89b..922087e8 100644 --- a/ts/components/settings/BlockedUserSettings.tsx +++ b/ts/components/settings/BlockedUserSettings.tsx @@ -188,7 +188,7 @@ const AvatarItem = (props: { memberPubkey: string; isAdmin: boolean; isBnsHolder diff --git a/ts/components/settings/ChangeChatFontSetting.tsx b/ts/components/settings/ChangeChatFontSetting.tsx index 7141888b..8f0960ab 100644 --- a/ts/components/settings/ChangeChatFontSetting.tsx +++ b/ts/components/settings/ChangeChatFontSetting.tsx @@ -41,7 +41,6 @@ export const ChangeChatFontSetting = (props: { onSliderChange?: (value: number) currency: value, onClose: () => dispatch(walletSettingMiniModal(null)), onClick: (e: any) => { - // console.log(e); handleSlider(e) }, }) diff --git a/ts/components/settings/ZoomingBchatSlider.tsx b/ts/components/settings/ZoomingBchatSlider.tsx index 199bf813..d6aaeb82 100644 --- a/ts/components/settings/ZoomingBchatSlider.tsx +++ b/ts/components/settings/ZoomingBchatSlider.tsx @@ -43,7 +43,6 @@ export const ZoomingBchatSlider = (props: { onSliderChange?: (value: number) => const handleSlider = (valueToForward: any) => { let value = valueToForward.substring(0, valueToForward.length - 1) - console.log("value:",value) props?.onSliderChange?.(value); window.setSettingValue('zoom-factor-setting', value); setValue(value) @@ -104,7 +103,6 @@ export const ZoomingBchatSlider = (props: { onSliderChange?: (value: number) => currency: value + '%', onClose: () => dispatch(walletSettingMiniModal(null)), onClick: (e: any) => { - console.log(e); handleSlider(e) }, }) diff --git a/ts/components/settings/section/categoryChat.tsx b/ts/components/settings/section/categoryChat.tsx index f98c5011..7ecd8221 100644 --- a/ts/components/settings/section/categoryChat.tsx +++ b/ts/components/settings/section/categoryChat.tsx @@ -51,7 +51,6 @@ export const SettingsCategoryChat = (props: { hasPassword: boolean | null }) => function chatWithWallet() { window.setSettingValue(SettingsKey.settingsChatWithWallet, !chatwithWallet); // let contional:any=chatwithWallet; - // console.log('contional::',contional) // dispatch(updateWalletSyncInitiatedWithChat(contional)) ; let data: any = false; diff --git a/ts/components/wallet/BchatWalletMainPanel.tsx b/ts/components/wallet/BchatWalletMainPanel.tsx index 2a65f35e..b3c7416f 100644 --- a/ts/components/wallet/BchatWalletMainPanel.tsx +++ b/ts/components/wallet/BchatWalletMainPanel.tsx @@ -51,8 +51,9 @@ export const WalletMainPanel = () => { } function numberOnly(e: any) { - const re = /^\d+\.?\d*$/; - if (e === '' || re.test(e)) { + // const re = /^\d+\.?\d*$/; + const pattern = /^(\d{0,16}(\.\d{1,5})?|(\d{0,16}\.))$/; + if (e === '' || pattern.test(e)) { setAmount(e); } } @@ -120,7 +121,6 @@ export const Dashboard = (props: any) => { const focusedInnersection = useSelector((state: any) => state.walletInnerFocused); let transactions = useSelector((state: any) => state.wallet.transacations); const zoomLevel = window.getSettingValue('zoom-factor-setting'); - console.log('zoomLevel -->',zoomLevel,'window.innerWidth -->',window.innerWidth) // daemon.daemonHeartbeat(); return ( <> diff --git a/ts/components/wallet/BchatWalletModal.tsx b/ts/components/wallet/BchatWalletModal.tsx index 78749e10..12c3900e 100644 --- a/ts/components/wallet/BchatWalletModal.tsx +++ b/ts/components/wallet/BchatWalletModal.tsx @@ -1,65 +1,114 @@ -import classNames from "classnames" -import React, { useState } from "react" -import { BchatButtonColor } from "../basic/BchatButton" -import { SpacerSM } from "../basic/Text" -import { BchatWrapperModal } from "../BchatWrapperModal" -import { useKey } from "react-use" -import { BchatIcon } from "../icon" +import classNames from 'classnames'; +import React, { useState } from 'react'; +import { BchatButtonColor } from '../basic/BchatButton'; +import { SpacerSM } from '../basic/Text'; +import { BchatWrapperModal } from '../BchatWrapperModal'; +// import { useKey } from 'react-use'; +import { BchatIcon } from '../icon'; import { Constants } from '../../bchat'; - export const WalletModal = (props: any) => { - const [select, setSelect] = useState(props.currency); - useKey((event: KeyboardEvent) => { - props.onClick(select) - return event.key === 'Enter'; - }); - return
- { props.onClick(select) } - }} - cancelButton={{ - status: true, - text: window.i18n('cancel'), - onClickCancelHandler: props.onClose - }} - > -
-
-
- {props.content.length !== 0 && props.content.map((item: any, i: any) => <> -
{ + // props.onClick(select); + // return event.key === 'Enter'; + // }); - onClick={() => setSelect(item)} > -
- {select === item && ( - - )} -
- {item} -
- - )} -
- {/* */} + function search(sTerm: string) { + setSearchTerm(sTerm.trim()); + if (sTerm.trim() !== '') { + const filtered = props.content.filter((item: any) => + item.toLowerCase().includes(sTerm.toLowerCase()) + ); + setData(filtered); + } else { + setData(props.content); + } + } + return ( +
+ { + props.onClick(select); + }, + }} + cancelButton={{ + status: true, + text: window.i18n('cancel'), + onClickCancelHandler: props.onClose, + }} + > +
+ {needSearch && ( + <> + +
+
+
+ +
+ { + const inputValue = e.target.value; + search(inputValue); + }} + placeholder={'Search Currency'} + maxLength={26} + />
- {/*
*/} - {/* + + + )} +
+
+ {data?.length !== 0 && + data.map((item: any, i: any) => ( + <> +
setSelect(item)} + > +
+ {select === item && ( + + )} +
+ {item} +
+ + + ))} +
+ {/* */} +
+ {/*
*/} + {/* { borderRadius: '5px' }} /> */} - {/* { }} /> */} - {/*
*/} -
- + {/*
*/} +
+
-} \ No newline at end of file + ); +}; diff --git a/ts/components/wallet/BchatWalletReceivedForm.tsx b/ts/components/wallet/BchatWalletReceivedForm.tsx index c7c5aece..e2f008e9 100644 --- a/ts/components/wallet/BchatWalletReceivedForm.tsx +++ b/ts/components/wallet/BchatWalletReceivedForm.tsx @@ -11,8 +11,9 @@ export const ReceivedForm = () => { const qrValue = `Beldex:${walletAddress}?tx_amount=${txnAmount}`; function validator(e: any) { - const numbersValidation = /^\d+\.?\d*$/; - if (e === '' || numbersValidation.test(e)) { + // const numbersValidation = /^\d+\.?\d*$/; + const pattern = /^(\d{0,16}(\.\d{1,5})?|(\d{0,16}\.))$/; + if (e === '' || pattern.test(e)) { setTxnAmount(e); } } diff --git a/ts/components/wallet/BchatWalletSendForm.tsx b/ts/components/wallet/BchatWalletSendForm.tsx index 5335bf5b..835caf2a 100644 --- a/ts/components/wallet/BchatWalletSendForm.tsx +++ b/ts/components/wallet/BchatWalletSendForm.tsx @@ -34,7 +34,6 @@ export const SendForm = (props: any) => { const BchatSendConfirmState = useSelector(getwalletSendConfirmModal); const zoomLevel = window.getSettingValue('zoom-factor-setting'); const validZoomLevel=window.screen.width <= 1920 && zoomLevel>100; - console.log('validZoomLevel -->',validZoomLevel,window.screen.width,window.screen.width <= 1920) function clearStateValue() { props.setAmount(''); @@ -68,7 +67,6 @@ export const SendForm = (props: any) => { return event.key === 'Enter'; }); async function addressValidation() { - // console.log("netConnetion()",netConnetion()) if (!window.globalOnlineStatus) { ToastUtils.pushToastError('internetConnectionError', 'Please check your internet connection'); return; diff --git a/ts/components/wallet/BchatWalletSettings.tsx b/ts/components/wallet/BchatWalletSettings.tsx index ad685210..ff77bcd6 100644 --- a/ts/components/wallet/BchatWalletSettings.tsx +++ b/ts/components/wallet/BchatWalletSettings.tsx @@ -195,6 +195,7 @@ export const WalletSettings = () => { headerName: window.i18n('displayCurrency'), content: currenyExt, currency: fiatCurrency, + needSearch:true, onClose: () => dispatch(walletSettingMiniModal(null)), onClick: (e: any) => { window.setSettingValue(walletSettingsKey.settingsFiatCurrency, e); diff --git a/ts/components/wallet/BchatWalletSyncSatusBar.tsx b/ts/components/wallet/BchatWalletSyncSatusBar.tsx index e4ae80c0..d32ee5f5 100644 --- a/ts/components/wallet/BchatWalletSyncSatusBar.tsx +++ b/ts/components/wallet/BchatWalletSyncSatusBar.tsx @@ -24,11 +24,9 @@ const SyncStatusBar = () => { if (currentDaemon?.type === 'Local') { currentHeight = useSelector((state: any) => state.daemon.height); daemonHeight = Number(useSelector(getHeight)); - // console.log('currentDaemon?.type ::', currentDaemon?.type, currentHeight, daemonHeight) } else { currentHeight = Number(useSelector(getHeight)); daemonHeight = useSelector((state: any) => state.daemon.height); - // console.log('currentDaemon sync ::', currentDaemon?.type, currentHeight, daemonHeight) } let pct: any = diff --git a/ts/components/wallet/BchatWalletTransactionSection.tsx b/ts/components/wallet/BchatWalletTransactionSection.tsx index 678a7315..bd8efcba 100644 --- a/ts/components/wallet/BchatWalletTransactionSection.tsx +++ b/ts/components/wallet/BchatWalletTransactionSection.tsx @@ -142,7 +142,6 @@ export const TransactionSection = (props: any) => { } function searchTransaction(filteredTransaction: any) { - // console.log("filteredTransaction ::",searchText) let data = filteredTransaction.length > 0 ? filteredTransaction.filter( @@ -174,10 +173,12 @@ export const TransactionSection = (props: any) => { const modalRef = useRef(null); return ( -
100?'unset':''}}> +
100 ? 'unset' : '' }}>
(visible ? setVisible(false) : '')}> - -
+ +
{ /> {window.i18n('transactions')}
- + {transactionsHistory.length !== 0 || searchText ? ( -
{ onClick={() => showdata(item, i)} style={{ cursor: 'pointer' }} > - - + +
@@ -363,24 +371,35 @@ export const TransactionSection = (props: any) => {
-
125 && innerWidth<1920?'38px':'',marginTop:'15px'}}> -
125 && innerWidth<1920?'unset':'right' }} + 125 && innerWidth < 1920 ? '38px' : '', + marginTop: '15px', + }} > +
- {moment.unix(item.timestamp).format('ll HH:mm')} -
-
- Height : {item.height}{' '} - {item.type === 'out' || item.type === 'in' ? '(confirmed)' : ''} -
-
- +
125 && innerWidth < 1920 ? 'unset' : 'right', + }} + > + {moment.unix(item.timestamp).format('ll HH:mm')} +
+
+ Height : {item.height}{' '} + {item.type === 'out' || item.type === 'in' ? '(confirmed)' : ''} +
+ + +
{selected === i && ( diff --git a/ts/interactions/conversations/unsendingInteractions.ts b/ts/interactions/conversations/unsendingInteractions.ts index 1c91a7bf..fb0812cc 100644 --- a/ts/interactions/conversations/unsendingInteractions.ts +++ b/ts/interactions/conversations/unsendingInteractions.ts @@ -336,6 +336,18 @@ export async function deleteMessagesByIdForEveryone( await Promise.all(messageIds.map(m => getMessageById(m, false))) ); + const isContainInCommingMsgs = selectedMessages.some(msg => { + if (!msg.isOutgoing()) { + ToastUtils.pushToastError('', 'Please select an incoming message'); + return true; + } + return false; + }); + + if (isContainInCommingMsgs) { + return; + } + const messageCount = selectedMessages.length; const moreThanOne = messageCount > 1; @@ -371,7 +383,7 @@ export async function deleteMessagesById(messageIds: Array, conversation window.inboxStore?.dispatch( updateConfirmModal({ // title: window.i18n('deleteJustForMe'), - title:"Delete selected messages?", + title: 'Delete selected messages?', message: moreThanOne ? window.i18n('deleteMessagesQuestion', [messageCount.toString()]) : window.i18n('deleteMessageQuestion'), diff --git a/ts/mains/main_renderer.tsx b/ts/mains/main_renderer.tsx index 714beb5c..b0deb996 100644 --- a/ts/mains/main_renderer.tsx +++ b/ts/mains/main_renderer.tsx @@ -166,8 +166,6 @@ Storage.onready(async () => { } const themeSetting = window.Events.getThemeSetting(); - - // console.log("themeSetting ",themeSetting); const newThemeSetting = mapOldThemeToNew(themeSetting); window.Events.setThemeSetting(newThemeSetting); @@ -407,7 +405,6 @@ async function connect() { .catch(err => { throw new HTTPError('beldex_rpc_port', err); }); - // console.log('connectCount === 0 && navigator.onLine:', connectCount, navigator.onLine); // Bootstrap our online/offline detection, only the first time we connect if (connectCount === 0 && navigator.onLine) { window.addEventListener('offline', onOffline); diff --git a/ts/models/message.ts b/ts/models/message.ts index 7cc250fa..d9e0ceae 100644 --- a/ts/models/message.ts +++ b/ts/models/message.ts @@ -273,29 +273,19 @@ export class MessageModel extends Backbone.Model { return basicProps; } public getPropsForPayment(): PropsForPayment | null { - // console.log("this.istxnDetails() ::0",this.istxnDetails(),!this.isPayment()) if (!this.isPayment() && !this.istxnDetails()) { - // console.log("this.istxnDetails() ::1",this.istxnDetails()) return null; } // else if (!this.istxnDetails()) { - // console.log("this.istxnDetails() ::1",this.istxnDetails()) // return null; // } - - // console.log("this.istxnDetails() ::2",this.get('txnDetails')) - const Payment = this.get('payment') || this.get('txnDetails'); - // console.log("this.istxnDetails() ::3",Payment) - let direction = this.get('direction'); if (!direction) { direction = this.get('type') === 'outgoing' ? 'outgoing' : 'incoming'; } - - return { amount: Payment.amount, txnId: Payment.txnId, @@ -1315,7 +1305,6 @@ export class MessageModel extends Backbone.Model { { let amount=this.getMessageModelProps()?.propsForPayment?.amount; let direction=this.getMessageModelProps()?.propsForPayment?.direction === "outgoing"?"Send":'Received' - // console.log('Payment Details ::',this.isPayment(),this.getMessageModelProps()?.propsForPayment?.amount,`${amount}BDX ${direction}`) return `${amount} BDX ${direction}`; } diff --git a/ts/node/sql.ts b/ts/node/sql.ts index 0ffd9707..31a98175 100644 --- a/ts/node/sql.ts +++ b/ts/node/sql.ts @@ -1712,8 +1712,6 @@ function createOrUpdateItem(data: StorageItem, instance?: BetterSqlite3.Database createOrUpdate(ITEMS_TABLE, data, instance); } function getItemById(id: string) { - // console.log('getItemById:::muna'); - return getById(ITEMS_TABLE, id); } function getAllItems() { @@ -1972,9 +1970,7 @@ function getConversationById(id: string) { if (!row) { return null; - } - // console.log('getConversationById',row); - + } return jsonToObject(row.json); } @@ -2899,9 +2895,6 @@ function getAllUnprocessed() { .prepare('SELECT * FROM unprocessed ORDER BY timestamp ASC;') .all(); - // console.log('getAllUnprocessed ::',rows); - // window.log.warn('getAllUnprocessed ::',rows) - // window.log.info("getAllUnprocessed dat ::") return rows; } @@ -3793,8 +3786,6 @@ function fillWithTestData(numConvosToAdd: number, numMsgsToAdd: number) { function saveRecipientAddress(data: any) { const { tx_hash,address } = data; - // console.log("RecipientAddress ::5",data); - // if () { // throw new Error(`saveReceipientAddress: id was falsey: ${id}`); // } @@ -3813,15 +3804,11 @@ function saveRecipientAddress(data: any) { address, tx_hash, }); - console.log("RecipientAddress ::6 and end",); - - console.log('addRecipientAddress'); return ; } // function saveRecipientAddressvalid(data:any) // { -// console.log("RecipientAddress ::2",data); // // data.json=JSON.stringify(data); // const { address } = data; @@ -3830,11 +3817,8 @@ function saveRecipientAddress(data: any) { // .get({ // address // }); -// console.log("RecipientAddress ::3",row); // if (!row) { -// console.log("RecipientAddress ::4",data); - // saveRecipientAddress(data) // } // } diff --git a/ts/receiver/contentMessage.ts b/ts/receiver/contentMessage.ts index df4b31a3..f5206d46 100644 --- a/ts/receiver/contentMessage.ts +++ b/ts/receiver/contentMessage.ts @@ -213,7 +213,6 @@ export async function decryptWithBchatProtocol( // await conversation.commit(); // if (getConversation && getConversation.walletAddress) { - // console.log('yes'); // if ( // getConversation.walletAddress == // 'bxbxYJsQ5G9PUgHnD89PwTRLxxUKG16uCeVXKY4s1a8ihiXDCiiohJoKQL5nxPjfWk5hz9Xztr6XX7yBsgtfiXuQ2qkZLiWPn' @@ -224,14 +223,14 @@ export async function decryptWithBchatProtocol( // walletAddress: beldexFinalAddress, // }; // let updateConversation: any = await updateConversationAddress(data); - // console.log('updateConversation:', updateConversation); + // // } // localStorage.setItem('senderWalletAddress', beldexFinalAddress); // } else { // localStorage.setItem('senderWalletAddress', getConversation.walletAddress); // } // } else { - // console.log('no'); + // // localStorage.setItem('senderWalletAddress', beldexFinalAddress); // } // if ( diff --git a/ts/state/ducks/modalDialog.tsx b/ts/state/ducks/modalDialog.tsx index 16786ec2..dd39b3d9 100644 --- a/ts/state/ducks/modalDialog.tsx +++ b/ts/state/ducks/modalDialog.tsx @@ -38,7 +38,8 @@ export type walletSettingMiniModalState={ content:any, onClose:any, onClick:any, - currency:string + currency:string, + needSearch?:boolean } | null; export type TransactionInitModalState={} | null; diff --git a/ts/state/selectors/conversations.ts b/ts/state/selectors/conversations.ts index 87b41ba5..680dca50 100644 --- a/ts/state/selectors/conversations.ts +++ b/ts/state/selectors/conversations.ts @@ -1073,7 +1073,6 @@ export const getIsMessageSelected = createSelector( } const { id } = props.propsForMessage; -// console.log('selectedIds selectedIds::',selectedIds) return selectedIds.includes(id); } ); diff --git a/ts/util/notifications.ts b/ts/util/notifications.ts index 18d368b6..e0cce7b1 100644 --- a/ts/util/notifications.ts +++ b/ts/util/notifications.ts @@ -211,7 +211,6 @@ function update(forceRefresh = false) { window.drawAttention(); // if (status.shouldPlayNotificationSound) { - // console.log(sound) // if (!sound) { // sound = new Audio('sound/new_message.mp3'); // } diff --git a/ts/wallet/daemon-rpc.ts b/ts/wallet/daemon-rpc.ts index cae508bc..4ed1d769 100644 --- a/ts/wallet/daemon-rpc.ts +++ b/ts/wallet/daemon-rpc.ts @@ -46,21 +46,11 @@ class Daemon { } daemonHeartbeat() { - // console.log('updateDaemonupdateDaemon::0'); - // const dispatch = useDispatch(); - // console.log('updateDaemonupdateDaemon::1'); - clearInterval(this.heartbeat); - // console.log('updateDaemonupdateDaemon::2'); - this.heartbeat = setInterval(() => { this.sendRPC('get_info').then(data => { - // console.log('updateDaemonupdateDaemon::3', data); if (!data.hasOwnProperty('error')) { - // console.log('updateDaemonupdateDaemon::4', data.result.height); window.inboxStore?.dispatch(updateDaemon({ height: data.result.height })); - - // window dispatch(updateDaemon({ height: data.result.height })); } }); }, 3000); diff --git a/ts/wallet/wallet-rpc.ts b/ts/wallet/wallet-rpc.ts index c006dd9c..2dc55abb 100644 --- a/ts/wallet/wallet-rpc.ts +++ b/ts/wallet/wallet-rpc.ts @@ -84,7 +84,6 @@ class Wallet { startWallet = async (type?: string) => { try { - // console.log('start wallet rpc :', type); let getFiatCurrency = window.getSettingValue(walletSettingsKey.settingsFiatCurrency); if (!getFiatCurrency) { window.setSettingValue(walletSettingsKey.settingsFiatCurrency, 'USD'); @@ -208,9 +207,7 @@ class Wallet { }); wallet.stdout.on('close', (code: any) => { process.stderr.write(`Wallet: exited with code ${code} \n`); - // if (code === null) { - // console.log("Failed to start wallet RPC"); - // } + }); } catch (error) { console.log('failed to start wallet rpc', error); @@ -455,10 +452,10 @@ class Wallet { window.inboxStore?.dispatch(updateWalletHeight(response.result.height)); } else if (n.method == 'getbalance') { let transacationsHistory: any = []; - if (type == 'wallet') { + // if (type == 'wallet') { transacationsHistory = await this.getTransactions(); transacationsHistory = transacationsHistory.transactions.tx_list; - } + // } if ( this.wallet_state.balance == response.result.balance && this.wallet_state.unlocked_balance == response.result.unlocked_balance && @@ -655,7 +652,6 @@ class Wallet { }; }) .catch((error: any) => { - // console.log('ERRORRRRRR:', error); return { method: method, params: params,