diff --git a/src/common/RebootButton.js b/src/common/RebootButton.js index fbd16a8..4dceb46 100644 --- a/src/common/RebootButton.js +++ b/src/common/RebootButton.js @@ -14,7 +14,7 @@ import { ForisURLs } from "../utils/forisUrls"; import { Button } from "../bootstrap/Button"; import { Modal, ModalHeader, ModalBody, ModalFooter } from "../bootstrap/Modal"; -import { useAlert } from "../alertContext/AlertContext"; +import { useAlert } from "../context/alertContext/AlertContext"; export function RebootButton(props) { const [triggered, setTriggered] = useState(false); diff --git a/src/common/WiFiSettings/ResetWiFiSettings.js b/src/common/WiFiSettings/ResetWiFiSettings.js index 6973a5b..d52b52c 100644 --- a/src/common/WiFiSettings/ResetWiFiSettings.js +++ b/src/common/WiFiSettings/ResetWiFiSettings.js @@ -9,7 +9,7 @@ import React, { useEffect, useState } from "react"; import PropTypes from "prop-types"; import { Button } from "../../bootstrap/Button"; -import { useAlert } from "../../alertContext/AlertContext"; +import { useAlert } from "../../context/alertContext/AlertContext"; import { ALERT_TYPES } from "../../bootstrap/Alert"; import { useAPIPost } from "../../api/hooks"; import { API_STATE } from "../../api/utils"; diff --git a/src/alertContext/AlertContext.js b/src/context/alertContext/AlertContext.js similarity index 93% rename from src/alertContext/AlertContext.js rename to src/context/alertContext/AlertContext.js index bf01371..82f18de 100644 --- a/src/alertContext/AlertContext.js +++ b/src/context/alertContext/AlertContext.js @@ -8,8 +8,8 @@ import React, { useState, useContext, useCallback } from "react"; import PropTypes from "prop-types"; -import { Alert, ALERT_TYPES } from "../bootstrap/Alert"; -import { Portal } from "../utils/Portal"; +import { Alert, ALERT_TYPES } from "../../bootstrap/Alert"; +import { Portal } from "../../utils/Portal"; AlertContextProvider.propTypes = { children: PropTypes.oneOfType([ diff --git a/src/alertContext/AlertContext.md b/src/context/alertContext/AlertContext.md similarity index 100% rename from src/alertContext/AlertContext.md rename to src/context/alertContext/AlertContext.md diff --git a/src/alertContext/__tests__/AlertContext.test.js b/src/context/alertContext/__tests__/AlertContext.test.js similarity index 100% rename from src/alertContext/__tests__/AlertContext.test.js rename to src/context/alertContext/__tests__/AlertContext.test.js diff --git a/src/alertContext/__tests__/__snapshots__/AlertContext.test.js.snap b/src/context/alertContext/__tests__/__snapshots__/AlertContext.test.js.snap similarity index 100% rename from src/alertContext/__tests__/__snapshots__/AlertContext.test.js.snap rename to src/context/alertContext/__tests__/__snapshots__/AlertContext.test.js.snap diff --git a/src/customizationContext/CustomizationContext.js b/src/context/customizationContext/CustomizationContext.js similarity index 90% rename from src/customizationContext/CustomizationContext.js rename to src/context/customizationContext/CustomizationContext.js index e763421..9b7bc12 100644 --- a/src/customizationContext/CustomizationContext.js +++ b/src/context/customizationContext/CustomizationContext.js @@ -8,10 +8,10 @@ import React, { useContext, useEffect } from "react"; import PropTypes from "prop-types"; -import { useAPIGet } from "../api/hooks"; -import { ForisURLs } from "../utils/forisUrls"; +import { useAPIGet } from "../../api/hooks"; +import { ForisURLs } from "../../utils/forisUrls"; -import { Spinner } from "../bootstrap/Spinner"; +import { Spinner } from "../../bootstrap/Spinner"; CustomizationContextProvider.propTypes = { children: PropTypes.oneOfType([ diff --git a/src/customizationContext/CustomizationContext.md b/src/context/customizationContext/CustomizationContext.md similarity index 100% rename from src/customizationContext/CustomizationContext.md rename to src/context/customizationContext/CustomizationContext.md diff --git a/src/customizationContext/__tests__/CustomizationContext.test.js b/src/context/customizationContext/__tests__/CustomizationContext.test.js similarity index 100% rename from src/customizationContext/__tests__/CustomizationContext.test.js rename to src/context/customizationContext/__tests__/CustomizationContext.test.js diff --git a/src/customizationContext/__tests__/__snapshots__/CustomizationContext.test.js.snap b/src/context/customizationContext/__tests__/__snapshots__/CustomizationContext.test.js.snap similarity index 100% rename from src/customizationContext/__tests__/__snapshots__/CustomizationContext.test.js.snap rename to src/context/customizationContext/__tests__/__snapshots__/CustomizationContext.test.js.snap diff --git a/src/form/components/ForisForm.js b/src/form/components/ForisForm.js index 2887f25..c545efa 100644 --- a/src/form/components/ForisForm.js +++ b/src/form/components/ForisForm.js @@ -13,7 +13,7 @@ import { ALERT_TYPES } from "../../bootstrap/Alert"; import { API_STATE } from "../../api/utils"; import { formFieldsSize } from "../../bootstrap/constants"; import { Spinner } from "../../bootstrap/Spinner"; -import { useAlert } from "../../alertContext/AlertContext"; +import { useAlert } from "../../context/alertContext/AlertContext"; import { useAPIPost } from "../../api/hooks"; import { useForisModule, useForm } from "../hooks"; diff --git a/src/index.js b/src/index.js index 09ec807..33daf12 100644 --- a/src/index.js +++ b/src/index.js @@ -90,10 +90,13 @@ export { } from "./utils/validations"; // Alert context -export { AlertContextProvider, useAlert } from "./alertContext/AlertContext"; +export { + AlertContextProvider, + useAlert, +} from "./context/alertContext/AlertContext"; // Customization context export { CustomizationContextProvider, useCustomizationContext, -} from "./customizationContext/CustomizationContext"; +} from "./context/customizationContext/CustomizationContext"; diff --git a/styleguide.config.js b/styleguide.config.js index 1798dc9..7b90b6f 100644 --- a/styleguide.config.js +++ b/styleguide.config.js @@ -43,7 +43,7 @@ module.exports = { }, { name: "Alert Context", - components: ["src/alertContext/AlertContext.js"], + components: ["src/context/alertContext/AlertContext.js"], exampleMode: "expand", usageMode: "expand", }, @@ -53,7 +53,9 @@ module.exports = { { name: "Customization Context", - components: ["src/customizationContext/CustomizationContext.js"], + components: [ + "src/context/customizationContext/CustomizationContext.js", + ], exampleMode: "expand", usageMode: "expand", },