+
{!online &&
}
{online && (
@@ -42,4 +40,4 @@ export default function VideoPoster(props: Props) {
)}
);
-}
+};
diff --git a/web/components/video/settings-menu.ts b/web/components/video/settings-menu.ts
index 43d6b3c58..e611707d2 100644
--- a/web/components/video/settings-menu.ts
+++ b/web/components/video/settings-menu.ts
@@ -1,9 +1,4 @@
-export default function createVideoSettingsMenuButton(
- player,
- videojs,
- qualities,
- latencyItemPressed,
-): any {
+export function createVideoSettingsMenuButton(player, videojs, qualities, latencyItemPressed): any {
const VjsMenuItem = videojs.getComponent('MenuItem');
const MenuItem = videojs.getComponent('MenuItem');
const MenuButtonClass = videojs.getComponent('MenuButton');
@@ -111,3 +106,4 @@ export default function createVideoSettingsMenuButton(
// eslint-disable-next-line consistent-return
return menuButton;
}
+export default createVideoSettingsMenuButton;
diff --git a/web/next.config.js b/web/next.config.js
index 845894579..67e6b46f3 100644
--- a/web/next.config.js
+++ b/web/next.config.js
@@ -35,4 +35,5 @@ module.exports = withLess({
},
];
},
+ pageExtensions: ['.tsx'],
});
diff --git a/web/pages/.eslintrc.js b/web/pages/.eslintrc.js
new file mode 100644
index 000000000..5e639a39c
--- /dev/null
+++ b/web/pages/.eslintrc.js
@@ -0,0 +1,11 @@
+// ESLint rules specific to writing NextJS Pages.
+
+module.exports = {
+ rules: {
+ // We don't care which syntax is used for NextPage definitions.
+ 'react/function-component-definition': 'off',
+
+ // The default export is used by NextJS when rendering pages.
+ 'import/prefer-default-export': 'error',
+ },
+};
diff --git a/web/pages/_app.tsx b/web/pages/_app.tsx
index acb660c3d..bcc77c582 100644
--- a/web/pages/_app.tsx
+++ b/web/pages/_app.tsx
@@ -23,17 +23,17 @@ import '../styles/chat.scss';
import '../styles/pages.scss';
import '../styles/offline-notice.scss';
-import '../components/video/player.scss';
+import '../components/video/VideoJS/VideoJS.scss';
import { AppProps } from 'next/app';
import { Router, useRouter } from 'next/router';
import { RecoilRoot } from 'recoil';
import { useEffect } from 'react';
-import AdminLayout from '../components/layouts/admin-layout';
-import SimpleLayout from '../components/layouts/SimpleLayout';
+import { AdminLayout } from '../components/layouts/AdminLayout';
+import { SimpleLayout } from '../components/layouts/SimpleLayout';
-function App({ Component, pageProps }: AppProps) {
+const App = ({ Component, pageProps }: AppProps) => {
useEffect(() => {
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
@@ -61,6 +61,6 @@ function App({ Component, pageProps }: AppProps) {
);
-}
+};
export default App;
diff --git a/web/pages/admin/access-tokens.tsx b/web/pages/admin/access-tokens.tsx
index 8c4d719bf..48924762b 100644
--- a/web/pages/admin/access-tokens.tsx
+++ b/web/pages/admin/access-tokens.tsx
@@ -62,7 +62,7 @@ interface Props {
onOk: any; // todo: make better type
visible: boolean;
}
-function NewTokenModal(props: Props) {
+const NewTokenModal = (props: Props) => {
const { onOk, onCancel, visible } = props;
const [selectedScopes, setSelectedScopes] = useState([]);
const [name, setName] = useState('');
@@ -131,9 +131,9 @@ function NewTokenModal(props: Props) {
);
-}
+};
-export default function AccessTokens() {
+const AccessTokens = () => {
const [tokens, setTokens] = useState([]);
const [isTokenModalVisible, setIsTokenModalVisible] = useState(false);
@@ -264,4 +264,5 @@ export default function AccessTokens() {
/>
);
-}
+};
+export default AccessTokens;
diff --git a/web/pages/admin/actions.tsx b/web/pages/admin/actions.tsx
index a6df1256c..59fc60c71 100644
--- a/web/pages/admin/actions.tsx
+++ b/web/pages/admin/actions.tsx
@@ -1,7 +1,7 @@
import { DeleteOutlined } from '@ant-design/icons';
import { Button, Checkbox, Input, Modal, Space, Table, Typography } from 'antd';
import React, { useContext, useEffect, useState } from 'react';
-import FormStatusIndicator from '../../components/config/form-status-indicator';
+import { FormStatusIndicator } from '../../components/config/FormStatusIndicator';
import {
API_EXTERNAL_ACTIONS,
postConfigUpdateToAPI,
@@ -20,7 +20,7 @@ interface Props {
visible: boolean;
}
-function NewActionModal(props: Props) {
+const NewActionModal = (props: Props) => {
const { onOk, onCancel, visible } = props;
const [actionUrl, setActionUrl] = useState('');
@@ -131,9 +131,9 @@ function NewActionModal(props: Props) {