New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding minComposerHeight and maxComposerHeight props. #1069

Merged
merged 3 commits into from Jan 7, 2019

Conversation

Projects
None yet
2 participants
@nandiniparimi1107
Copy link
Contributor

nandiniparimi1107 commented Jan 6, 2019

Issue

composer max height is currently hardcoded to 200, we will need a prop to customize this.

This is related to issue : #1023

Solution

Adding minComposerHeight and maxComposerHeight props to GiftedChat.

Screenshots/Video for UI/UX Changes

Please refer to issue : #1023 for screenshot.

@nandiniparimi1107

This comment has been minimized.

Copy link
Contributor

nandiniparimi1107 commented Jan 6, 2019

@xcarpentier @mafiusu could you please take a look at this simple PR. there are handful of open issues around composer height and this PR will be very helpful

@codecov

This comment has been minimized.

Copy link

codecov bot commented Jan 6, 2019

Codecov Report

Merging #1069 into master will decrease coverage by 0.16%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1069      +/-   ##
==========================================
- Coverage    43.1%   42.94%   -0.17%     
==========================================
  Files          21       21              
  Lines         515      517       +2     
  Branches      112      114       +2     
==========================================
  Hits          222      222              
  Misses        221      221              
- Partials       72       74       +2
Impacted Files Coverage Δ
src/GiftedChat.js 24.24% <0%> (-0.3%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0cd69b2...2648847. Read the comment docs.

@codecov

This comment has been minimized.

Copy link

codecov bot commented Jan 6, 2019

Codecov Report

Merging #1069 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1069   +/-   ##
======================================
  Coverage    43.1%   43.1%           
======================================
  Files          21      21           
  Lines         515     515           
  Branches      112     112           
======================================
  Hits          222     222           
  Misses        221     221           
  Partials       72      72
Impacted Files Coverage Δ
src/GiftedChat.js 24.53% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0cd69b2...50a5b29. Read the comment docs.

@@ -373,8 +373,16 @@ class GiftedChat extends React.Component {
}

onInputSizeChanged(size) {
const newComposerHeight = Math.max(MIN_COMPOSER_HEIGHT, Math.min(MAX_COMPOSER_HEIGHT, size.height));
const newMessagesContainerHeight = this.getMessagesContainerHeightWithKeyboard(newComposerHeight);
const minComposerHeight = this.props.minComposerHeight

This comment has been minimized.

@xcarpentier

xcarpentier Jan 7, 2019

Collaborator

You set a default props that did the same.
So please just use the props as is without testing if it's present because it's always present. (unless user set it to null but that make no sense, right?)

nandiniparimi1107 added some commits Jan 7, 2019

const newComposerHeight = Math.max(
this.props.minComposerHeight,
Math.min(this.props.maxComposerHeight, size.height),
);

This comment has been minimized.

@nandiniparimi1107

nandiniparimi1107 Jan 7, 2019

Contributor

:)
@xcarpentier Was being extra cautious, but i see your point. updated the code.

@xcarpentier xcarpentier merged commit b7de25f into FaridSafi:master Jan 7, 2019

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
codecov/project 43.1% remains the same compared to 0cd69b2
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@nandiniparimi1107

This comment has been minimized.

Copy link
Contributor

nandiniparimi1107 commented Jan 7, 2019

@xcarpentier are you planning to release a new version this week. Please let me know, i am waiting for the new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment