From f508cd923eb0ce1933d5f5e21488b8d521ecfdf2 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Fri, 5 Feb 2021 09:07:28 +1000 Subject: [PATCH 1/4] interface: truncate group title --- .../src/views/landscape/components/GroupSwitcher.tsx | 6 ++---- pkg/interface/src/views/landscape/components/Skeleton.tsx | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/interface/src/views/landscape/components/GroupSwitcher.tsx b/pkg/interface/src/views/landscape/components/GroupSwitcher.tsx index 00156f17f..fd9e4d549 100644 --- a/pkg/interface/src/views/landscape/components/GroupSwitcher.tsx +++ b/pkg/interface/src/views/landscape/components/GroupSwitcher.tsx @@ -167,11 +167,9 @@ export function GroupSwitcher(props: { } > - { metadata && } - - {title} + { metadata && } + {title} - {(workspace.type === 'group') && ( diff --git a/pkg/interface/src/views/landscape/components/Skeleton.tsx b/pkg/interface/src/views/landscape/components/Skeleton.tsx index 3027e41ec..9b494a2d0 100644 --- a/pkg/interface/src/views/landscape/components/Skeleton.tsx +++ b/pkg/interface/src/views/landscape/components/Skeleton.tsx @@ -48,7 +48,9 @@ export function Skeleton(props: SkeletonProps) { return ( Date: Fri, 5 Feb 2021 09:23:18 +1000 Subject: [PATCH 2/4] interface: stop propagation reshowing modal --- pkg/interface/src/logic/lib/useModal.tsx | 4 ++-- pkg/interface/src/logic/reducers/contact-update.ts | 1 - pkg/interface/src/views/apps/chat/ChatResource.tsx | 1 - .../src/views/landscape/components/DeleteGroup.tsx | 12 +++++++++--- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/pkg/interface/src/logic/lib/useModal.tsx b/pkg/interface/src/logic/lib/useModal.tsx index 982ed5fbd..92a209a02 100644 --- a/pkg/interface/src/logic/lib/useModal.tsx +++ b/pkg/interface/src/logic/lib/useModal.tsx @@ -28,11 +28,11 @@ export function useModal(props: UseModalProps): UseModalResult { const dismiss = useCallback(() => { setModalShown(false); - }, [setModalShown]); + }, []); const showModal = useCallback(() => { setModalShown(true); - }, [setModalShown]); + }, []); const inner = useMemo( () => diff --git a/pkg/interface/src/logic/reducers/contact-update.ts b/pkg/interface/src/logic/reducers/contact-update.ts index 7dd519d08..44cbc6cfb 100644 --- a/pkg/interface/src/logic/reducers/contact-update.ts +++ b/pkg/interface/src/logic/reducers/contact-update.ts @@ -55,7 +55,6 @@ const edit = (json: ContactUpdate, state: S) => { data && (ship in state.contacts) ) { - console.log(data); const [field] = Object.keys(data['edit-field']); if (!field) { return; diff --git a/pkg/interface/src/views/apps/chat/ChatResource.tsx b/pkg/interface/src/views/apps/chat/ChatResource.tsx index 667cc6022..34c512f7c 100644 --- a/pkg/interface/src/views/apps/chat/ChatResource.tsx +++ b/pkg/interface/src/views/apps/chat/ChatResource.tsx @@ -36,7 +36,6 @@ export function ChatResource(props: ChatResourceProps) { const [,, owner, name] = station.split('/'); const ourContact = contacts?.[`~${window.ship}`]; - console.log(contacts); const chatInput = useRef(); diff --git a/pkg/interface/src/views/landscape/components/DeleteGroup.tsx b/pkg/interface/src/views/landscape/components/DeleteGroup.tsx index e539c7c8c..1f51f96be 100644 --- a/pkg/interface/src/views/landscape/components/DeleteGroup.tsx +++ b/pkg/interface/src/views/landscape/components/DeleteGroup.tsx @@ -38,14 +38,19 @@ export function DeleteGroup(props: { const icon = props.owner ? "X" : "SignOut"; const { modal, showModal } = useModal({ modal: - (dismiss: () => void) => ( + (dismiss: () => void) => { + const onCancel = (e) => { + e.stopPropagation(); + dismiss(); + }; + return ( - + - )}); + ); + }}); return ( {modal} From 6eb234b8a7baf094b93e1eab6c187e8cffeb517b Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Fri, 5 Feb 2021 09:27:37 +1000 Subject: [PATCH 3/4] interface: normalize joinGroup modal --- pkg/interface/src/views/landscape/components/JoinGroup.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/interface/src/views/landscape/components/JoinGroup.tsx b/pkg/interface/src/views/landscape/components/JoinGroup.tsx index 704bf1990..0b32ebab8 100644 --- a/pkg/interface/src/views/landscape/components/JoinGroup.tsx +++ b/pkg/interface/src/views/landscape/components/JoinGroup.tsx @@ -127,14 +127,14 @@ export function JoinGroup(props: JoinGroupProps) { return ( <> - + Join a Group {_.isString(preview) ? ( - + The host appears to be offline. Join anyway? Join anyway @@ -175,7 +175,7 @@ export function JoinGroup(props: JoinGroupProps) { ) : ( - + Date: Fri, 5 Feb 2021 09:43:46 +1000 Subject: [PATCH 4/4] interface: add lodash import to prevent crash in NewChannel --- pkg/interface/src/views/landscape/components/NewChannel.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/interface/src/views/landscape/components/NewChannel.tsx b/pkg/interface/src/views/landscape/components/NewChannel.tsx index 95fb4cf15..60673e76f 100644 --- a/pkg/interface/src/views/landscape/components/NewChannel.tsx +++ b/pkg/interface/src/views/landscape/components/NewChannel.tsx @@ -5,6 +5,7 @@ import { Col, Text } from '@tlon/indigo-react'; +import _ from 'lodash'; import { Formik, Form } from 'formik'; import * as Yup from 'yup'; import GlobalApi from '~/logic/api/global';