Explorar o código

typescriptize

Yuki Takei %!s(int64=4) %!d(string=hai) anos
pai
achega
58aec795fc
Modificáronse 1 ficheiros con 18 adicións e 21 borrados
  1. 18 21
      packages/app/src/components/ShareLink/ShareLinkList.tsx

+ 18 - 21
packages/app/src/components/ShareLink/ShareLinkList.tsx

@@ -1,16 +1,19 @@
 import React from 'react';
 import React from 'react';
 
 
 import dateFnsFormat from 'date-fns/format';
 import dateFnsFormat from 'date-fns/format';
-import PropTypes from 'prop-types';
-import { useTranslation, withTranslation } from 'react-i18next';
-
-import AppContainer from '~/client/services/AppContainer';
+import { useTranslation } from 'react-i18next';
 
 
 import CopyDropdown from '../Page/CopyDropdown';
 import CopyDropdown from '../Page/CopyDropdown';
-import { withUnstatedContainers } from '../UnstatedUtils';
 
 
 
 
-const ShareLinkTr = (props) => {
+type ShareLinkTrProps = {
+  // eslint-disable-next-line @typescript-eslint/no-explicit-any
+  shareLink: any,
+  isAdmin?: boolean,
+  onDelete?: () => void,
+}
+
+const ShareLinkTr = (props: ShareLinkTrProps): JSX.Element => {
   const { t } = useTranslation();
   const { t } = useTranslation();
 
 
   const { isAdmin, shareLink, onDelete } = props;
   const { isAdmin, shareLink, onDelete } = props;
@@ -57,7 +60,14 @@ const ShareLinkTr = (props) => {
 };
 };
 
 
 
 
-const ShareLinkList = (props) => {
+type Props = {
+  // eslint-disable-next-line @typescript-eslint/no-explicit-any
+  shareLinks: any[],
+  onClickDeleteButton?: (shareLinkId: string) => void,
+  isAdmin?: boolean,
+}
+
+const ShareLinkList = (props: Props): JSX.Element => {
 
 
   const { t } = useTranslation();
   const { t } = useTranslation();
 
 
@@ -100,17 +110,4 @@ const ShareLinkList = (props) => {
   );
   );
 };
 };
 
 
-/**
- * Wrapper component for using unstated
- */
-const ShareLinkListWrapper = withUnstatedContainers(ShareLinkList, [AppContainer]);
-
-ShareLinkList.propTypes = {
-  appContainer: PropTypes.instanceOf(AppContainer).isRequired,
-
-  shareLinks: PropTypes.array.isRequired,
-  onClickDeleteButton: PropTypes.func,
-  isAdmin: PropTypes.bool,
-};
-
-export default withTranslation()(ShareLinkListWrapper);
+export default ShareLinkList;