This commit is contained in:
PhilReact 2023-10-12 22:35:09 -05:00
parent 6c17dd6bdb
commit 8cb7f4cc72
10 changed files with 119 additions and 16 deletions

View File

@ -1175,7 +1175,10 @@
"notifications": { "notifications": {
"notify1": "Confirming transaction", "notify1": "Confirming transaction",
"notify2": "Transaction confirmed", "notify2": "Transaction confirmed",
"explanation": "Your transaction is getting confirmed. To track its progress, click on the bell icon." "explanation": "Your transaction is getting confirmed. To track its progress, click on the bell icon.",
"status1": "Fully synced",
"status2": "Not synced",
"notify3": "No notifications"
}, },
"friends": { "friends": {
"friend1": "Add name", "friend1": "Add name",

View File

@ -45,7 +45,7 @@ import './notification-view/notification-bell.js'
import './notification-view/notification-bell-general.js' import './notification-view/notification-bell-general.js'
import './friends-view/friends-side-panel-parent.js' import './friends-view/friends-side-panel-parent.js'
import './friends-view/save-settings-qdn.js' import './friends-view/save-settings-qdn.js'
import './friends-view/core-sync-status.js'
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }) const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
class AppView extends connect(store)(LitElement) { class AppView extends connect(store)(LitElement) {
@ -564,7 +564,7 @@ class AppView extends connect(store)(LitElement) {
<friends-side-panel-parent></friends-side-panel-parent> <friends-side-panel-parent></friends-side-panel-parent>
<notification-bell></notification-bell> <notification-bell></notification-bell>
<notification-bell-general></notification-bell-general> <notification-bell-general></notification-bell-general>
<core-sync-status></core-sync-status>
</div> </div>
<div style="display: inline;"> <div style="display: inline;">
<span> <span>

View File

@ -16,7 +16,8 @@ class ChatSideNavHeads extends LitElement {
activeChatHeadUrl: { type: String }, activeChatHeadUrl: { type: String },
isImageLoaded: { type: Boolean }, isImageLoaded: { type: Boolean },
setActiveChatHeadUrl: {attribute: false}, setActiveChatHeadUrl: {attribute: false},
openEditFriend: {attribute: false} openEditFriend: {attribute: false},
closeSidePanel: {attribute: false, type: Object}
} }
} }
@ -192,6 +193,7 @@ class ChatSideNavHeads extends LitElement {
this.openEditFriend(this.chatInfo) this.openEditFriend(this.chatInfo)
}} }}
name=${this.chatInfo.name} name=${this.chatInfo.name}
.closeSidePanel=${this.closeSidePanel}
></friend-item-actions> ></friend-item-actions>
` `
} }

View File

@ -268,6 +268,8 @@ class AddFriendsModal extends connect(store)(LitElement) {
this.notes = this.editContent.notes ?? ''; this.notes = this.editContent.notes ?? '';
this.willFollow = this.editContent.willFollow ?? true; this.willFollow = this.editContent.willFollow ?? true;
this.alias = this.editContent.alias ?? ''; this.alias = this.editContent.alias ?? '';
this.requestUpdate()
console.log('this.editContent', this.editContent )
} }
if ( if (
changedProperties && changedProperties &&
@ -300,6 +302,7 @@ class AddFriendsModal extends connect(store)(LitElement) {
} }
render() { render() {
console.log('update2')
return html` return html`
<div class="modal-overlay ${this.isOpen ? '' : 'hidden'}"> <div class="modal-overlay ${this.isOpen ? '' : 'hidden'}">
@ -362,16 +365,20 @@ class AddFriendsModal extends connect(store)(LitElement) {
id="alias" id="alias"
placeholder=${translate('friends.friend7')} placeholder=${translate('friends.friend7')}
class="input" class="input"
value=${this.alias} .value=${this.alias}
@change=${(e) => (this.alias = e.target.value)} @change=${(e) => {
this.alias = e.target.value
}}
/> />
</div> </div>
<div style="height:15px"></div> <div style="height:15px"></div>
<div style="margin-bottom:0;"> <div style="margin-bottom:0;">
<textarea <textarea
class="input" class="input"
@change=${(e) => (this.notes = e.target.value)} @change=${(e) => {
value=${this.notes} this.notes = e.target.value
}}
.value=${this.notes}
?disabled=${this.isLoading} ?disabled=${this.isLoading}
id="messageBoxAddFriend" id="messageBoxAddFriend"
placeholder="${translate('friends.friend4')}" placeholder="${translate('friends.friend4')}"

View File

@ -0,0 +1,79 @@
import { LitElement, html, css } from 'lit';
import '@material/mwc-icon';
import { store } from '../../store';
import { connect } from 'pwa-helpers';
import '@vaadin/tooltip';
import { get } from 'lit-translate';
class CoreSyncStatus extends connect(store)(LitElement) {
static get properties() {
return {
nodeStatus: {type: Object}
};
}
constructor() {
super();
this.nodeStatus = {
isMintingPossible:false,
isSynchronizing:true,
syncPercent:undefined,
numberOfConnections:undefined,
height:undefined,
}
}
static styles = css`
.header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px;
border-bottom: 1px solid #e0e0e0;
}
.content {
padding: 16px;
}
.close {
visibility: hidden;
position: fixed;
z-index: -100;
right: -1000px;
}
.parent-side-panel {
transform: translateX(100%); /* start from outside the right edge */
transition: transform 0.3s ease-in-out;
}
.parent-side-panel.open {
transform: translateX(0); /* slide in to its original position */
}
`;
stateChanged(state) {
console.log({state})
this.nodeStatus = state.app.nodeStatus
}
render() {
return html`
<mwc-icon id="icon" style="color: ${this.nodeStatus.syncPercent === 100 ? 'green': 'red'};user-select:none;margin-right:20px"
>wifi</mwc-icon
>
<vaadin-tooltip
for="icon"
position="bottom"
hover-delay=${400}
hide-delay=${1}
text=${this.nodeStatus.syncPercent === 100 ? get('notifications.status1'): get('notifications.status2')}>
</vaadin-tooltip>
`;
}
}
customElements.define('core-sync-status', CoreSyncStatus);

View File

@ -64,6 +64,7 @@ export class FriendItemActions extends connect(store)(LitElement) {
message: { type: String }, message: { type: String },
openEditFriend: { attribute: false }, openEditFriend: { attribute: false },
name: { type: String }, name: { type: String },
closeSidePanel: {attribute: false, type: Object}
}; };
} }
@ -190,6 +191,7 @@ export class FriendItemActions extends connect(store)(LitElement) {
}) })
); );
this.closePopover(); this.closePopover();
this.closeSidePanel()
}}" }}"
> >
<mwc-icon style="color: var(--black)" <mwc-icon style="color: var(--black)"
@ -219,6 +221,7 @@ export class FriendItemActions extends connect(store)(LitElement) {
}) })
); );
this.closePopover(); this.closePopover();
this.closeSidePanel()
}}" }}"
> >
<mwc-icon style="color: var(--black)" <mwc-icon style="color: var(--black)"

View File

@ -66,7 +66,7 @@ class FriendsSidePanelParent extends LitElement {
<vaadin-tooltip <vaadin-tooltip
for="friends-icon" for="friends-icon"
position="bottom" position="bottom"
hover-delay=${200} hover-delay=${400}
hide-delay=${1} hide-delay=${1}
text=${get('friends.friends17')}> text=${get('friends.friends17')}>
</vaadin-tooltip> </vaadin-tooltip>

View File

@ -9,13 +9,15 @@ class FriendsSidePanel extends LitElement {
setIsOpen: { attribute: false}, setIsOpen: { attribute: false},
isOpen: {type: Boolean}, isOpen: {type: Boolean},
selected: {type: String}, selected: {type: String},
setHasNewFeed: {attribute: false} setHasNewFeed: {attribute: false},
closeSidePanel: {attribute: false, type: Object}
}; };
} }
constructor(){ constructor(){
super() super()
this.selected = 'friends' this.selected = 'friends'
this.closeSidePanel = this.closeSidePanel.bind(this)
} }
static styles = css` static styles = css`
@ -106,6 +108,10 @@ class FriendsSidePanel extends LitElement {
} }
closeSidePanel(){
this.setIsOpen(false)
}
render() { render() {
return html` return html`
<div class="parent"> <div class="parent">
@ -126,7 +132,7 @@ class FriendsSidePanel extends LitElement {
</div> </div>
<div class="content"> <div class="content">
<div class="${this.selected === 'friends' ? 'active-content' : 'default-content'}"> <div class="${this.selected === 'friends' ? 'active-content' : 'default-content'}">
<friends-view .refreshFeed=${()=>this.refreshFeed()}></friends-view> <friends-view .closeSidePanel=${this.closeSidePanel} .refreshFeed=${()=>this.refreshFeed()}></friends-view>
</div> </div>
<div class="${this.selected === 'feed' ? 'active-content' : 'default-content'}"> <div class="${this.selected === 'feed' ? 'active-content' : 'default-content'}">
<friends-feed .setHasNewFeed=${(val)=> this.setHasNewFeed(val)}></friends-feed> <friends-feed .setHasNewFeed=${(val)=> this.setHasNewFeed(val)}></friends-feed>

View File

@ -42,7 +42,8 @@ class FriendsView extends connect(store)(LitElement) {
isOpenAddFriendsModal: {type: Boolean}, isOpenAddFriendsModal: {type: Boolean},
editContent: {type: Object}, editContent: {type: Object},
mySelectedFeeds: {type: Array}, mySelectedFeeds: {type: Array},
refreshFeed: {attribute: false} refreshFeed: {attribute: false},
closeSidePanel: {attribute: false, type: Object}
}; };
} }
static get styles() { static get styles() {
@ -145,8 +146,7 @@ class FriendsView extends connect(store)(LitElement) {
this.userFound = [] this.userFound = []
} else { } else {
this.userFound = [ this.userFound = [
...this.userFound, result
result,
]; ];
} }
this.userFoundModalOpen = true; this.userFoundModalOpen = true;
@ -253,6 +253,7 @@ class FriendsView extends connect(store)(LitElement) {
} }
render() { render() {
console.log('this.friendList', this.friendList)
return html` return html`
<div class="container"> <div class="container">
<div id="viewElement" class="container-body" style=${"position: relative"}> <div id="viewElement" class="container-body" style=${"position: relative"}>
@ -308,6 +309,7 @@ class FriendsView extends connect(store)(LitElement) {
}} }}
.chatInfo=${item} .chatInfo=${item}
.openEditFriend=${(val)=> this.openEditFriend(val)} .openEditFriend=${(val)=> this.openEditFriend(val)}
.closeSidePanel=${this.closeSidePanel}
></chat-side-nav-heads>`; ></chat-side-nav-heads>`;
})} })}
<div id="downObserver"></div> <div id="downObserver"></div>

View File

@ -147,6 +147,9 @@ class NotificationBellGeneral extends connect(store)(LitElement) {
@blur=${this.handleBlur} @blur=${this.handleBlur}
> >
<div class="notifications-list"> <div class="notifications-list">
${this.notifications.length === 0 ? html`
<p style="font-size: 16px; width: 100%; text-align:center;margin-top:20px;">${translate('notifications.notify3')}</p>
` : ''}
${repeat( ${repeat(
this.notifications, this.notifications,
(notification) => notification.reference.signature, // key function (notification) => notification.reference.signature, // key function
@ -169,7 +172,6 @@ class NotificationBellGeneral extends connect(store)(LitElement) {
} }
_toggleNotifications() { _toggleNotifications() {
if (this.notifications.length === 0) return;
this.showNotifications = !this.showNotifications; this.showNotifications = !this.showNotifications;
if (this.showNotifications) { if (this.showNotifications) {
requestAnimationFrame(() => { requestAnimationFrame(() => {
@ -184,7 +186,6 @@ class NotificationBellGeneral extends connect(store)(LitElement) {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
position: relative; position: relative;
margin-right: 20px;
} }
.count { .count {