Skip to content
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

Added customizable height and width style options to root. #1702

Merged
merged 1 commit into from
Feb 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- `component`: Allow font family and adaptive cards text color to be set via styleOptions, by [@a-b-r-o-w-n](https://github.com/a-b-r-o-w-n), in PR [#1670](https://github.com/Microsoft/BotFramework-WebChat/pull/1670)
- `component`: Add fallback logic to browser which do not support `window.Intl`, by [@compulim](https://github.com/compulim), in PR [#1696](https://github.com/Microsoft/BotFramework-WebChat/pull/1696)
- `*`: Added `username` back to activity, fixed [#1321](https://github.com/Microsoft/BotFramework-WebChat/issues/1321), by [@compulim](https://github.com/compulim), in PR [#1682](https://github.com/Microsoft/BotFramework-DirectLineJS/pull/1682)
- `component`: Allow root component height & width customization via `styleOptions.rootHeight` and `styleOptions.rootWidth`, by [@tonyanziano](https://github.com/tonyanziano), in PR [#1702](https://github.com/Microsoft/BotFramework-WebChat/pull/1702)

### Changed
- Moved `botAvatarImage` and `userAvatarImage` to `styleOptions.botAvatarImage` and `styleOptions.userAvatarImage` respectively, in PR [#1486](https://github.com/Microsoft/BotFramework-WebChat/pull/1486)
Expand Down
10 changes: 8 additions & 2 deletions packages/component/src/Styles/StyleSet/Root.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
export default function ({ backgroundColor }) {
export default function ({
backgroundColor,
rootHeight,
rootWidth
}) {
return {
backgroundColor
backgroundColor,
height: rootHeight,
width: rootWidth
};
}
4 changes: 4 additions & 0 deletions packages/component/src/Styles/defaultStyleSetOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ const DEFAULT_OPTIONS = {
bubbleMinWidth: 250, // min screen width = 300px, Edge requires 372px (https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/13621468/)
bubbleTextColor: 'Black',

// Root
rootHeight: '100%',
rootWidth: '100%',

// Send box
hideSendBox: false,
hideUploadButton: false,
Expand Down
2 changes: 1 addition & 1 deletion samples/01.a.getting-started-full-bundle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Finally, add desired styling.
+ html, body { height: 100% }
+ body { margin: 0 }

+ #webchat, #webchat > * {
+ #webchat {
+ height: 100%;
+ width: 100%;
+ }
Expand Down
3 changes: 1 addition & 2 deletions samples/01.a.getting-started-full-bundle/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
html, body { height: 100% }
body { margin: 0 }

#webchat,
#webchat > * {
#webchat {
height: 100%;
width: 100%;
}
Expand Down