Skip to content

Commit

Permalink
fix(surveys): fix old surveys border color bug (#17783)
Browse files Browse the repository at this point in the history
  • Loading branch information
liyiy authored Oct 4, 2023
1 parent b87d907 commit 6066aec
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions frontend/src/scenes/surveys/SurveyAppearance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export function SurveyAppearance({
/>
<div className="mt-2">Border color</div>
<LemonInput
value={appearance?.borderColor}
value={appearance?.borderColor || defaultSurveyAppearance.borderColor}
onChange={(borderColor) => onAppearanceChange({ ...appearance, borderColor })}
/>
{featureFlags[FEATURE_FLAGS.SURVEYS_POSITIONS] && (
Expand Down Expand Up @@ -255,12 +255,15 @@ function BaseAppearance({
className="survey-form"
style={{
backgroundColor: appearance.backgroundColor,
border: `1.5px solid ${appearance.borderColor}`,
border: `1.5px solid ${appearance.borderColor || defaultSurveyAppearance.borderColor}`,
color: textColor,
}}
>
<div className="survey-box">
<div style={{ border: `1.5px solid ${appearance.borderColor}` }} className="cancel-btn-wrapper">
<div
style={{ border: `1.5px solid ${appearance.borderColor || defaultSurveyAppearance.borderColor}` }}
className="cancel-btn-wrapper"
>
<button className="form-cancel" type="button">
{cancel}
</button>
Expand All @@ -270,7 +273,9 @@ function BaseAppearance({
{description && <div className="description">{description}</div>}
{type === SurveyQuestionType.Open && (
<textarea
style={{ border: `1px solid ${appearance.borderColor}` }}
style={{
border: `1px solid ${appearance.borderColor || defaultSurveyAppearance.borderColor}`,
}}
className="survey-textarea"
name="survey"
rows={4}
Expand Down Expand Up @@ -325,7 +330,7 @@ const RatingButton = ({
style={{
color: textColor,
backgroundColor: active ? appearance.ratingButtonActiveColor : appearance.ratingButtonColor,
borderColor: appearance.borderColor,
borderColor: appearance.borderColor || defaultSurveyAppearance.borderColor,
}}
>
{num}
Expand All @@ -344,7 +349,7 @@ const NumberRating = ({
return (
<div
style={{
border: `1.5px solid ${appearance.borderColor}`,
border: `1.5px solid ${appearance.borderColor || defaultSurveyAppearance.borderColor}`,
gridTemplateColumns: `repeat(${ratingSurveyQuestion.scale}, minmax(0, 1fr))`,
}}
className={`rating-options-buttons ${ratingSurveyQuestion.scale === 5 ? '' : 'max-numbers'}`}
Expand Down Expand Up @@ -425,12 +430,15 @@ function SurveyRatingAppearance({
className="survey-form"
style={{
backgroundColor: appearance.backgroundColor,
border: `1.5px solid ${appearance.borderColor}`,
border: `1.5px solid ${appearance.borderColor || defaultSurveyAppearance.borderColor}`,
color: textColor,
}}
>
<div className="survey-box">
<div style={{ border: `1.5px solid ${appearance.borderColor}` }} className="cancel-btn-wrapper">
<div
style={{ border: `1.5px solid ${appearance.borderColor || defaultSurveyAppearance.borderColor}` }}
className="cancel-btn-wrapper"
>
<button className="form-cancel" type="button">
{cancel}
</button>
Expand Down Expand Up @@ -498,12 +506,15 @@ function SurveyMultipleChoiceAppearance({
className="survey-form"
style={{
backgroundColor: appearance.backgroundColor,
border: `1.5px solid ${appearance.borderColor}`,
border: `1.5px solid ${appearance.borderColor || defaultSurveyAppearance.borderColor}`,
color: textColor,
}}
>
<div className="survey-box">
<div style={{ border: `1.5px solid ${appearance.borderColor}` }} className="cancel-btn-wrapper">
<div
style={{ border: `1.5px solid ${appearance.borderColor || defaultSurveyAppearance.borderColor}` }}
className="cancel-btn-wrapper"
>
<button className="form-cancel" type="button">
{cancel}
</button>
Expand Down Expand Up @@ -559,12 +570,15 @@ function SurveyThankYou({
className="thank-you-message"
style={{
backgroundColor: appearance.backgroundColor,
border: `1.5px solid ${appearance.borderColor}`,
border: `1.5px solid ${appearance.borderColor || defaultSurveyAppearance.borderColor}`,
color: textColor,
}}
>
<div className="thank-you-message-container">
<div style={{ border: `1.5px solid ${appearance.borderColor}` }} className="cancel-btn-wrapper">
<div
style={{ border: `1.5px solid ${appearance.borderColor || defaultSurveyAppearance.borderColor}` }}
className="cancel-btn-wrapper"
>
<button className="form-cancel" type="button" onClick={() => setShowThankYou(false)}>
{cancel}
</button>
Expand Down

0 comments on commit 6066aec

Please sign in to comment.