Jelajahi Sumber

Typescriptized

Taichi Masuyama 4 tahun lalu
induk
melakukan
f5e2c707d3

+ 0 - 29
packages/app/src/components/Sidebar/PageTree.jsx

@@ -1,29 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-
-import { withTranslation } from 'react-i18next';
-
-class PageTree extends React.Component {
-
-  static propTypes = {
-    t: PropTypes.func.isRequired, // i18next
-  };
-
-  render() {
-    const { t } = this.props;
-
-    return (
-      <>
-        <div className="grw-sidebar-content-header p-3 d-flex">
-          <h3 className="mb-0">{t('Page Tree')}</h3>
-        </div>
-        <div className="grw-sidebar-content-body p-3">
-          TBD
-        </div>
-      </>
-    );
-  }
-
-}
-
-export default withTranslation()(PageTree);

+ 24 - 0
packages/app/src/components/Sidebar/PageTree.tsx

@@ -0,0 +1,24 @@
+import React, { FC } from 'react';
+import { useTranslation } from 'react-i18next';
+
+
+type Props = {
+}
+
+const PageTree:FC<Props> = (props: Props) => {
+
+  const { t } = useTranslation();
+
+  return (
+    <>
+      <div className="grw-sidebar-content-header p-3 d-flex">
+        <h3 className="mb-0">{t('Page Tree')}</h3>
+      </div>
+      <div className="grw-sidebar-content-body p-3">
+        TBD
+      </div>
+    </>
+  );
+};
+
+export default PageTree;