From a9edb982f57cd5ed6676986bcf06555d150a28ab Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Thu, 22 Jul 2021 15:59:28 +0200 Subject: exchanged collision tweak with new component --- pages/index.tsx | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) (limited to 'pages') diff --git a/pages/index.tsx b/pages/index.tsx index d39a153..70bb568 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -335,26 +335,17 @@ export const Tweaks = function (props: TweakProps) { onChange={(value) => setPhysics({ ...physics, charge: -100 * value })} label="Repulsive Force" /> - - - - Collision - - - setPhysics({ ...physics, collision: !physics.collision })} - isChecked={physics.collision} - /> - - {physics.collision && ( - setPhysics({ ...physics, collisionStrength: value / 10 })} - label="Strength" - /> - )} - + setPhysics({ ...physics, collisionStrength: value / 10 })} + label="Strength" + enableLabel="Collision" + enableInfoText="Perfomance sap, disable if slow" + enableValue={physics.collision} + onEnableValueChange={() => + setPhysics({ ...physics, collision: !physics.collision }) + } + /> setPhysics({ ...physics, linkStrength: value / 5 })} -- cgit v1.2.3