refactor: remove word Context from file names in context folder
This commit is contained in:
parent
0321afa65f
commit
e7fd155c50
16 changed files with 39 additions and 37 deletions
|
|
@ -1,10 +1,10 @@
|
|||
import { useEffect, useRef, useState } from "react";
|
||||
import { Sprite, useApp } from "@pixi/react";
|
||||
|
||||
import * as PIXI from "pixi.js";
|
||||
import { useApp } from "@pixi/react";
|
||||
import { CompositeTilemap, settings } from "@pixi/tilemap";
|
||||
|
||||
import blocksData from "@/data/blocks/programmer-art/average_colors.json";
|
||||
import * as PIXI from "pixi.js";
|
||||
|
||||
import { CompositeTilemap, settings } from "@pixi/tilemap";
|
||||
|
||||
interface Props {
|
||||
blocks: Block[];
|
||||
|
|
|
|||
|
|
@ -1,16 +1,18 @@
|
|||
import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { Container, Stage } from "@pixi/react";
|
||||
import * as PIXI from "pixi.js";
|
||||
|
||||
import { ImageContext } from "@/context/ImageContext";
|
||||
import { SettingsContext } from "@/context/SettingsContext";
|
||||
import { TexturesContext } from "@/context/TexturesContext";
|
||||
import { ToolContext } from "@/context/ToolContext";
|
||||
import * as PIXI from "pixi.js";
|
||||
import { Container, Stage } from "@pixi/react";
|
||||
|
||||
import { ImageContext } from "@/context/Image";
|
||||
import { SettingsContext } from "@/context/Settings";
|
||||
import { TexturesContext } from "@/context/Textures";
|
||||
import { ToolContext } from "@/context/Tool";
|
||||
|
||||
import Blocks from "./Blocks";
|
||||
import Cursor from "./Cursor";
|
||||
import Grid from "./Grid";
|
||||
import CanvasBorder from "./CanvasBorder";
|
||||
import Cursor from "./Cursor";
|
||||
|
||||
import CursorInformation from "./information/Cursor";
|
||||
import CanvasInformation from "./information/Canvas";
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { Button } from "@/components/ui/button";
|
|||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
|
||||
import { ImageContext } from "@/context/ImageContext";
|
||||
import { ImageContext } from "@/context/Image";
|
||||
|
||||
function OpenImage({ close }: DialogProps) {
|
||||
const { setImage: setContextImage, setImageDimensions: setContextImageDimensions } = useContext(ImageContext);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import {
|
|||
MenubarTrigger,
|
||||
} from "@/components/ui/menubar";
|
||||
|
||||
import { DialogContext } from "@/context/DialogContext";
|
||||
import { DialogContext } from "@/context/Dialog";
|
||||
|
||||
function FileMenu() {
|
||||
const openDialog = useContext(DialogContext);
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
import { MenubarRadioGroup, MenubarRadioItem, MenubarSub, MenubarSubContent, MenubarSubTrigger } from '@/components/ui/menubar';
|
||||
import { useTheme } from '@/context/ThemeContext';
|
||||
import { MenubarRadioGroup, MenubarRadioItem, MenubarSub, MenubarSubContent, MenubarSubTrigger } from "@/components/ui/menubar";
|
||||
import { useTheme } from "@/context/Theme";
|
||||
|
||||
function ThemeChanger() {
|
||||
const { setTheme, theme } = useTheme();
|
||||
const { setTheme, theme } = useTheme();
|
||||
|
||||
return (
|
||||
<MenubarSub>
|
||||
<MenubarSubTrigger>Set theme...</MenubarSubTrigger>
|
||||
<MenubarSubContent>
|
||||
<MenubarRadioGroup value={theme} onValueChange={(value) => setTheme(value as Theme)}>
|
||||
<MenubarRadioItem value='light'>Light</MenubarRadioItem>
|
||||
<MenubarRadioItem value='dark'>Dark</MenubarRadioItem>
|
||||
<MenubarRadioItem value='system'>System</MenubarRadioItem>
|
||||
</MenubarRadioGroup>
|
||||
</MenubarSubContent>
|
||||
</MenubarSub>
|
||||
)
|
||||
return (
|
||||
<MenubarSub>
|
||||
<MenubarSubTrigger>Set theme...</MenubarSubTrigger>
|
||||
<MenubarSubContent>
|
||||
<MenubarRadioGroup value={theme} onValueChange={(value) => setTheme(value as Theme)}>
|
||||
<MenubarRadioItem value="light">Light</MenubarRadioItem>
|
||||
<MenubarRadioItem value="dark">Dark</MenubarRadioItem>
|
||||
<MenubarRadioItem value="system">System</MenubarRadioItem>
|
||||
</MenubarRadioGroup>
|
||||
</MenubarSubContent>
|
||||
</MenubarSub>
|
||||
);
|
||||
}
|
||||
|
||||
export default ThemeChanger
|
||||
export default ThemeChanger;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useContext } from "react";
|
||||
import { MenubarCheckboxItem, MenubarContent, MenubarMenu, MenubarTrigger } from "@/components/ui/menubar";
|
||||
import { SettingsContext } from "@/context/SettingsContext";
|
||||
import { SettingsContext } from "@/context/Settings";
|
||||
|
||||
function ViewMenu() {
|
||||
const { settings, setSetting } = useContext(SettingsContext);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Link } from "react-router";
|
||||
|
||||
import { Menubar as UIMenubar } from "@/components/ui/menubar";
|
||||
import { DialogProvider } from "@/context/DialogContext";
|
||||
import { DialogProvider } from "@/context/Dialog";
|
||||
|
||||
import FileMenu from "./FileMenu";
|
||||
import ViewMenu from "./ViewMenu";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { useContext } from "react";
|
|||
import { EraserIcon, HandIcon, PencilIcon, ZoomInIcon } from "lucide-react";
|
||||
|
||||
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
||||
import { ToolContext } from "@/context/ToolContext";
|
||||
import { ToolContext } from "@/context/Tool";
|
||||
|
||||
function Toolbar() {
|
||||
const { tool, setTool } = useContext(ToolContext);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { StrictMode } from "react";
|
|||
import { createRoot } from "react-dom/client";
|
||||
import { BrowserRouter, Route, Routes } from "react-router";
|
||||
|
||||
import { ThemeProvider } from "@/context/ThemeContext.tsx";
|
||||
import { ThemeProvider } from "@/context/Theme.tsx";
|
||||
|
||||
import IndexPage from "./pages/IndexPage.tsx";
|
||||
import AppPage from "./pages/AppPage.tsx";
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { ImageProvider } from "../context/ImageContext";
|
||||
import { SettingsProvider } from "../context/SettingsContext";
|
||||
import { TexturesProvider } from "../context/TexturesContext";
|
||||
import { ToolProvider } from "../context/ToolContext";
|
||||
import { ImageProvider } from "../context/Image";
|
||||
import { SettingsProvider } from "../context/Settings";
|
||||
import { TexturesProvider } from "../context/Textures";
|
||||
import { ToolProvider } from "../context/Tool";
|
||||
|
||||
import Menubar from "../components/menubar";
|
||||
import Toolbar from "../components/toolbar";
|
||||
|
|
|
|||
Loading…
Reference in a new issue