From 5eddbcea16e18afa6cc8076fd33843f76a549a91 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Fri, 30 Dec 2022 15:32:07 -0600 Subject: Various small fixes --- src/lib/strings.ts | 4 ++-- src/view/com/discover/SuggestedFollows.tsx | 4 +++- src/view/com/login/CreateAccount.tsx | 2 +- src/view/com/util/Link.tsx | 2 +- src/view/screens/Search.tsx | 2 +- src/view/shell/mobile/Menu.tsx | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/lib/strings.ts b/src/lib/strings.ts index b13ac39e5..1bbb4afd4 100644 --- a/src/lib/strings.ts +++ b/src/lib/strings.ts @@ -185,8 +185,8 @@ export function makeValidHandle(str: string): string { } export function createFullHandle(name: string, domain: string): string { - name = name.replace(/[\.]+$/, '') - domain = domain.replace(/^[\.]+/, '') + name = (name || '').replace(/[\.]+$/, '') + domain = (domain || '').replace(/^[\.]+/, '') return `${name}.${domain}` } diff --git a/src/view/com/discover/SuggestedFollows.tsx b/src/view/com/discover/SuggestedFollows.tsx index 5d01a300d..24926df69 100644 --- a/src/view/com/discover/SuggestedFollows.tsx +++ b/src/view/com/discover/SuggestedFollows.tsx @@ -167,7 +167,9 @@ const User = ({ {follow ? ( onPressUnfollow(item)}> - Unfollow + + Unfollow + ) : ( diff --git a/src/view/com/login/CreateAccount.tsx b/src/view/com/login/CreateAccount.tsx index 689a4f384..e6ce2efa6 100644 --- a/src/view/com/login/CreateAccount.tsx +++ b/src/view/com/login/CreateAccount.tsx @@ -288,7 +288,7 @@ export const CreateAccount = ({onPressBack}: {onPressBack: () => void}) => { Your full username will be{' '} - + @{createFullHandle(handle, userDomain)} diff --git a/src/view/com/util/Link.tsx b/src/view/com/util/Link.tsx index 05573d999..1e7b90506 100644 --- a/src/view/com/util/Link.tsx +++ b/src/view/com/util/Link.tsx @@ -63,7 +63,7 @@ export const TextLink = observer(function Link({ href, text, }: { - type: TypographyVariant + type?: TypographyVariant style?: StyleProp href: string text: string diff --git a/src/view/screens/Search.tsx b/src/view/screens/Search.tsx index 995d05861..d9d933b7e 100644 --- a/src/view/screens/Search.tsx +++ b/src/view/screens/Search.tsx @@ -59,7 +59,7 @@ export const Search = ({navIdx, visible, params}: ScreenParams) => { - {store.me.displayName} + {store.me.displayName || store.me.handle}