Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Refactoring to include husky pre-commit hooks, improved eslint rules and manual chunking + more #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Mathys-Gasnier merged 7 commits into quicksnip-dev:main from barrymun:refactor/linting
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removing barrel imports
  • Loading branch information
barrymun committed Jan 1, 2025
commit a9d13e545972958d93cf414c6ff70a58498ec908
2 changes: 1 addition & 1 deletion src/App.tsx
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import SnippetList from "components/SnippetList";
import { useAppContext } from "contexts";
import { useAppContext } from "contexts/AppContext";
import Banner from "layouts/Banner";
import Footer from "layouts/Footer";
import Header from "layouts/Header";
Expand Down
4 changes: 2 additions & 2 deletions src/components/CategoryList.tsx
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect } from "react";

import { useAppContext } from "contexts";
import { useCategories } from "hooks";
import { useAppContext } from "contexts/AppContext";
import { useCategories } from "hooks/useCategories";

const CategoryList = () => {
const { category, setCategory } = useAppContext();
Expand Down
10 changes: 6 additions & 4 deletions src/components/LanguageSelector.tsx
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import React, { useRef, useEffect } from "react";
import { useRef, useEffect, useState } from "react";

import { useAppContext } from "contexts";
import { useKeyboardNavigation, useLanguages } from "hooks";
import { useAppContext } from "contexts/AppContext";
import { useKeyboardNavigation } from "hooks/useKeyboardNavigation";
import { useLanguages } from "hooks/useLanguages";
import { LanguageType } from "types";

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

const LanguageSelector = () => {
const { language, setLanguage } = useAppContext();
const { fetchedLanguages, loading, error } = useLanguages();

const dropdownRef = useRef<HTMLDivElement>(null);
const [isOpen, setIsOpen] = React.useState(false);
const [isOpen, setIsOpen] = useState(false);

const handleSelect = (selected: LanguageType) => {
setLanguage(selected);
Expand Down
4 changes: 2 additions & 2 deletions src/components/SnippetList.tsx
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from "react";

import { useAppContext } from "contexts";
import { useSnippets } from "hooks";
import { useAppContext } from "contexts/AppContext";
import { useSnippets } from "hooks/useSnippets";
import { SnippetType } from "types";

import { LeftAngleArrowIcon } from "./Icons";
Expand Down
4 changes: 2 additions & 2 deletions src/components/SnippetModal.tsx
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react";
import ReactDOM from "react-dom";

import { useEscapeKey } from "hooks";
import { useEscapeKey } from "hooks/useEscapeKey";
import { SnippetType } from "types";
import { slugify } from "utils";
import { slugify } from "utils/slugify";

import Button from "./Button";
import CodePreview from "./CodePreview";
Expand Down
1 change: 0 additions & 1 deletion src/components/index.ts
View file Open in desktop

This file was deleted.

1 change: 0 additions & 1 deletion src/contexts/index.ts
View file Open in desktop

This file was deleted.

6 changes: 0 additions & 6 deletions src/hooks/index.ts
View file Open in desktop

This file was deleted.

6 changes: 3 additions & 3 deletions src/hooks/useCategories.ts
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useMemo } from "react";

import { useAppContext } from "contexts";
import { useAppContext } from "contexts/AppContext";
import { SnippetType } from "types";
import { slugify } from "utils";
import { slugify } from "utils/slugify";

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

type CategoryData = {
categoryName: string;
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useSnippets.ts
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useAppContext } from "contexts";
import { useAppContext } from "contexts/AppContext";
import { SnippetType } from "types";
import { slugify } from "utils";
import { slugify } from "utils/slugify";

import { useFetch } from "./useFetch";

Expand Down
2 changes: 1 addition & 1 deletion src/layouts/Header.tsx
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GitHubIcon } from "components";
import { GitHubIcon } from "components/Icons";
import LinkButton from "components/LinkButton";
import Logo from "components/Logo";
import SearchInput from "components/SearchInput";
Expand Down
2 changes: 1 addition & 1 deletion src/main.tsx
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { StrictMode } from "react";
import { createRoot } from "react-dom/client";

import App from "App";
import { AppProvider } from "contexts";
import { AppProvider } from "contexts/AppContext";

createRoot(document.getElementById("root")!).render(
<StrictMode>
Expand Down
1 change: 0 additions & 1 deletion src/utils/index.ts
View file Open in desktop

This file was deleted.

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /