Skip to content

Commit

Permalink
rename context to have context in its name
Browse files Browse the repository at this point in the history
  • Loading branch information
ayan4m1 committed Feb 19, 2024
1 parent 1ab21c8 commit 47a7964
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/codeBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/snippetProvider.js
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export const SnippetContext = createContext({
snippets: []
});

export default function useSnippets() {
export default function useSnippetsContext() {
return useContext(SnippetContext);
}

0 comments on commit 47a7964

Please sign in to comment.