Skip to content

Commit a9d13e5

Browse files
committed
removing barrel imports
1 parent 0b78050 commit a9d13e5

File tree

13 files changed

+20
-27
lines changed

13 files changed

+20
-27
lines changed

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import SnippetList from "components/SnippetList";
2-
import { useAppContext } from "contexts";
2+
import { useAppContext } from "contexts/AppContext";
33
import Banner from "layouts/Banner";
44
import Footer from "layouts/Footer";
55
import Header from "layouts/Header";

src/components/CategoryList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useEffect } from "react";
22

3-
import { useAppContext } from "contexts";
4-
import { useCategories } from "hooks";
3+
import { useAppContext } from "contexts/AppContext";
4+
import { useCategories } from "hooks/useCategories";
55

66
const CategoryList = () => {
77
const { category, setCategory } = useAppContext();

src/components/LanguageSelector.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
import React, { useRef, useEffect } from "react";
1+
import { useRef, useEffect, useState } from "react";
22

3-
import { useAppContext } from "contexts";
4-
import { useKeyboardNavigation, useLanguages } from "hooks";
3+
import { useAppContext } from "contexts/AppContext";
4+
import { useKeyboardNavigation } from "hooks/useKeyboardNavigation";
5+
import { useLanguages } from "hooks/useLanguages";
56
import { LanguageType } from "types";
67

78
// Inspired by https://blog.logrocket.com/creating-custom-select-dropdown-css/
89

910
const LanguageSelector = () => {
1011
const { language, setLanguage } = useAppContext();
1112
const { fetchedLanguages, loading, error } = useLanguages();
13+
1214
const dropdownRef = useRef<HTMLDivElement>(null);
13-
const [isOpen, setIsOpen] = React.useState(false);
15+
const [isOpen, setIsOpen] = useState(false);
1416

1517
const handleSelect = (selected: LanguageType) => {
1618
setLanguage(selected);

src/components/SnippetList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useState } from "react";
22

3-
import { useAppContext } from "contexts";
4-
import { useSnippets } from "hooks";
3+
import { useAppContext } from "contexts/AppContext";
4+
import { useSnippets } from "hooks/useSnippets";
55
import { SnippetType } from "types";
66

77
import { LeftAngleArrowIcon } from "./Icons";

src/components/SnippetModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from "react";
22
import ReactDOM from "react-dom";
33

4-
import { useEscapeKey } from "hooks";
4+
import { useEscapeKey } from "hooks/useEscapeKey";
55
import { SnippetType } from "types";
6-
import { slugify } from "utils";
6+
import { slugify } from "utils/slugify";
77

88
import Button from "./Button";
99
import CodePreview from "./CodePreview";

src/components/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/contexts/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/hooks/index.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/hooks/useCategories.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { useMemo } from "react";
22

3-
import { useAppContext } from "contexts";
3+
import { useAppContext } from "contexts/AppContext";
44
import { SnippetType } from "types";
5-
import { slugify } from "utils";
5+
import { slugify } from "utils/slugify";
66

7-
import { useFetch } from "./";
7+
import { useFetch } from "./useFetch";
88

99
type CategoryData = {
1010
categoryName: string;

src/hooks/useSnippets.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { useAppContext } from "contexts";
1+
import { useAppContext } from "contexts/AppContext";
22
import { SnippetType } from "types";
3-
import { slugify } from "utils";
3+
import { slugify } from "utils/slugify";
44

55
import { useFetch } from "./useFetch";
66

0 commit comments

Comments
 (0)