|
1 |
| -import { React, useContext, useEffect, useState } from "react"; |
| 1 | +import { useContext, useEffect, useState } from "react"; |
2 | 2 | import { Button, Form, Spinner, Alert, Col, Row } from "react-bootstrap";
|
3 | 3 | import { useTranslation } from "react-i18next";
|
4 | 4 | import { useNavigate } from "react-router-dom";
|
5 |
| -import PropTypes from "prop-types"; |
6 | 5 | import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
7 | 6 | import { faExpand } from "@fortawesome/free-solid-svg-icons";
|
8 | 7 | import ContentBody from "../util/content-body/content-body";
|
@@ -31,15 +30,15 @@ import { displayError } from "../util/list/toast-component/display-toast";
|
31 | 30 | * @param {object} props The props.
|
32 | 31 | * @param {object} props.screen Screen The screen object to modify in the form.
|
33 | 32 | * @param {Function} props.handleInput HandleInput Handles form input.
|
34 |
| - * @param {Function} props.handleSubmit HandleSubmit Handles form submit. |
35 | 33 | * @param {string} props.headerText HeaderText Headline text.
|
36 | 34 | * @param {string} props.groupId The group id.
|
37 | 35 | * @param {boolean} props.isLoading Indicator of whether the form is loading
|
38 | 36 | * @param {string} props.loadingMessage The loading message for the spinner
|
39 | 37 | * @param {object} props.orientationOptions The options for the orientation dropdown
|
40 | 38 | * @param {object} props.resolutionOptions The options for the resolution dropdown
|
41 |
| - * @param props.handleSubmitWithoutRedirect |
42 |
| - * @param props.handleSubmitWithRedirect |
| 39 | + * @param {Function} props.handleSubmitWithoutRedirect Handles form submit |
| 40 | + * without redirect. |
| 41 | + * @param {Function} props.handleSubmitWithRedirect Handles form submit with redirect. |
43 | 42 | * @returns {object} The screen form.
|
44 | 43 | */
|
45 | 44 | function ScreenForm({
|
@@ -87,7 +86,7 @@ function ScreenForm({
|
87 | 86 | /**
|
88 | 87 | * Check if published is set
|
89 | 88 | *
|
90 |
| - * @param redirect |
| 89 | + * @param {boolean} redirect Whether to redirect after submit |
91 | 90 | */
|
92 | 91 | const checkInputsHandleSubmit = (redirect) => {
|
93 | 92 | setLayoutError(false);
|
@@ -416,40 +415,4 @@ function ScreenForm({
|
416 | 415 | );
|
417 | 416 | }
|
418 | 417 |
|
419 |
| -ScreenForm.propTypes = { |
420 |
| - screen: PropTypes.shape({ |
421 |
| - resolution: PropTypes.string, |
422 |
| - "@id": PropTypes.string, |
423 |
| - description: PropTypes.string, |
424 |
| - orientation: PropTypes.string, |
425 |
| - enableColorSchemeChange: PropTypes.bool, |
426 |
| - layout: PropTypes.string, |
427 |
| - location: PropTypes.string, |
428 |
| - regions: PropTypes.arrayOf( |
429 |
| - PropTypes.shape({ |
430 |
| - "@id": PropTypes.string, |
431 |
| - }) |
432 |
| - ), |
433 |
| - screenUser: PropTypes.string, |
434 |
| - size: PropTypes.string, |
435 |
| - title: PropTypes.string, |
436 |
| - status: PropTypes.shape({}), |
437 |
| - playlists: PropTypes.arrayOf( |
438 |
| - PropTypes.shape({ name: PropTypes.string, id: PropTypes.number }) |
439 |
| - ), |
440 |
| - }), |
441 |
| - handleInput: PropTypes.func.isRequired, |
442 |
| - handleSubmit: PropTypes.func.isRequired, |
443 |
| - headerText: PropTypes.string.isRequired, |
444 |
| - groupId: PropTypes.string, |
445 |
| - isLoading: PropTypes.bool, |
446 |
| - loadingMessage: PropTypes.string, |
447 |
| - orientationOptions: PropTypes.arrayOf( |
448 |
| - PropTypes.shape({ title: PropTypes.string, id: PropTypes.string }) |
449 |
| - ).isRequired, |
450 |
| - resolutionOptions: PropTypes.arrayOf( |
451 |
| - PropTypes.shape({ title: PropTypes.string, id: PropTypes.string }) |
452 |
| - ).isRequired, |
453 |
| -}; |
454 |
| - |
455 | 418 | export default ScreenForm;
|
0 commit comments