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