Skip to content

Commit 11d2034

Browse files
committed
fix(mobile): trim whitespace in entry title and description
- Trim whitespace from entry title in EntryTitle component - Conditionally render entry title in EntryNormalItem with trimmed text - Ensure clean and consistent text display in entry list and details Signed-off-by: Innei <tukon479@gmail.com>
1 parent 1c5ffd3 commit 11d2034

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

apps/mobile/src/modules/context-menu/entry.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const EntryItemContextMenu = ({ id, children }: PropsWithChildren<{ id: s
4141
<PortalHost>
4242
<View className="bg-system-background flex-1">
4343
<Text className="text-label mt-5 p-4 text-2xl font-semibold" numberOfLines={2}>
44-
{entry.title}
44+
{entry.title?.trim()}
4545
</Text>
4646
<EntryContentWebView entry={entry} />
4747
</View>

apps/mobile/src/modules/entry-content/EntryTitle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export const EntryTitle = ({ title, entryId }: { title: string; entryId: string
106106
setTitleHeight(titleHeight)
107107
}}
108108
>
109-
<Text className="text-label px-4 text-4xl font-bold leading-snug">{title}</Text>
109+
<Text className="text-label px-4 text-4xl font-bold leading-snug">{title.trim()}</Text>
110110
</View>
111111
</>
112112
)

apps/mobile/src/modules/entry-list/templates/EntryNormalItem.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ export function EntryNormalItem({ entryId, extraData }: { entryId: string; extra
8686
postfixText="ago"
8787
/>
8888
</View>
89-
<Text numberOfLines={2} className="text-label text-lg font-semibold">
90-
{title}
91-
</Text>
89+
{!!title && (
90+
<Text numberOfLines={2} className="text-label text-lg font-semibold">
91+
{title.trim()}
92+
</Text>
93+
)}
9294
{view !== FeedViewType.Notifications && !!description && (
9395
<Text numberOfLines={2} className="text-secondary-label text-sm">
9496
{description}

0 commit comments

Comments
 (0)