Files
formbricks/apps/web/components/preview/Progress.tsx
Johannes 4bfaf68de2 Smoothen Progressbar animations and minor survey editor improvements (#339)
* auto focus on sign up

* update PR template

* add updatedAt date to survey summary

* add animation to Progress, make timer smoother

* change button size in question card, auto focus

* add transition to js widget, fix auto focus in editor

---------

Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
2023-06-09 10:31:22 +02:00

21 lines
655 B
TypeScript

import React from "react";
const ProgressComponent = ({ progress, brandColor }) => {
return (
<div className="h-1 w-full rounded-full bg-slate-200">
<div
className="transition-width h-1 rounded-full duration-500"
style={{ backgroundColor: brandColor, width: `${Math.floor(progress * 100)}%` }}></div>
</div>
);
};
ProgressComponent.displayName = "Progress";
const Progress = React.memo(ProgressComponent, (prevProps, nextProps) => {
// Only re-render if progress or brandColor changes
return prevProps.progress === nextProps.progress && prevProps.brandColor === nextProps.brandColor;
});
export default Progress;