Y
Y
Young_nigilist2021-05-17 13:05:32
JavaScript
Young_nigilist, 2021-05-17 13:05:32

Is there a ready solution for ReactJS organization runtime?

I need to add a restaurant with information about it, including opening hours. I made a very simple one:
60a23f4649272743920299.png

<Table bordered size="sm">
          <tbody>
            <tr
              className={
                workedMonday ? "text-center" : "text-center my-bg_secondary"
              }
            >
              <th>
                <Form.Group controlId="">
                  <Form.Check
                    type="checkbox"
                    defaultChecked={workedMonday}
                    onClick={() => setWorkedMonday(!workedMonday)}
                  />
                </Form.Group>
              </th>
              <th>Monday</th>
              <th>
                <input
                  type="time"
                  value={mondayStart}
                  onChange={(e) => {
                    setMondayStart(e.target.value);
                    setBusinessWork((businessWork) => [
                      ...businessWork,
                      { mondayStart: e.target.value },
                    ]);
                  }}
                  disabled={!workedMonday}
                />
              </th>
              <th>
                <input
                  type="time"
                  value={mondayEnd}
                  onChange={(e) => {
                    setMondayEnd(e.target.value);
                    setBusinessWork((businessWork) => [
                      ...businessWork,
                      { mondayEnd: e.target.value },
                    ]);
                  }}
                  disabled={!workedMonday}
                />
              </th>
            </tr>
            ...
          </tbody>
        </Table>

But it doesn't look very good, and neither does the logic. I could not find a ready-made component, maybe there is one? Or how can one change it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question