Skip to content

Commit

Permalink
feat(gql): conversations message pagination
Browse files Browse the repository at this point in the history
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
  • Loading branch information
90dy committed Oct 29, 2018
1 parent 5cac515 commit ffcb02c
Show file tree
Hide file tree
Showing 49 changed files with 1,062 additions and 588 deletions.
5 changes: 3 additions & 2 deletions .stickler.yml
Expand Up @@ -3,8 +3,9 @@ linters:
fixer: false
shellcheck:
shell: bash
eslint:
config: './client/react-native/.eslintrc'
# eslint:
# config: './client/react-native/.eslintrc'
# install_plugins: true
swiftlint: { }
files:
ignore:
Expand Down
1 change: 0 additions & 1 deletion client/react-native/common/components/Library/Header.js
Expand Up @@ -74,7 +74,6 @@ export default class Header extends PureComponent {
left
large
color={colorText}
ellipsis
justify={backBtn ? 'center' : 'start'}
middle
size={5}
Expand Down
4 changes: 2 additions & 2 deletions client/react-native/common/components/Library/ListItem.js
Expand Up @@ -33,10 +33,10 @@ export default class ListItem extends PureComponent {
justify='center'
style={[marginLeft]}
>
<Text color={colors.black} left middle ellipsis>
<Text color={colors.black} left middle>
{title}
</Text>
<Text color={colors.subtleGrey} tiny middle left ellipsis>
<Text color={colors.subtleGrey} tiny middle left>
{subtitle}
</Text>
</Flex.Rows>
Expand Down
5 changes: 2 additions & 3 deletions client/react-native/common/components/Library/Menu.js
Expand Up @@ -23,11 +23,11 @@ export default class Menu extends Component {
justify='between'
style={[paddingLeft, { height: 42 }]}
>
<Text medium color={colors.black} ellipsis>
<Text medium color={colors.black}>
{title}
</Text>
{description && (
<Text tiny color={colors.subtleGrey} ellipsis>
<Text tiny color={colors.subtleGrey}>
{description}
</Text>
)}
Expand Down Expand Up @@ -113,7 +113,6 @@ export default class Menu extends Component {
color={color || colors.textBlack}
align='center'
bold={boldLeft ? true : null}
ellipsis
>
{title}
</Text>
Expand Down
30 changes: 23 additions & 7 deletions client/react-native/common/components/Library/Text.js
Expand Up @@ -216,10 +216,23 @@ const getMargin = (
}
}

const getHeight = props =>
StyleSheet.create({
height: { height: props.height, lineHeight: props.height },
const getHeight = props => {
let { multiline, height, lineHeight } = props

if (!height && !lineHeight) {
return null
} else if (!lineHeight && typeof multiline === 'number') {
lineHeight = height / multiline
} else if (!lineHeight && !multiline) {
lineHeight = height
}
return StyleSheet.create({
height: {
height,
lineHeight,
},
}).height
}

export class BackgroundText extends PureComponent {
static styles = {}
Expand Down Expand Up @@ -330,7 +343,8 @@ export class ForegroundText extends PureComponent {
}

render () {
const { icon, input, children, ellipsis, onSubmit } = this.props
const { icon, input, children, multiline, onSubmit } = this.props
const numberOfLines = typeof multiline === 'number' ? multiline : undefined

const styles = ForegroundText.getStyles(this.props)
return (
Expand All @@ -347,13 +361,15 @@ export class ForegroundText extends PureComponent {
placeholder={children || input.placeholder}
placeholderTextColor={colors.subtleGrey}
onSubmitEditing={onSubmit}
multiline={!!multiline}
numberOfLines={numberOfLines}
/>
) : (
<TextNative
className={ellipsis ? 'textEllipsis' : 'textBreak'}
className={multiline ? 'textBreak' : 'textEllipsis'}
style={styles.text}
ellipsizeMode={ellipsis && 'tail'}
numberOfLines={ellipsis && 1}
ellipsizeMode={!multiline && 'tail'}
numberOfLines={numberOfLines}
>
{children}
</TextNative>
Expand Down

0 comments on commit ffcb02c

Please sign in to comment.