mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2024-11-14 17:35:35 +01:00
Move contexts in a context folder
This commit is contained in:
parent
f382e743aa
commit
f2ae6c4d0a
|
@ -14,7 +14,7 @@ import { ForisURLs } from "../utils/forisUrls";
|
||||||
|
|
||||||
import { Button } from "../bootstrap/Button";
|
import { Button } from "../bootstrap/Button";
|
||||||
import { Modal, ModalHeader, ModalBody, ModalFooter } from "../bootstrap/Modal";
|
import { Modal, ModalHeader, ModalBody, ModalFooter } from "../bootstrap/Modal";
|
||||||
import { useAlert } from "../alertContext/AlertContext";
|
import { useAlert } from "../context/alertContext/AlertContext";
|
||||||
|
|
||||||
export function RebootButton(props) {
|
export function RebootButton(props) {
|
||||||
const [triggered, setTriggered] = useState(false);
|
const [triggered, setTriggered] = useState(false);
|
||||||
|
|
|
@ -9,7 +9,7 @@ import React, { useEffect, useState } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import { Button } from "../../bootstrap/Button";
|
import { Button } from "../../bootstrap/Button";
|
||||||
import { useAlert } from "../../alertContext/AlertContext";
|
import { useAlert } from "../../context/alertContext/AlertContext";
|
||||||
import { ALERT_TYPES } from "../../bootstrap/Alert";
|
import { ALERT_TYPES } from "../../bootstrap/Alert";
|
||||||
import { useAPIPost } from "../../api/hooks";
|
import { useAPIPost } from "../../api/hooks";
|
||||||
import { API_STATE } from "../../api/utils";
|
import { API_STATE } from "../../api/utils";
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
import React, { useState, useContext, useCallback } from "react";
|
import React, { useState, useContext, useCallback } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import { Alert, ALERT_TYPES } from "../bootstrap/Alert";
|
import { Alert, ALERT_TYPES } from "../../bootstrap/Alert";
|
||||||
import { Portal } from "../utils/Portal";
|
import { Portal } from "../../utils/Portal";
|
||||||
|
|
||||||
AlertContextProvider.propTypes = {
|
AlertContextProvider.propTypes = {
|
||||||
children: PropTypes.oneOfType([
|
children: PropTypes.oneOfType([
|
|
@ -8,10 +8,10 @@
|
||||||
import React, { useContext, useEffect } from "react";
|
import React, { useContext, useEffect } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import { useAPIGet } from "../api/hooks";
|
import { useAPIGet } from "../../api/hooks";
|
||||||
import { ForisURLs } from "../utils/forisUrls";
|
import { ForisURLs } from "../../utils/forisUrls";
|
||||||
|
|
||||||
import { Spinner } from "../bootstrap/Spinner";
|
import { Spinner } from "../../bootstrap/Spinner";
|
||||||
|
|
||||||
CustomizationContextProvider.propTypes = {
|
CustomizationContextProvider.propTypes = {
|
||||||
children: PropTypes.oneOfType([
|
children: PropTypes.oneOfType([
|
|
@ -13,7 +13,7 @@ import { ALERT_TYPES } from "../../bootstrap/Alert";
|
||||||
import { API_STATE } from "../../api/utils";
|
import { API_STATE } from "../../api/utils";
|
||||||
import { formFieldsSize } from "../../bootstrap/constants";
|
import { formFieldsSize } from "../../bootstrap/constants";
|
||||||
import { Spinner } from "../../bootstrap/Spinner";
|
import { Spinner } from "../../bootstrap/Spinner";
|
||||||
import { useAlert } from "../../alertContext/AlertContext";
|
import { useAlert } from "../../context/alertContext/AlertContext";
|
||||||
import { useAPIPost } from "../../api/hooks";
|
import { useAPIPost } from "../../api/hooks";
|
||||||
|
|
||||||
import { useForisModule, useForm } from "../hooks";
|
import { useForisModule, useForm } from "../hooks";
|
||||||
|
|
|
@ -90,10 +90,13 @@ export {
|
||||||
} from "./utils/validations";
|
} from "./utils/validations";
|
||||||
|
|
||||||
// Alert context
|
// Alert context
|
||||||
export { AlertContextProvider, useAlert } from "./alertContext/AlertContext";
|
export {
|
||||||
|
AlertContextProvider,
|
||||||
|
useAlert,
|
||||||
|
} from "./context/alertContext/AlertContext";
|
||||||
|
|
||||||
// Customization context
|
// Customization context
|
||||||
export {
|
export {
|
||||||
CustomizationContextProvider,
|
CustomizationContextProvider,
|
||||||
useCustomizationContext,
|
useCustomizationContext,
|
||||||
} from "./customizationContext/CustomizationContext";
|
} from "./context/customizationContext/CustomizationContext";
|
||||||
|
|
|
@ -43,7 +43,7 @@ module.exports = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Alert Context",
|
name: "Alert Context",
|
||||||
components: ["src/alertContext/AlertContext.js"],
|
components: ["src/context/alertContext/AlertContext.js"],
|
||||||
exampleMode: "expand",
|
exampleMode: "expand",
|
||||||
usageMode: "expand",
|
usageMode: "expand",
|
||||||
},
|
},
|
||||||
|
@ -53,7 +53,9 @@ module.exports = {
|
||||||
|
|
||||||
{
|
{
|
||||||
name: "Customization Context",
|
name: "Customization Context",
|
||||||
components: ["src/customizationContext/CustomizationContext.js"],
|
components: [
|
||||||
|
"src/context/customizationContext/CustomizationContext.js",
|
||||||
|
],
|
||||||
exampleMode: "expand",
|
exampleMode: "expand",
|
||||||
usageMode: "expand",
|
usageMode: "expand",
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user