From 1ce98d016e3f65724f67c0475253c0d04b324d2f Mon Sep 17 00:00:00 2001 From: Rui Ying Date: Sun, 5 May 2019 03:14:06 +0800 Subject: [PATCH] Use ellipsizeMode `tail` for Board --- src/components/AssignmentBoard.tsx | 2 ++ src/components/NoticeBoard.tsx | 1 + src/components/TextButton.tsx | 5 +++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/AssignmentBoard.tsx b/src/components/AssignmentBoard.tsx index 1b1723ce..40cdce4b 100644 --- a/src/components/AssignmentBoard.tsx +++ b/src/components/AssignmentBoard.tsx @@ -112,6 +112,7 @@ const AssignmentBoard: FunctionComponent< getExtension(attachmentName)! ) } + ellipsizeMode="tail" > {attachmentName} @@ -139,6 +140,7 @@ const AssignmentBoard: FunctionComponent< getExtension(submittedAttachmentName)! ) } + ellipsizeMode="tail" > {submittedAttachmentName} diff --git a/src/components/NoticeBoard.tsx b/src/components/NoticeBoard.tsx index f29254c4..d9fde964 100644 --- a/src/components/NoticeBoard.tsx +++ b/src/components/NoticeBoard.tsx @@ -102,6 +102,7 @@ const NoticeBoard: FunctionComponent< getExtension(attachmentName)! ) } + ellipsizeMode="tail" > {attachmentName} diff --git a/src/components/TextButton.tsx b/src/components/TextButton.tsx index 4bae0030..7eaa6a21 100644 --- a/src/components/TextButton.tsx +++ b/src/components/TextButton.tsx @@ -11,11 +11,12 @@ import Colors from "../constants/Colors"; export type ITextButtonProps = TouchableOpacityProps & { readonly textStyle?: TextProps["style"]; readonly children: string; + readonly ellipsizeMode?: TextProps["ellipsizeMode"]; }; class TextButton extends React.Component { public render(): React.ReactElement { - const { textStyle, children } = this.props; + const { textStyle, children, ellipsizeMode } = this.props; return ( { textStyle ]} numberOfLines={1} - ellipsizeMode="clip" + ellipsizeMode={ellipsizeMode || "clip"} > {children}