diff --git a/pkg/interface/src/logic/lib/util.ts b/pkg/interface/src/logic/lib/util.ts index 53cd38c30..1ebe6e48b 100644 --- a/pkg/interface/src/logic/lib/util.ts +++ b/pkg/interface/src/logic/lib/util.ts @@ -155,18 +155,14 @@ export function uxToHex(ux: string) { return value; } -export const hexToUx: (hex: string) => string = f.flow( - f.split(""), - f.chunk(4), - f.map( - f.flow( - f.dropWhile((y) => y === 0), - f.join - ) - ), - f.join("."), - (x) => `0x${x}` -); +export const hexToUx = (hex) => { + const ux = f.flow( + f.chunk(4), + f.map(x => _.dropWhile(x, y => y === 0).join('')), + f.join('.') + )(hex.split('')); + return `0x${ux}`; +}; export function writeText(str: string) { return new Promise((resolve, reject) => { diff --git a/pkg/interface/src/views/apps/profile/profile.tsx b/pkg/interface/src/views/apps/profile/profile.tsx index 4f7d879d2..7bcae36c7 100644 --- a/pkg/interface/src/views/apps/profile/profile.tsx +++ b/pkg/interface/src/views/apps/profile/profile.tsx @@ -112,12 +112,15 @@ export default function ProfileScreen(props: any) { {view === "settings" && } {view === "identity" && ( + <> + Your identity provides the default information you can optionally share with groups in the group settings panel. + )} diff --git a/pkg/interface/src/views/components/ColorInput.tsx b/pkg/interface/src/views/components/ColorInput.tsx index d2a445903..0ee279db1 100644 --- a/pkg/interface/src/views/components/ColorInput.tsx +++ b/pkg/interface/src/views/components/ColorInput.tsx @@ -1,6 +1,5 @@ import React from "react"; import { useField } from "formik"; -import styled from "styled-components"; import { Col, Label, @@ -22,7 +21,7 @@ export function ColorInput(props: ColorInputProps) { const { id, label, caption, disabled, ...rest } = props; const [{ value, onBlur }, meta, { setValue }] = useField(id); - const hex = value.replace('#', '').substr(2).replace(".", ""); + const hex = value.replace('#', '').replace("0x","").replace(".", ""); const padded = hex.padStart(6, "0"); const onChange = (e: any) => { @@ -36,7 +35,7 @@ export function ColorInput(props: ColorInputProps) { const result = hexToUx(newValue); setValue(result); }; - + return ( diff --git a/pkg/interface/src/views/landscape/components/ContactCard.tsx b/pkg/interface/src/views/landscape/components/ContactCard.tsx index 7fd34c789..e167ea8a3 100644 --- a/pkg/interface/src/views/landscape/components/ContactCard.tsx +++ b/pkg/interface/src/views/landscape/components/ContactCard.tsx @@ -24,6 +24,7 @@ interface ContactCardProps { path: string; api: GlobalApi; s3: S3State; + rootIdentity: Contact; } const formSchema = Yup.object({ @@ -63,13 +64,13 @@ const emptyContact = { nickname: '', email: '', phone: '', - website: '', + website: '', notes: '' }; export function ContactCard(props: ContactCardProps) { const us = `~${window.ship}`; - const { contact } = props; + const { contact, rootIdentity } = props; const onSubmit = async (values: Contact, actions: FormikHelpers) => { try { if(!contact) { @@ -112,7 +113,7 @@ export function ContactCard(props: ContactCardProps) {
- Save + {(contact) ? "Save" : "Share Contact"}
diff --git a/pkg/interface/src/views/landscape/components/GroupsPane.tsx b/pkg/interface/src/views/landscape/components/GroupsPane.tsx index 9c65d10a2..2a47719af 100644 --- a/pkg/interface/src/views/landscape/components/GroupsPane.tsx +++ b/pkg/interface/src/views/landscape/components/GroupsPane.tsx @@ -39,6 +39,7 @@ export function GroupsPane(props: GroupsPaneProps) { const groupPath = getGroupFromWorkspace(workspace); const groupContacts = (groupPath && contacts[groupPath]) || undefined; + const rootIdentity = contacts?.["/~/default"]?.[window.ship]; const groupAssociation = (groupPath && associations.contacts[groupPath]) || undefined; const group = (groupPath && groups[groupPath]) || undefined; @@ -62,6 +63,7 @@ export function GroupsPane(props: GroupsPaneProps) { ( <> {groupPath && ( { return ( `${props.baseUrl}/popover${url}`; @@ -142,6 +142,7 @@ export function PopoverRoutes( {view === "profile" && (