daily log 8.26.20

less than 1 minute read

OH MY GOODNESS IT MIGHT BE FINALLY CLICKING

import React from "react";
import { useState, useEffect } from "react";
import "./styles.css";

// let initialState = {
//   runtime: 1,
//   shareDelay: {
//     minBetweenShare: 1,
//     maxBetweenShare: 3
//   },
//   shareAll: {
//     times: 1,
//     minBetweenLoops: 5
//   },
//   groupItems: {
//     shareInGroups: false,
//     itemsPerGroup: 6,
//     minBetweenGroups: 3
//   }
// };

export default function App() {
  const [runtime, updateRuntime] = useState(1);
  const [shareMin, updateShareMin] = useState(1);
  const [shareMax, updateShareMax] = useState(3);

  useEffect(() => {
    console.log("here");
    updateRuntime(shareMax);
  }, [shareMin, shareMax]);

  return (
    <div className="App">
      <h1>Sharing Options</h1>
      <div>Runtime | {runtime}</div>
      <h2>Share Delay</h2>
      <div>
        Share delay min | {shareMin}
        <button onClick={() => updateShareMin(shareMin + 1)}>+</button>
      </div>
      <div>
        Share delay max | {shareMax}
        <button onClick={() => updateShareMax(shareMax + 1)}>+</button>
      </div>
    </div>
  );
}