- { state.name && (
-
{ state.name }
- )}
- { !state.name && (
-
name
+
+
+ { state.logoSet && (
+
)}
- { state.node && (
+
+
+ { state.name && (
+
{ state.name }
+ )}
+ { !state.name && (
+
Name
+ )}
+
+ { state.node && (
+
+ )}
-
-
{ state.node }
+
+ { state.location && (
+
{ state.location }
+ )}
+ { !state.location && (
+
Location
+ )}
+
+
+
+ { state.description && (
+
{ state.description }
+ )}
+ { !state.description && (
+
Description
+ )}
- )}
-
-
- { state.location && (
-
{ state.location }
- )}
- { !state.location && (
-
location
- )}
-
-
- { state.description && (
-
{ state.description }
- )}
- { !state.description && (
-
description
- )}
-
-
- { state.status === 'connected' && (
-
-
updateContact(actions.disconnect)}>Disconnect
-
updateContact(actions.disconnectRemove)}>Delete Contact
-
- )}
-
- { state.status === 'pending' && (
-
-
updateContact(actions.confirmContact)}>Save Contact
-
updateContact(actions.connect)}>Save and Accept
-
updateContact(actions.remove)}>Ignore Request
-
- )}
-
- { state.status === 'request received' && (
-
-
updateContact(actions.saveConnect)}>Accept Connection
-
updateContact(actions.disconnect)}>Ignore Request
-
- )}
-
- { state.status === 'request sent' && (
-
-
updateContact(actions.disconnect)}>Cancel Request
-
updateContact(actions.disconnectRemove)}>Delete Contact
-
- )}
-
- { state.status === 'saved' && (
-
-
updateContact(actions.connect)}>Request Connection
-
updateContact(actions.remove)}>Delete Contact
-
- )}
-
- { state.status === 'unsaved' && (
-
-
updateContact(actions.saveContact)}>Save Contact
-
updateContact(actions.saveConnect)}>Save and Request
-
- )}
-
-
-
-
Status: { state.status }
+
+
Actions
+
+ { state.status === 'connected' && (
+
+ } size="medium" onClick={() => updateContact(actions.disconnect)}>Disconnect
+
+ )}
+ { state.status === 'connected' && (
+
+ } size="medium" onClick={() => updateContact(actions.disconnectRemove)}>Delete
+
+ )}
+ { state.status === 'pending' && (
+
+ } size="medium" onClick={() => updateContact(actions.confirmContact)}>Save
+
+ )}
+ { state.status === 'pending' && (
+
+ } size="medium" onClick={() => updateContact(actions.connect)}>Connect
+
+ )}
+ { state.status === 'pending' && (
+
+ } size="medium" onClick={() => updateContact(actions.remove)}>Cancel
+
+ )}
+ { state.status === 'request received' && (
+
+ } size="medium" onClick={() => updateContact(actions.saveConnect)}>Connect
+
+ )}
+ { state.status === 'request received' && (
+
+ } size="medium" onClick={() => updateContact(actions.disconnect)}>Cancel
+
+ )}
+ { state.status === 'request sent' && (
+
+ } size="medium" onClick={() => updateContact(actions.disconnect)}>Cancel
+
+ )}
+ { state.status === 'request sent' && (
+
+ } size="medium" onClick={() => updateContact(actions.disconnectRemove)}>Delete
+
+ )}
+ { state.status === 'saved' && (
+
+ } size="medium" onClick={() => updateContact(actions.connect)}>Connect
+
+ )}
+ { state.status === 'saved' && (
+
+ } size="medium" onClick={() => updateContact(actions.remove)}>Delete
+
+ )}
+ { state.status === 'unsaved' && (
+
+ } size="medium" onClick={() => updateContact(actions.saveContact)}>Save
+
+ )}
+ { state.status === 'unsaved' && (
+
+ } size="medium" onClick={() => updateContact(actions.saveConnect)}>Connect
+
+ )}
+ { state.offsync && (
+
+ } size="medium" onClick={() => updateContact(actions.resync)}>Resync
+
+ )}
+
+
+
+
+
Status: { state.status }
+
);
diff --git a/net/web/src/session/contact/Contact.styled.js b/net/web/src/session/contact/Contact.styled.js
index f30c7494..da7ddfcc 100644
--- a/net/web/src/session/contact/Contact.styled.js
+++ b/net/web/src/session/contact/Contact.styled.js
@@ -1,34 +1,84 @@
import styled from 'styled-components';
-import { Colors } from 'constants/Colors';
export const ContactWrapper = styled.div`
height: 100%;
width: 100%;
- display: flex;
- flex-direction: column;
- background-color: ${Colors.profileForm};
+ .frame {
+ height: 100%;
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ color: ${props => props.theme.mainText};
+ }
+
+ .drawer {
+ height: 100%;
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ border-left: 1px solid ${props => props.theme.drawerBorder};
+ background-color: ${props => props.theme.selectedArea};
+ color: ${props => props.theme.mainText};
+ }
+
+ .actions {
+ display: flex;
+ flex-grow: 1;
+ justify-content: center;
+ padding-top: 16px;
+ flex-direction: column;
+ align-items: center;
+
+ .label {
+ padding-top: 16px;
+ border-bottom: 1px solid ${props => props.theme.sectionBorder};
+ color: ${props => props.theme.hintText};
+ font-size: 12px;
+ width: 50%;
+ max-width: 300px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+ }
+
+ .top {
+ height: 48px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 20px;
+ font-weight: bold;
+ }
.header {
margin-left: 16px;
margin-right: 16px;
height: 48px;
- border-bottom: 1px solid ${Colors.profileDivider};
display: flex;
+ border-bottom: 1px solid ${props => props.theme.headerBorder};
flex-direction: row;
align-items: center;
+ justify-content: center;
flex-shrink: 0;
+
+ .handle {
+ font-size: 20px;
+ font-weight: bold;
+ flex-grow: 1;
+ padding-left: 16px;
+ }
+
.handle {
font-size: 20px;
font-weight: bold;
- flex-grow: 1;
- padding-left: 16px;
}
.close {
font-size: 18px;
- color: ${Colors.primary};
+ color: ${props => props.theme.hintText};
cursor: pointer;
padding-right: 16px;
}
@@ -51,6 +101,18 @@ export const ContactWrapper = styled.div`
display: flex;
flex-direction: column;
align-items: center;
+
+ .details {
+ align-items: center;
+ padding-left: 16px;
+ padding-right: 16px;
+ max-width: 400px;
+ }
+
+ .logo {
+ margin-top: 16px;
+ margin-bottom: 8px;
+ }
}
.logo {
@@ -58,6 +120,8 @@ export const ContactWrapper = styled.div`
width: 20vw;
margin-right: 32px;
margin-left: 32px;
+ width: 192px;
+ height: 192px;
}
.details {
@@ -66,13 +130,14 @@ export const ContactWrapper = styled.div`
.notset {
font-style: italic;
- color: ${Colors.grey};
+ color: ${props => props.theme.hintText};
}
.name {
display: flex;
flex-direction: row;
align-items: center;
+ padding-bottom: 8px;
.data {
padding-right: 8px;
@@ -127,7 +192,7 @@ export const ContactWrapper = styled.div`
}
.close {
- color: ${Colors.primary};
+ color: ${props => props.theme.mainText};
cursor: pointer;
width: 64px;
display: flex;
@@ -140,19 +205,17 @@ export const ContactWrapper = styled.div`
.controls {
padding-top: 16px;
padding-bottom: 16px;
+ display: flex;
+ flex-direction: row;
+ gap: 16px;
.button {
- width: 192px;
- padding-top: 2px;
- padding-bottom: 2px;
- margin-top: 16px;
display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- border-radius: 2px;
- color: ${Colors.white};
- background-color: ${Colors.primary};
+ }
+
+ .anticon {
+ font-size: 18px;
+ padding-top: 2px;
}
.label {
@@ -173,12 +236,11 @@ export const ContactWrapper = styled.div`
}
.footer {
- flex-grow: 1;
display: flex;
align-items: flex-end;
justify-content: center;
padding-bottom: 16px;
- color: ${Colors.grey};
+ color: ${props => props.theme.hintText};
}
`
diff --git a/net/web/src/session/contact/useContact.hook.js b/net/web/src/session/contact/useContact.hook.js
index ba608f3c..b5764e14 100644
--- a/net/web/src/session/contact/useContact.hook.js
+++ b/net/web/src/session/contact/useContact.hook.js
@@ -7,7 +7,9 @@ import { getCardByGuid } from 'context/cardUtil';
export function useContact(guid, listing, close) {
const [state, setState] = useState({
+ offsync: false,
logo: null,
+ logoSet: false,
name: null,
cardId: null,
location: null,
@@ -17,6 +19,8 @@ export function useContact(guid, listing, close) {
status: null,
busy: false,
buttonStatus: 'button idle',
+ strings: {},
+ menuStyle: {},
});
const card = useContext(CardContext);
@@ -47,22 +51,24 @@ export function useContact(guid, listing, close) {
const { imageSet, name, location, description, handle, node } = profile;
const status = statusMap(detail.status);
const cardId = contact.id;
+ const offsync = contact.offsync;
const logo = imageSet ? card.actions.getCardImageUrl(cardId) : null;
- updateState({ logo, name, location, description, handle, node, status, cardId });
+ updateState({ logoSet: true, offsync, logo, name, location, description, handle, node, status, cardId });
}
else if (listing) {
const { logo, name, location, description, handle, node } = listing;
- updateState({ logo, name, location, description, handle, node, status: 'unsaved', cardId: null });
+ updateState({ logoSet: true, logo, name, location, description, handle, node, status: 'unsaved', cardId: null });
}
else {
- updateState({ logo: null, name: null, cardId: null, location: null, description: null, handle: null,
+ updateState({ logoSet: true, logo: null, name: null, cardId: null, location: null, description: null, handle: null,
status: null });
}
// eslint-disable-next-line
}, [card.state, guid, listing]);
useEffect(() => {
- updateState({ display: settings.state.display });
+ const { display, strings, menuStyle } = settings.state;
+ updateState({ display, strings, menuStyle });
}, [settings.state]);
const applyAction = async (action) => {
@@ -149,6 +155,14 @@ export function useContact(guid, listing, close) {
close();
});
},
+ resync: async () => {
+ await applyAction(async () => {
+ const success = await card.actions.resyncCard(state.cardId);
+ if (!success) {
+ throw new Error("resync failed");
+ }
+ });
+ },
remove: async () => {
await applyAction(async () => {
await card.actions.removeCard(state.cardId);
diff --git a/net/web/src/session/listing/Listing.jsx b/net/web/src/session/listing/Listing.jsx
index 9583b299..ccbcb843 100644
--- a/net/web/src/session/listing/Listing.jsx
+++ b/net/web/src/session/listing/Listing.jsx
@@ -26,50 +26,52 @@ export function Listing({ closeListing, openContact }) {
return (
{ modalContext }
-
- { !state.showFilter && (
-
-
-
- )}
- { state.showFilter && (
-
-
-
- )}
-
-
- } value={state.node} spellCheck="false"
- disabled={state.disabled} onChange={(e) => actions.onNode(e.target.value)} />
-
+
+
+ { !state.showFilter && (
+
+
+
+ )}
{ state.showFilter && (
+
+
+
+ )}
+
+
+ } loading={state.busy} onClick={getListing}>
+
+ { state.display === 'small' && (
+
+ } onClick={closeListing}>
)}
-
-
} loading={state.busy} onClick={getListing}>
+
+ { state.contacts.length > 0 && (
+
(
+ openContact(item.guid, item)} />
+ )} />
+ )}
+ { state.contacts.length === 0 && (
+ No Contacts
+ )}
- { state.display === 'small' && (
-
- } onClick={closeListing}>
-
- )}
-
-
- { state.contacts.length > 0 && (
-
(
- openContact(item.guid, item)} />
- )} />
- )}
- { state.contacts.length === 0 && (
- No Contacts
- )}
);
diff --git a/net/web/src/session/listing/Listing.styled.js b/net/web/src/session/listing/Listing.styled.js
index ada76060..4dd3b84e 100644
--- a/net/web/src/session/listing/Listing.styled.js
+++ b/net/web/src/session/listing/Listing.styled.js
@@ -1,23 +1,26 @@
import styled from 'styled-components';
-import { Colors } from 'constants/Colors';
export const ListingWrapper = styled.div`
height: 100%;
width: 100%;
- display: flex;
- flex-direction: column;
- background-color: ${props => props.theme.itemArea};
- color: ${props => props.theme.mainText};
.drawer {
width: 100%;
height: 100%;
- border-left: 1px solid ${props => props.theme.sectionBorder};
+ display: flex;
+ border-left: 1px solid ${props => props.theme.drawerBorder};
+ flex-direction: column;
+ background-color: ${props => props.theme.itemArea};
+ color: ${props => props.theme.mainText};
}
- .screen {
+ .frame {
width: 100%;
height: 100%;
+ display: flex;
+ flex-direction: column;
+ background-color: ${props => props.theme.itemArea};
+ color: ${props => props.theme.mainText};
}
.view {
diff --git a/net/web/src/session/listing/listingItem/ListingItem.styled.js b/net/web/src/session/listing/listingItem/ListingItem.styled.js
index 8c1f72a9..f80983dd 100644
--- a/net/web/src/session/listing/listingItem/ListingItem.styled.js
+++ b/net/web/src/session/listing/listingItem/ListingItem.styled.js
@@ -1,5 +1,4 @@
import styled from 'styled-components';
-import { Colors } from 'constants/Colors';
export const ListingItemWrapper = styled.div`
height: 48px;