Skip to content
This repository has been archived by the owner on Feb 8, 2020. It is now read-only.

Commit

Permalink
fix: add horizontal margin to centered title
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Nov 2, 2019
1 parent 74ee216 commit 2ef5ad4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 3 additions & 4 deletions packages/stack/src/views/Header/HeaderSegment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,9 @@ export default class HeaderSegment extends React.Component<Props, State> {
<Animated.View
pointerEvents="box-none"
style={[
headerTitleAlign === 'left' && {
position: 'absolute',
left: leftButton ? 72 : 16,
},
headerTitleAlign === 'left'
? { position: 'absolute', left: leftButton ? 72 : 16 }
: { marginHorizontal: 18 },
titleStyle,
titleContainerStyle,
]}
Expand Down
4 changes: 3 additions & 1 deletion packages/stack/src/views/Header/HeaderTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ type Props = TextProps & {
};

export default function HeaderTitle({ style, ...rest }: Props) {
return <Animated.Text {...rest} style={[styles.title, style]} />;
return (
<Animated.Text numberOfLines={1} {...rest} style={[styles.title, style]} />
);
}

const styles = StyleSheet.create({
Expand Down

0 comments on commit 2ef5ad4

Please sign in to comment.