* Add new upload update package form Add new add vehicle form Add new side menu layout Add new toolbar layout Update and add unit tests * Enable add get and add vehicles * Integration issues with ota_update service * Update get vehicle JSON format * Fix related unit test Add release notes field * Add StatusContext to display error and status messages
21 lines
426 B
JavaScript
21 lines
426 B
JavaScript
import React, { useContext, useState } from "react";
|
|
|
|
const StatusContext = React.createContext();
|
|
|
|
export const StatusProvider = ({ children }) => {
|
|
const [message, setMessage] = useState(null);
|
|
|
|
return (
|
|
<StatusContext.Provider
|
|
value={{
|
|
message,
|
|
setMessage,
|
|
}}
|
|
>
|
|
{children}
|
|
</StatusContext.Provider>
|
|
);
|
|
};
|
|
|
|
export const useStatusContext = () => useContext(StatusContext);
|