Skip to content

Commit

Permalink
Merge pull request #407 from xTEddie/prechat-toggle-input-styles
Browse files Browse the repository at this point in the history
PreChatSurveyPane Toggle Input Styles
  • Loading branch information
xTEddie authored Dec 11, 2023
2 parents c167932 + 25fb89f commit 007b9f6
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGE_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

- Add ability to customize `PreChatSurveyPane`'s toggle inputs using `IPreChatSurveyPaneToggleInputStyles` & Use `baseline` by default

### Fixed

- Fixed loading pane icon image fit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ function PreChatSurveyPane(props: IPreChatSurveyPaneProps) {
padding-top: 7px;
padding-bottom: 7px;
}
.ac-pushButton {
.ac-input.ac-toggleInput {
align-items: ${props.styleProps?.customToggleInputStyleProps?.alignItems ?? defaultPreChatSurveyPaneStyles.customToggleInputStyleProps?.alignItems} !important;
}
.ac-pushButton {
border: 1px solid #00000000;
margin: 2px;
height: ${props.styleProps?.customButtonStyleProps?.height ?? defaultPreChatSurveyPaneStyles.customButtonStyleProps?.height};
Expand All @@ -115,7 +118,7 @@ function PreChatSurveyPane(props: IPreChatSurveyPaneProps) {
font-size: ${props.styleProps?.customButtonStyleProps?.fontSize ?? defaultPreChatSurveyPaneStyles.customButtonStyleProps?.fontSize};
font-family: ${props.styleProps?.customButtonStyleProps?.fontFamily ?? defaultPreChatSurveyPaneStyles.customButtonStyleProps?.fontFamily};
color: ${props.styleProps?.customButtonStyleProps?.color ?? defaultPreChatSurveyPaneStyles.customButtonStyleProps?.color};
background-color: ${props.styleProps?.customButtonStyleProps?.backgroundColor ?? defaultPreChatSurveyPaneStyles.customButtonStyleProps?.backgroundColor};
background-color: ${props.styleProps?.customButtonStyleProps?.backgroundColor ?? defaultPreChatSurveyPaneStyles.customButtonStyleProps?.backgroundColor};
}`}</style>
{!props.controlProps?.hidePreChatSurveyPane &&
<Stack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import { defaultPreChatSurveyPaneGeneralStyles } from "./defaultPreChatSurveyPan
import { defaultPreChatSurveyPaneMultilineTextInputStyles } from "./defaultPreChatSurveyPaneMultilineTextInputStyles";
import { defaultPreChatSurveyPaneTextInputStyles } from "./defaultPreChatSurveyPaneTextInputStyles";
import { defaultPreChatSurveyPaneMultichoiceInputStyles } from "./defaultPreChatSurveyPaneMultichoiceInputStyles";
import { defaultPreChatSurveyPaneToggleInputStyles } from "./defaultPreChatSurveyPaneToggleInputStyles";

export const defaultPreChatSurveyPaneStyles: IPreChatSurveyPaneStyleProps = {
generalStyleProps: defaultPreChatSurveyPaneGeneralStyles,
customButtonStyleProps: defaultPreChatSurveyPaneButtonStyles,
adaptiveCardContainerStyleProps: defaultPreChatSurveyPaneACContainerStyles,
customTextInputStyleProps: defaultPreChatSurveyPaneTextInputStyles,
customMultilineTextInputStyleProps: defaultPreChatSurveyPaneMultilineTextInputStyles,
customMultichoiceInputStyleProps: defaultPreChatSurveyPaneMultichoiceInputStyles
customMultichoiceInputStyleProps: defaultPreChatSurveyPaneMultichoiceInputStyles,
customToggleInputStyleProps: defaultPreChatSurveyPaneToggleInputStyles
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { IPreChatSurveyPaneToggleInputStyles } from "../../../interfaces/IPreChatSurveyPaneToggleInputStyles";

export const defaultPreChatSurveyPaneToggleInputStyles: IPreChatSurveyPaneToggleInputStyles = {
alignItems: "baseline"
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { IPreChatSurveyPaneButtonStyles } from "./IPreChatSurveyPaneButtonStyles";
import { IStyle } from "@fluentui/react";
import { IPreChatSurveyPaneElementStyles } from "./IPreChatSurveyPaneElementStyles";
import { IPreChatSurveyPaneToggleInputStyles } from "./IPreChatSurveyPaneToggleInputStyles";

export interface IPreChatSurveyPaneStyleProps {
generalStyleProps?: IStyle;
Expand All @@ -10,4 +11,5 @@ export interface IPreChatSurveyPaneStyleProps {
customTextInputStyleProps?: IPreChatSurveyPaneElementStyles;
customMultilineTextInputStyleProps?: IPreChatSurveyPaneElementStyles;
customMultichoiceInputStyleProps?: IPreChatSurveyPaneElementStyles;
customToggleInputStyleProps?: IPreChatSurveyPaneToggleInputStyles;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface IPreChatSurveyPaneToggleInputStyles {
alignItems?: string;
}
1 change: 1 addition & 0 deletions docs/customizations/prechatsurveypane.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
| customTextInputStyleProps | [IPreChatSurveyPaneElementStyles](../../chat-components/src/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.ts) | No | Styles of the `PreChatSurveyPane` text inputs | [defaultPreChatSurveyPaneTextInputStyles.ts](../../chat-components/src/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.ts) |
| customMultilineTextInputStyleProps | [IPreChatSurveyPaneElementStyles](../../chat-components/src/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.ts) | No | Styles of the `PreChatSurveyPane` multiple text inputs | [defaultPreChatSurveyPaneMultilineTextInputStyles.ts](../../chat-components/src/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.ts) |
| customMultichoiceInputStyleProps | [IPreChatSurveyPaneElementStyles](../../chat-components/src/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.ts) | No | Styles of the `PreChatSurveyPane` multiple choice inputs | [defaultPreChatSurveyPaneMultichoiceInputStyles.ts](../../chat-components/src/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultichoiceInputStyles.ts) |
| customToggleInputStyleProps | [IPreChatSurveyPaneToggleInputStyles](../../chat-components/src/components/prechatsurveypane/interfaces/IPreChatSurveyPaneToggleInputStyles.ts) | No | Styles of the `PreChatSurveyPane` toggle inputs | [defaultPreChatSurveyPaneToggleInputStyles.ts](../../chat-components/src/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneToggleInputStyles.ts) |

## Sample Scenarios

Expand Down

0 comments on commit 007b9f6

Please sign in to comment.