Эх сурвалжийг харах

Fix exports and upgrade deps to make yarn happy

Kirk Trombley 4 жил өмнө
parent
commit
9a869c5787

+ 5 - 3
src/App.js

@@ -11,7 +11,7 @@ import DroneCI from './components/tiles/DroneCI';
 import Etherpad from './components/tiles/Etherpad';
 import Nextcloud from './components/tiles/Nextcloud';
 
-export default () => (
+const App = () => (
   <div className="App">
     <Teamspeak/>
     <TerrAssumptions/>
@@ -21,7 +21,9 @@ export default () => (
     <VacationPlanner/>
     <Gogs/>
     <DroneCI/>
-    <Etherpad />
-    <Nextcloud />
+    <Etherpad/>
+    <Nextcloud/>
   </div>
 );
+
+export default App;

+ 3 - 1
src/components/shared/Tile.jsx

@@ -1,10 +1,12 @@
 import React from "react";
 import { StatusMessage } from "./StatusMessage";
 
-export default ({ link, title, health, data }) => (
+const Tile = ({ link, title, health, data }) => (
   <a className="tile" href={link}>
     <span className="tile__title">{title}</span>
     <StatusMessage health={health} />
     {data ? <span className="tile__data">{data}</span> : null}
   </a>
 );
+
+export default Tile;

+ 4 - 3
src/components/tiles/CommaFeed.jsx

@@ -1,4 +1,3 @@
-import React from "react";
 import { OK } from "../shared/StatusMessage";
 import Tile from "../shared/Tile";
 import useApi from "../../hooks/useApi";
@@ -10,7 +9,7 @@ const apiOptions = { ms, fetchOptions };
 const homepage = `https://${window.location.hostname}/commafeed/`;
 const unreadLookup = `https://${window.location.hostname}/commafeed/rest/category/entries?id=all&limit=20&offset=0&order=desc&readType=unread`;
 
-export default () => {
+const CommaFeed = () => {
   const health = useHealthPolling(homepage, { ms });
   const [apiRes, data] = useApi(unreadLookup, apiOptions);
 
@@ -26,4 +25,6 @@ export default () => {
     health={health}
     data={message}
   />
-}
+}
+
+export default CommaFeed;

+ 3 - 2
src/components/tiles/DroneCI.jsx

@@ -1,11 +1,10 @@
-import React from "react";
 import Tile from "../shared/Tile";
 import useHealthPolling from "../../hooks/useHealthPolling";
 
 const droneUrl = `https://drone.hiram.services/`;
 const update = 1000 * 60 * 20;
 
-export default () => {
+const DroneCI = () => {
   const health = useHealthPolling(droneUrl, { ms: update })
 
   return <Tile
@@ -14,3 +13,5 @@ export default () => {
     health={health}
   />
 }
+
+export default DroneCI;

+ 3 - 2
src/components/tiles/Etherpad.jsx

@@ -1,11 +1,10 @@
-import React from "react";
 import Tile from "../shared/Tile";
 import useHealthPolling from "../../hooks/useHealthPolling";
 
 const etherpadUrl = `https://ether.hiram.services/`;
 const update = 1000 * 60 * 20;
 
-export default () => {
+const Etherpad = () => {
   const health = useHealthPolling(etherpadUrl, { ms: update })
 
   return <Tile
@@ -14,3 +13,5 @@ export default () => {
     health={health}
   />
 }
+
+export default Etherpad;

+ 3 - 2
src/components/tiles/Gogs.jsx

@@ -1,11 +1,10 @@
-import React from "react";
 import Tile from "../shared/Tile";
 import useHealthPolling from "../../hooks/useHealthPolling";
 
 const gogsUrl = `https://gogs.hiram.services/`;
 const update = 1000 * 60 * 20;
 
-export default () => {
+const Gogs = () => {
   const health = useHealthPolling(gogsUrl, { ms: update })
 
   return <Tile
@@ -14,3 +13,5 @@ export default () => {
     health={health}
   />
 }
+
+export default Gogs;

+ 4 - 3
src/components/tiles/Minecraft.jsx

@@ -1,4 +1,3 @@
-import React from "react";
 import { OK, BAD } from "../shared/StatusMessage";
 import Tile from "../shared/Tile";
 import useApi from "../../hooks/useApi";
@@ -6,7 +5,7 @@ import useApi from "../../hooks/useApi";
 const trimLen = 20;
 const ms = 1000 * 60;
 
-export default () => {
+const Minecraft = () => {
   const [rawHealth, rawData] = useApi(`https://${window.location.hostname}/minecraft/`, { ms });
 
   let health = BAD;
@@ -39,4 +38,6 @@ export default () => {
     health={health}
     data={message}
   />
-}
+}
+
+export default Minecraft;

+ 3 - 2
src/components/tiles/Nextcloud.jsx

@@ -1,11 +1,10 @@
-import React from "react";
 import Tile from "../shared/Tile";
 import useHealthPolling from "../../hooks/useHealthPolling";
 
 const nextcloudUrl = `https://cloud.hiram.services/`;
 const update = 1000 * 60 * 20;
 
-export default () => {
+const Nextcloud = () => {
   const health = useHealthPolling(nextcloudUrl, { ms: update })
 
   return <Tile
@@ -14,3 +13,5 @@ export default () => {
     health={health}
   />
 }
+
+export default Nextcloud;

+ 3 - 2
src/components/tiles/Rollbot.jsx

@@ -1,11 +1,10 @@
-import React from "react";
 import Tile from "../shared/Tile";
 import useHealthPolling from "../../hooks/useHealthPolling";
 
 const rollbotHealth = `https://${window.location.hostname}/rollbot/health`;
 const update = 1000 * 60 * 20;
 
-export default () => {
+const Rollbot = () => {
   const health = useHealthPolling(rollbotHealth, { ms: update })
 
   return <Tile
@@ -14,3 +13,5 @@ export default () => {
     health={health}
   />
 }
+
+export default Rollbot;

+ 4 - 3
src/components/tiles/Teamspeak.jsx

@@ -1,9 +1,8 @@
-import React from "react";
 import { OK } from "../shared/StatusMessage";
 import Tile from "../shared/Tile";
 import useApi from "../../hooks/useApi";
 
-export default () => {
+const Teamspeak = () => {
   const [health, data] = useApi(`https://${window.location.hostname}/teamspeak/api`);
 
   return <Tile
@@ -12,4 +11,6 @@ export default () => {
     health={health}
     data={health === OK ? `${data.users.length} user(s) online` : null}
   />
-}
+};
+
+export default Teamspeak;

+ 3 - 2
src/components/tiles/TerrAssumptions.jsx

@@ -1,11 +1,10 @@
-import React from "react";
 import Tile from "../shared/Tile";
 import useHealthPolling from "../../hooks/useHealthPolling";
 
 const taUrl = `https://${window.location.hostname}/terrassumptions/`;
 const update = 1000 * 60 * 20;
 
-export default () => {
+const TerrAssumptions = () => {
   const health = useHealthPolling(taUrl, { ms: update });
 
   return <Tile
@@ -14,3 +13,5 @@ export default () => {
     health={health}
   />
 }
+
+export default TerrAssumptions;

+ 3 - 2
src/components/tiles/VacationPlanner.jsx

@@ -1,11 +1,10 @@
-import React from "react";
 import Tile from "../shared/Tile";
 import useHealthPolling from "../../hooks/useHealthPolling";
 
 const plannerHealth = `https://${window.location.hostname}/vacation-planner/api/`;
 const update = 1000 * 60 * 20;
 
-export default () => {
+const VacationPlanner = () => {
   const health = useHealthPolling(plannerHealth, { ms: update })
 
   return <Tile
@@ -14,3 +13,5 @@ export default () => {
     health={health}
   />
 }
+
+export default VacationPlanner;

+ 4 - 2
src/hooks/useApi.js

@@ -3,7 +3,7 @@ import dequal from "dequal";
 import useInterval from "./useInterval";
 import { UNKNOWN, OK, BAD, FAILED } from "../components/shared/StatusMessage";
 
-export default (
+const useApi = (
   url,
   {
     ms = 20000,
@@ -34,4 +34,6 @@ export default (
   useInterval(pollApi, ms);
 
   return result;
-}
+}
+
+export default useApi;

+ 3 - 1
src/hooks/useEffectDequal.js

@@ -1,7 +1,7 @@
 import { useEffect, useRef } from "react";
 import dequal from "dequal";
 
-export default (effect, deps) => {
+const useEffectDequal = (effect, deps) => {
   const ref = useRef();
 
   if (!dequal(ref.current, deps)) {
@@ -10,3 +10,5 @@ export default (effect, deps) => {
 
   useEffect(effect, ref.current);
 }
+
+export default useEffectDequal;

+ 4 - 2
src/hooks/useHealthPolling.js

@@ -3,7 +3,7 @@ import dequal from "dequal";
 import { UNKNOWN, OK, BAD, FAILED } from "../components/shared/StatusMessage";
 import useInterval from "./useInterval";
 
-export default (
+const useHealthPolling = (
   url,
   {
     ms = 20000,
@@ -33,4 +33,6 @@ export default (
   useInterval(checkServer, ms);
 
   return status;
-}
+}
+
+export default useHealthPolling;

+ 3 - 1
src/hooks/useInterval.js

@@ -1,6 +1,6 @@
 import { useEffect } from "react";
 
-export default (effect, ms) => {
+const useInterval = (effect, ms) => {
   useEffect(() => {
     effect();
     
@@ -9,3 +9,5 @@ export default (effect, ms) => {
     return () => clearInterval(interval);
   }, [effect, ms]);
 };
+
+export default useInterval;

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 172 - 423
yarn.lock


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно