💄 Improve progress bar UI and make avoid starting at 0

This commit is contained in:
Baptiste Arnaud
2024-02-27 14:22:46 +01:00
parent 0b193101b9
commit 229453d3d3
12 changed files with 86 additions and 61 deletions

View File

@@ -22,7 +22,7 @@ const cssVariableNames = {
progressBar: {
position: '--typebot-progress-bar-position',
color: '--typebot-progress-bar-color',
backgroundColor: '--typebot-progress-bar-bg-color',
colorRgb: '--typebot-progress-bar-color-rgb',
height: '--typebot-progress-bar-height',
top: '--typebot-progress-bar-top',
bottom: '--typebot-progress-bar-bottom',
@@ -110,9 +110,11 @@ const setProgressBar = (
progressBar.color ?? defaultTheme.general.progressBar.color
)
documentStyle.setProperty(
cssVariableNames.general.progressBar.backgroundColor,
progressBar.backgroundColor ??
defaultTheme.general.progressBar.backgroundColor
cssVariableNames.general.progressBar.colorRgb,
hexToRgb(
progressBar.backgroundColor ??
defaultTheme.general.progressBar.backgroundColor
).join(', ')
)
documentStyle.setProperty(
cssVariableNames.general.progressBar.height,
@@ -254,7 +256,6 @@ const setTypebotBackground = (
}
const parseBackgroundValue = ({ type, content }: Background = {}) => {
console.log('parseBackgroundValue', type, content)
switch (type) {
case BackgroundType.NONE:
return 'transparent'