void;
+ mode?: "positive" | "negative";
+}
+
+function ArrowButton({ children, onClick }: PropsWithChildren<{ onClick: () => void }>) {
+ const [fireInterval, setFireInterval] = useState(false);
+
+ useInterval(() => onClick(), fireInterval ? 300 : null);
+
+ return (
+
{
+ setFireInterval(false);
+ onClick();
+ }}
+ onMouseDown={() => setFireInterval(true)}
+ >
+ {children}
+
+ );
+}
+
+export function InputVote({ value, setValue, mode = "positive" }: Props) {
+ const mouseDownInitiatedRef = useRef(false);
+
+ const [startPosition, setStartPosition] = useState(0);
+ const [originalValue, setOriginalValue] = useState(0);
+
+ useEffect(() => {
+ if (value < 0) {
+ setValue(0);
+ } else if (value > 100) {
+ setValue(100);
+ } else {
+ setValue(value);
+ }
+ }, [value]);
+
+ const onTouchMove = (e: TouchEvent) => {
+ const touch = e.touches.item(0);
+ if (touch) {
+ const diff = Math.max(-200, Math.min(200, touch.clientX - startPosition));
+ setValue(Math.min(100, Math.max(0, originalValue + diff)));
+ }
+ };
+
+ const onMouseMove = (e: MouseEvent) => {
+ if (mouseDownInitiatedRef.current) {
+ const diff = Math.max(-200, Math.min(200, e.clientX - startPosition));
+ setValue(Math.min(100, Math.max(0, originalValue + diff)));
+ }
+ };
+
+ return (
+
{
+ setStartPosition(e.touches.item(0)?.clientX);
+ setOriginalValue(value);
+ document.body.classList.add("overflow-hidden");
+ }}
+ onTouchMove={onTouchMove}
+ onTouchEnd={() => document.body.classList.remove("overflow-hidden")}
+ onMouseDown={(e) => {
+ mouseDownInitiatedRef.current = true;
+ setStartPosition(e.clientX);
+ setOriginalValue(value);
+ }}
+ onMouseMove={onMouseMove}
+ onMouseUp={(e) => (mouseDownInitiatedRef.current = false)}
+ >
+
+ setValue(+e.target.value)}
+ />
+
+
+
+
+
+
setValue(value + 0.1)}>
+
+
+
setValue(value - 0.1)}>
+
+
+
+
+ );
+}
diff --git a/src/common/pages/onboard.tsx b/src/common/pages/onboard.tsx
index dc400d501bb..4388c2b5987 100644
--- a/src/common/pages/onboard.tsx
+++ b/src/common/pages/onboard.tsx
@@ -717,8 +717,8 @@ const Onboard = (props: Props) => {
}}
/>
- {_t("onboard.rc-to-new-acc")} {decodedInfo && decodedInfo!.username}{" "}
- {_t("onboard.minimum-rc")}
+ {_t("onboard.rc-to-new-acc")} {decodedInfo && decodedInfo!.username}{" "}
+ {_t("onboard.minimum-rc")}
{isChecked && (
@@ -737,10 +737,18 @@ const Onboard = (props: Props) => {
/>