diff --git a/src/components/codeBrowser.js b/src/components/codeBrowser.js index ad832f1..bf9dd92 100644 --- a/src/components/codeBrowser.js +++ b/src/components/codeBrowser.js @@ -5,14 +5,14 @@ import { useState, useEffect, useMemo } from 'react'; import { Row, Tab, Col, Card, Container } from 'react-bootstrap'; import DirectoryTree from 'components/directoryTree'; -import useSnippets from 'hooks/useSnippets'; +import useSnippetsContext from 'hooks/useSnippetsContext'; const getDirName = (path) => path.substring(0, path.lastIndexOf('/')); const getExtension = (path) => path.substring(path.lastIndexOf('.') + 1); export default function CodeBrowser({ id }) { - const { snippets } = useSnippets(); + const { snippets } = useSnippetsContext(); const [activeDocument, setActiveDocument] = useState(null); useEffect(() => { diff --git a/src/components/snippetProvider.js b/src/components/snippetProvider.js index ef5c171..82538b5 100644 --- a/src/components/snippetProvider.js +++ b/src/components/snippetProvider.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; -import { SnippetContext } from 'hooks/useSnippets'; +import { SnippetContext } from 'hooks/useSnippetsContext'; export default function SnippetProvider({ snippets, children }) { return ( diff --git a/src/hooks/useSnippets.js b/src/hooks/useSnippetsContext.js similarity index 76% rename from src/hooks/useSnippets.js rename to src/hooks/useSnippetsContext.js index 23c5409..02e4908 100644 --- a/src/hooks/useSnippets.js +++ b/src/hooks/useSnippetsContext.js @@ -4,6 +4,6 @@ export const SnippetContext = createContext({ snippets: [] }); -export default function useSnippets() { +export default function useSnippetsContext() { return useContext(SnippetContext); }