mirror of
https://github.com/upscayl/upscayl.git
synced 2025-02-15 10:22:37 +01:00
Rename files and components
This commit is contained in:
parent
4c14d2de5e
commit
a8d85e9564
@ -1,4 +1,4 @@
|
|||||||
import { newsAtom, showNewsModalAtom } from "@/atoms/newsAtom";
|
import { newsAtom, showNewsModalAtom } from "@/atoms/news-atom";
|
||||||
import { translationAtom } from "@/atoms/translations-atom";
|
import { translationAtom } from "@/atoms/translations-atom";
|
||||||
import { useAtomValue, useSetAtom } from "jotai";
|
import { useAtomValue, useSetAtom } from "jotai";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { FEATURE_FLAGS } from "@common/feature-flags";
|
import { FEATURE_FLAGS } from "@common/feature-flags";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import UpscaylSVGLogo from "./icons/Logo";
|
import UpscaylSVGLogo from "./icons/upscayl-logo-svg";
|
||||||
import { useAtomValue } from "jotai";
|
import { useAtomValue } from "jotai";
|
||||||
import { translationAtom } from "@/atoms/translations-atom";
|
import { translationAtom } from "@/atoms/translations-atom";
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { logAtom } from "../../atoms/logAtom";
|
import { logAtom } from "../../atoms/log-atom";
|
||||||
import log from "electron-log/renderer";
|
import log from "electron-log/renderer";
|
||||||
import { useSetAtom } from "jotai";
|
import { useSetAtom } from "jotai";
|
||||||
import React from "react";
|
import React from "react";
|
@ -1,7 +1,3 @@
|
|||||||
// React SVG Component
|
|
||||||
|
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
function Spinner() {
|
function Spinner() {
|
||||||
return (
|
return (
|
||||||
// By Sam Herbert (@sherb), for everyone. More @ http://goo.gl/7AJzbL
|
// By Sam Herbert (@sherb), for everyone. More @ http://goo.gl/7AJzbL
|
||||||
@ -10,7 +6,8 @@ function Spinner() {
|
|||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
stroke="currentColor"
|
stroke="currentColor"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
className="h-16 w-16 rounded-full bg-base-300 p-2 text-base-content">
|
className="h-16 w-16 rounded-full bg-base-300 p-2 text-base-content"
|
||||||
|
>
|
||||||
<g fill="none" fill-rule="evenodd">
|
<g fill="none" fill-rule="evenodd">
|
||||||
<g transform="translate(2 1)" stroke="currentColor" stroke-width="1.5">
|
<g transform="translate(2 1)" stroke="currentColor" stroke-width="1.5">
|
||||||
<circle
|
<circle
|
||||||
@ -18,7 +15,8 @@ function Spinner() {
|
|||||||
cy="11.462"
|
cy="11.462"
|
||||||
r="5"
|
r="5"
|
||||||
fill-opacity="1"
|
fill-opacity="1"
|
||||||
fill="currentColor">
|
fill="currentColor"
|
||||||
|
>
|
||||||
<animate
|
<animate
|
||||||
attributeName="fill-opacity"
|
attributeName="fill-opacity"
|
||||||
begin="0s"
|
begin="0s"
|
||||||
@ -33,7 +31,8 @@ function Spinner() {
|
|||||||
cy="27.063"
|
cy="27.063"
|
||||||
r="5"
|
r="5"
|
||||||
fill-opacity="0"
|
fill-opacity="0"
|
||||||
fill="currentColor">
|
fill="currentColor"
|
||||||
|
>
|
||||||
<animate
|
<animate
|
||||||
attributeName="fill-opacity"
|
attributeName="fill-opacity"
|
||||||
begin="0s"
|
begin="0s"
|
||||||
@ -48,7 +47,8 @@ function Spinner() {
|
|||||||
cy="42.663"
|
cy="42.663"
|
||||||
r="5"
|
r="5"
|
||||||
fill-opacity="0"
|
fill-opacity="0"
|
||||||
fill="currentColor">
|
fill="currentColor"
|
||||||
|
>
|
||||||
<animate
|
<animate
|
||||||
attributeName="fill-opacity"
|
attributeName="fill-opacity"
|
||||||
begin="0s"
|
begin="0s"
|
||||||
@ -63,7 +63,8 @@ function Spinner() {
|
|||||||
cy="49.125"
|
cy="49.125"
|
||||||
r="5"
|
r="5"
|
||||||
fill-opacity="0"
|
fill-opacity="0"
|
||||||
fill="currentColor">
|
fill="currentColor"
|
||||||
|
>
|
||||||
<animate
|
<animate
|
||||||
attributeName="fill-opacity"
|
attributeName="fill-opacity"
|
||||||
begin="0s"
|
begin="0s"
|
||||||
@ -78,7 +79,8 @@ function Spinner() {
|
|||||||
cy="42.663"
|
cy="42.663"
|
||||||
r="5"
|
r="5"
|
||||||
fill-opacity="0"
|
fill-opacity="0"
|
||||||
fill="currentColor">
|
fill="currentColor"
|
||||||
|
>
|
||||||
<animate
|
<animate
|
||||||
attributeName="fill-opacity"
|
attributeName="fill-opacity"
|
||||||
begin="0s"
|
begin="0s"
|
||||||
@ -93,7 +95,8 @@ function Spinner() {
|
|||||||
cy="27.063"
|
cy="27.063"
|
||||||
r="5"
|
r="5"
|
||||||
fill-opacity="0"
|
fill-opacity="0"
|
||||||
fill="currentColor">
|
fill="currentColor"
|
||||||
|
>
|
||||||
<animate
|
<animate
|
||||||
attributeName="fill-opacity"
|
attributeName="fill-opacity"
|
||||||
begin="0s"
|
begin="0s"
|
||||||
@ -108,7 +111,8 @@ function Spinner() {
|
|||||||
cy="11.462"
|
cy="11.462"
|
||||||
r="5"
|
r="5"
|
||||||
fill-opacity="0"
|
fill-opacity="0"
|
||||||
fill="currentColor">
|
fill="currentColor"
|
||||||
|
>
|
||||||
<animate
|
<animate
|
||||||
attributeName="fill-opacity"
|
attributeName="fill-opacity"
|
||||||
begin="0s"
|
begin="0s"
|
@ -1,5 +1,5 @@
|
|||||||
import { translationAtom } from "@/atoms/translations-atom";
|
import { translationAtom } from "@/atoms/translations-atom";
|
||||||
import { lensSizeAtom, viewTypeAtom } from "@/atoms/userSettingsAtom";
|
import { lensSizeAtom, viewTypeAtom } from "@/atoms/user-settings-atom";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { useAtom, useAtomValue } from "jotai";
|
import { useAtom, useAtomValue } from "jotai";
|
||||||
import { WrenchIcon } from "lucide-react";
|
import { WrenchIcon } from "lucide-react";
|
||||||
@ -9,12 +9,10 @@ const ImageViewSettings = ({
|
|||||||
zoomAmount,
|
zoomAmount,
|
||||||
setZoomAmount,
|
setZoomAmount,
|
||||||
resetImagePaths,
|
resetImagePaths,
|
||||||
hideZoomOptions,
|
|
||||||
}: {
|
}: {
|
||||||
zoomAmount: string;
|
zoomAmount: string;
|
||||||
setZoomAmount: (arg: any) => void;
|
setZoomAmount: (arg: any) => void;
|
||||||
resetImagePaths: () => void;
|
resetImagePaths: () => void;
|
||||||
hideZoomOptions?: boolean;
|
|
||||||
}) => {
|
}) => {
|
||||||
const [openSidebar, setOpenSidebar] = useState(false);
|
const [openSidebar, setOpenSidebar] = useState(false);
|
||||||
const [viewType, setViewType] = useAtom(viewTypeAtom);
|
const [viewType, setViewType] = useAtom(viewTypeAtom);
|
@ -1,5 +1,3 @@
|
|||||||
import React from "react";
|
|
||||||
import ImageViewSettings from "../upscayl-tab/view/ImageOptions";
|
|
||||||
import { sanitizePath } from "@common/sanitize-path";
|
import { sanitizePath } from "@common/sanitize-path";
|
||||||
|
|
||||||
const ImageViewer = ({
|
const ImageViewer = ({
|
||||||
|
@ -9,15 +9,15 @@ import {
|
|||||||
progressAtom,
|
progressAtom,
|
||||||
viewTypeAtom,
|
viewTypeAtom,
|
||||||
rememberOutputFolderAtom,
|
rememberOutputFolderAtom,
|
||||||
} from "../../atoms/userSettingsAtom";
|
} from "../../atoms/user-settings-atom";
|
||||||
import { useToast } from "@/components/ui/use-toast";
|
import { useToast } from "@/components/ui/use-toast";
|
||||||
import { sanitizePath } from "@common/sanitize-path";
|
import { sanitizePath } from "@common/sanitize-path";
|
||||||
import getDirectoryFromPath from "@common/get-directory-from-path";
|
import getDirectoryFromPath from "@common/get-directory-from-path";
|
||||||
import { FEATURE_FLAGS } from "@common/feature-flags";
|
import { FEATURE_FLAGS } from "@common/feature-flags";
|
||||||
import { VALID_IMAGE_FORMATS } from "@/lib/valid-formats";
|
import { VALID_IMAGE_FORMATS } from "@/lib/valid-formats";
|
||||||
import ProgressBar from "./progress-bar";
|
import ProgressBar from "./progress-bar";
|
||||||
import InformationCard from "../upscayl-tab/view/RightPaneInfo";
|
import InstructionsCard from "./instructions-card";
|
||||||
import ImageViewSettings from "../upscayl-tab/view/ImageOptions";
|
import ImageViewSettings from "./image-view-settings";
|
||||||
import useUpscaylVersion from "../hooks/use-upscayl-version";
|
import useUpscaylVersion from "../hooks/use-upscayl-version";
|
||||||
import MacTitlebarDragRegion from "./mac-titlebar-drag-region";
|
import MacTitlebarDragRegion from "./mac-titlebar-drag-region";
|
||||||
import LensViewer from "./lens-view";
|
import LensViewer from "./lens-view";
|
||||||
@ -210,16 +210,13 @@ const MainContent = ({
|
|||||||
|
|
||||||
{/* DEFAULT PANE INFO */}
|
{/* DEFAULT PANE INFO */}
|
||||||
{showInformationCard && (
|
{showInformationCard && (
|
||||||
<InformationCard version={version} batchMode={batchMode} />
|
<InstructionsCard version={version} batchMode={batchMode} />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<ImageViewSettings
|
<ImageViewSettings
|
||||||
zoomAmount={zoomAmount}
|
zoomAmount={zoomAmount}
|
||||||
setZoomAmount={setZoomAmount}
|
setZoomAmount={setZoomAmount}
|
||||||
resetImagePaths={resetImagePaths}
|
resetImagePaths={resetImagePaths}
|
||||||
hideZoomOptions={
|
|
||||||
!batchMode && upscaledImagePath.length === 0 && imagePath.length > 0
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* SHOW SELECTED IMAGE */}
|
{/* SHOW SELECTED IMAGE */}
|
||||||
|
@ -2,7 +2,7 @@ import { translationAtom } from "@/atoms/translations-atom";
|
|||||||
import { useAtomValue } from "jotai";
|
import { useAtomValue } from "jotai";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
function InformationCard({ version, batchMode }) {
|
function InstructionsCard({ version, batchMode }) {
|
||||||
const t = useAtomValue(translationAtom);
|
const t = useAtomValue(translationAtom);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -26,4 +26,4 @@ function InformationCard({ version, batchMode }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default InformationCard;
|
export default InstructionsCard;
|
@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import UpscaylSVGLogo from "@/components/icons/Logo";
|
import UpscaylSVGLogo from "@/components/icons/upscayl-logo-svg";
|
||||||
import { useAtomValue } from "jotai";
|
import { useAtomValue } from "jotai";
|
||||||
import { translationAtom } from "@/atoms/translations-atom";
|
import { translationAtom } from "@/atoms/translations-atom";
|
||||||
import ELECTRON_COMMANDS from "@common/commands";
|
import ELECTRON_COMMANDS from "@common/commands";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { newsAtom, showNewsModalAtom } from "@/atoms/newsAtom";
|
import { newsAtom, showNewsModalAtom } from "@/atoms/news-atom";
|
||||||
import { translationAtom } from "@/atoms/translations-atom";
|
import { translationAtom } from "@/atoms/translations-atom";
|
||||||
import matter, { GrayMatterFile } from "gray-matter";
|
import matter, { GrayMatterFile } from "gray-matter";
|
||||||
import { useAtom, useAtomValue } from "jotai";
|
import { useAtom, useAtomValue } from "jotai";
|
@ -14,7 +14,7 @@ import {
|
|||||||
useCustomWidthAtom,
|
useCustomWidthAtom,
|
||||||
tileSizeAtom,
|
tileSizeAtom,
|
||||||
showSidebarAtom,
|
showSidebarAtom,
|
||||||
} from "../../atoms/userSettingsAtom";
|
} from "../../atoms/user-settings-atom";
|
||||||
import useLogger from "../hooks/use-logger";
|
import useLogger from "../hooks/use-logger";
|
||||||
import {
|
import {
|
||||||
BatchUpscaylPayload,
|
BatchUpscaylPayload,
|
||||||
@ -22,14 +22,14 @@ import {
|
|||||||
ImageUpscaylPayload,
|
ImageUpscaylPayload,
|
||||||
} from "@common/types/types";
|
} from "@common/types/types";
|
||||||
import { useToast } from "@/components/ui/use-toast";
|
import { useToast } from "@/components/ui/use-toast";
|
||||||
import LeftPaneImageSteps from "../upscayl-tab/config/LeftPaneImageSteps";
|
import UpscaylSteps from "./upscayl-tab/upscayl-steps";
|
||||||
import SettingsTab from "../settings-tab";
|
import SettingsTab from "./settings-tab";
|
||||||
import Footer from "../Footer";
|
import Footer from "../footer";
|
||||||
import { NewsModal } from "../NewsModal";
|
import { NewsModal } from "../news-modal";
|
||||||
import Tabs from "../Tabs";
|
import Tabs from "../tabs";
|
||||||
import Header from "../Header";
|
import Header from "../header";
|
||||||
import { ChevronLeftIcon } from "lucide-react";
|
import { ChevronLeftIcon } from "lucide-react";
|
||||||
import { logAtom } from "@/atoms/logAtom";
|
import { logAtom } from "@/atoms/log-atom";
|
||||||
import ELECTRON_COMMANDS from "@common/commands";
|
import ELECTRON_COMMANDS from "@common/commands";
|
||||||
import useUpscaylVersion from "../hooks/use-upscayl-version";
|
import useUpscaylVersion from "../hooks/use-upscayl-version";
|
||||||
import useTranslation from "../hooks/use-translation";
|
import useTranslation from "../hooks/use-translation";
|
||||||
@ -198,7 +198,7 @@ const Sidebar = ({
|
|||||||
<Tabs selectedTab={selectedTab} setSelectedTab={setSelectedTab} />
|
<Tabs selectedTab={selectedTab} setSelectedTab={setSelectedTab} />
|
||||||
|
|
||||||
{selectedTab === 0 && (
|
{selectedTab === 0 && (
|
||||||
<LeftPaneImageSteps
|
<UpscaylSteps
|
||||||
selectImageHandler={selectImageHandler}
|
selectImageHandler={selectImageHandler}
|
||||||
selectFolderHandler={selectFolderHandler}
|
selectFolderHandler={selectFolderHandler}
|
||||||
handleModelChange={handleModelChange}
|
handleModelChange={handleModelChange}
|
||||||
|
@ -9,12 +9,12 @@ import { DonateButton } from "./donate-button";
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { themeChange } from "theme-change";
|
import { themeChange } from "theme-change";
|
||||||
import { useAtom, useAtomValue } from "jotai";
|
import { useAtom, useAtomValue } from "jotai";
|
||||||
import { customModelsPathAtom, scaleAtom } from "../../atoms/userSettingsAtom";
|
import { customModelsPathAtom, scaleAtom } from "@/atoms/user-settings-atom";
|
||||||
import { modelsListAtom } from "../../atoms/modelsListAtom";
|
import { modelsListAtom } from "@/atoms/models-list-atom";
|
||||||
import useLogger from "../hooks/use-logger";
|
import useLogger from "@/components/hooks/use-logger";
|
||||||
import { InputCompression } from "./input-compression";
|
import { InputCompression } from "./input-compression";
|
||||||
import OverwriteToggle from "./overwrite-toggle";
|
import OverwriteToggle from "./overwrite-toggle";
|
||||||
import { UpscaylCloudModal } from "../UpscaylCloudModal";
|
import { UpscaylCloudModal } from "@/components/upscayl-cloud-modal";
|
||||||
import { ResetSettingsButton } from "./reset-settings-button";
|
import { ResetSettingsButton } from "./reset-settings-button";
|
||||||
import { FEATURE_FLAGS } from "@common/feature-flags";
|
import { FEATURE_FLAGS } from "@common/feature-flags";
|
||||||
import TurnOffNotificationsToggle from "./turn-off-notifications-toggle";
|
import TurnOffNotificationsToggle from "./turn-off-notifications-toggle";
|
@ -1,4 +1,7 @@
|
|||||||
import { customWidthAtom, useCustomWidthAtom } from "@/atoms/userSettingsAtom";
|
import {
|
||||||
|
customWidthAtom,
|
||||||
|
useCustomWidthAtom,
|
||||||
|
} from "@/atoms/user-settings-atom";
|
||||||
import { useAtom, useAtomValue } from "jotai";
|
import { useAtom, useAtomValue } from "jotai";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { translationAtom } from "@/atoms/translations-atom";
|
import { translationAtom } from "@/atoms/translations-atom";
|
@ -1,5 +1,5 @@
|
|||||||
import { translationAtom } from "@/atoms/translations-atom";
|
import { translationAtom } from "@/atoms/translations-atom";
|
||||||
import { tileSizeAtom } from "@/atoms/userSettingsAtom";
|
import { tileSizeAtom } from "@/atoms/user-settings-atom";
|
||||||
import { useAtom, useAtomValue } from "jotai";
|
import { useAtom, useAtomValue } from "jotai";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
import { translationAtom } from "@/atoms/translations-atom";
|
import { translationAtom } from "@/atoms/translations-atom";
|
||||||
import { overwriteAtom } from "@/atoms/userSettingsAtom";
|
import { overwriteAtom } from "@/atoms/user-settings-atom";
|
||||||
import { useAtom, useAtomValue } from "jotai";
|
import { useAtom, useAtomValue } from "jotai";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
|
|
@ -2,7 +2,7 @@ import { translationAtom } from "@/atoms/translations-atom";
|
|||||||
import {
|
import {
|
||||||
savedOutputPathAtom,
|
savedOutputPathAtom,
|
||||||
rememberOutputFolderAtom,
|
rememberOutputFolderAtom,
|
||||||
} from "@/atoms/userSettingsAtom";
|
} from "@/atoms/user-settings-atom";
|
||||||
import { useAtom, useAtomValue } from "jotai";
|
import { useAtom, useAtomValue } from "jotai";
|
||||||
|
|
||||||
export function SaveOutputFolderToggle() {
|
export function SaveOutputFolderToggle() {
|
@ -1,5 +1,5 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import commands from "../../../common/commands";
|
import commands from "@common/commands";
|
||||||
import { useAtomValue } from "jotai";
|
import { useAtomValue } from "jotai";
|
||||||
import { translationAtom } from "@/atoms/translations-atom";
|
import { translationAtom } from "@/atoms/translations-atom";
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
import { translationAtom } from "@/atoms/translations-atom";
|
import { translationAtom } from "@/atoms/translations-atom";
|
||||||
import { useCustomWidthAtom } from "@/atoms/userSettingsAtom";
|
import { useCustomWidthAtom } from "@/atoms/user-settings-atom";
|
||||||
import { useAtomValue } from "jotai";
|
import { useAtomValue } from "jotai";
|
||||||
|
|
||||||
type ImageScaleSelectProps = {
|
type ImageScaleSelectProps = {
|
@ -1,5 +1,5 @@
|
|||||||
import { translationAtom } from "@/atoms/translations-atom";
|
import { translationAtom } from "@/atoms/translations-atom";
|
||||||
import { turnOffNotificationsAtom } from "@/atoms/userSettingsAtom";
|
import { turnOffNotificationsAtom } from "@/atoms/user-settings-atom";
|
||||||
import { useAtom, useAtomValue } from "jotai";
|
import { useAtom, useAtomValue } from "jotai";
|
||||||
|
|
||||||
const TurnOffNotificationsToggle = () => {
|
const TurnOffNotificationsToggle = () => {
|
@ -1,4 +1,4 @@
|
|||||||
import UpscaylSVGLogo from "../icons/Logo";
|
import UpscaylSVGLogo from "../icons/upscayl-logo-svg";
|
||||||
import useTranslation from "../hooks/use-translation";
|
import useTranslation from "../hooks/use-translation";
|
||||||
|
|
||||||
const UpscaylLogo = () => {
|
const UpscaylLogo = () => {
|
||||||
|
@ -1,26 +1,24 @@
|
|||||||
import { useAtom, useAtomValue } from "jotai";
|
import { useAtom, useAtomValue } from "jotai";
|
||||||
import React, { useCallback, useEffect, useState } from "react";
|
import React, { useEffect, useMemo, useState } from "react";
|
||||||
import { Tooltip } from "react-tooltip";
|
import { Tooltip } from "react-tooltip";
|
||||||
import { themeChange } from "theme-change";
|
import { themeChange } from "theme-change";
|
||||||
import { TModelsList, modelsListAtom } from "../../../atoms/modelsListAtom";
|
import { TModelsList, modelsListAtom } from "../../../atoms/models-list-atom";
|
||||||
import useLogger from "../../hooks/use-logger";
|
import useLogger from "../../hooks/use-logger";
|
||||||
import {
|
import {
|
||||||
noImageProcessingAtom,
|
|
||||||
savedOutputPathAtom,
|
savedOutputPathAtom,
|
||||||
progressAtom,
|
progressAtom,
|
||||||
rememberOutputFolderAtom,
|
rememberOutputFolderAtom,
|
||||||
scaleAtom,
|
scaleAtom,
|
||||||
customWidthAtom,
|
customWidthAtom,
|
||||||
useCustomWidthAtom,
|
useCustomWidthAtom,
|
||||||
} from "../../../atoms/userSettingsAtom";
|
} from "../../../atoms/user-settings-atom";
|
||||||
import { FEATURE_FLAGS } from "@common/feature-flags";
|
import { FEATURE_FLAGS } from "@common/feature-flags";
|
||||||
import getModelScale from "@common/check-model-scale";
|
|
||||||
import ELECTRON_COMMANDS from "@common/commands";
|
import ELECTRON_COMMANDS from "@common/commands";
|
||||||
import Select from "react-select";
|
import Select from "react-select";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { useToast } from "@/components/ui/use-toast";
|
import { useToast } from "@/components/ui/use-toast";
|
||||||
import { translationAtom } from "@/atoms/translations-atom";
|
import { translationAtom } from "@/atoms/translations-atom";
|
||||||
import { SelectImageScale } from "@/components/settings-tab/select-image-scale";
|
import { SelectImageScale } from "../settings-tab/select-image-scale";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
selectImageHandler: () => Promise<void>;
|
selectImageHandler: () => Promise<void>;
|
||||||
@ -42,7 +40,7 @@ interface IProps {
|
|||||||
setGpuId: React.Dispatch<React.SetStateAction<string>>;
|
setGpuId: React.Dispatch<React.SetStateAction<string>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
function LeftPaneImageSteps({
|
function UpscaylSteps({
|
||||||
selectImageHandler,
|
selectImageHandler,
|
||||||
selectFolderHandler,
|
selectFolderHandler,
|
||||||
handleModelChange,
|
handleModelChange,
|
||||||
@ -65,16 +63,12 @@ function LeftPaneImageSteps({
|
|||||||
|
|
||||||
const modelOptions = useAtomValue(modelsListAtom);
|
const modelOptions = useAtomValue(modelsListAtom);
|
||||||
const [scale, setScale] = useAtom(scaleAtom);
|
const [scale, setScale] = useAtom(scaleAtom);
|
||||||
const noImageProcessing = useAtomValue(noImageProcessingAtom);
|
|
||||||
const [outputPath, setOutputPath] = useAtom(savedOutputPathAtom);
|
const [outputPath, setOutputPath] = useAtom(savedOutputPathAtom);
|
||||||
const [progress, setProgress] = useAtom(progressAtom);
|
const [progress, setProgress] = useAtom(progressAtom);
|
||||||
const rememberOutputFolder = useAtomValue(rememberOutputFolderAtom);
|
const rememberOutputFolder = useAtomValue(rememberOutputFolderAtom);
|
||||||
const [open, setOpen] = React.useState(false);
|
const [open, setOpen] = React.useState(false);
|
||||||
const [customWidth, setCustomWidth] = useAtom(customWidthAtom);
|
const customWidth = useAtomValue(customWidthAtom);
|
||||||
const [useCustomWidth, setUseCustomWidth] = useAtom(useCustomWidthAtom);
|
const useCustomWidth = useAtomValue(useCustomWidthAtom);
|
||||||
|
|
||||||
const [targetWidth, setTargetWidth] = useState<number>(null);
|
|
||||||
const [targetHeight, setTargetHeight] = useState<number>(null);
|
|
||||||
|
|
||||||
const logit = useLogger();
|
const logit = useLogger();
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
@ -136,12 +130,7 @@ function LeftPaneImageSteps({
|
|||||||
logit("🔀 Setting model to", currentModel.value);
|
logit("🔀 Setting model to", currentModel.value);
|
||||||
}, [currentModel]);
|
}, [currentModel]);
|
||||||
|
|
||||||
useEffect(() => {
|
const upscaylResolution = useMemo(() => {
|
||||||
setTargetWidth(getUpscaleResolution().width);
|
|
||||||
setTargetHeight(getUpscaleResolution().height);
|
|
||||||
}, [dimensions.width, dimensions.height, doubleUpscayl, scale]);
|
|
||||||
|
|
||||||
const getUpscaleResolution = useCallback(() => {
|
|
||||||
const newDimensions = {
|
const newDimensions = {
|
||||||
width: dimensions.width,
|
width: dimensions.width,
|
||||||
height: dimensions.height,
|
height: dimensions.height,
|
||||||
@ -335,7 +324,7 @@ function LeftPaneImageSteps({
|
|||||||
</span>
|
</span>
|
||||||
{t("APP.SCALE_SELECTION.TO_TITLE")}
|
{t("APP.SCALE_SELECTION.TO_TITLE")}
|
||||||
<span className="font-bold">
|
<span className="font-bold">
|
||||||
{getUpscaleResolution().width}x{getUpscaleResolution().height}
|
{upscaylResolution.width}x{upscaylResolution.height}
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
@ -366,4 +355,4 @@ function LeftPaneImageSteps({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default LeftPaneImageSteps;
|
export default UpscaylSteps;
|
@ -2,19 +2,18 @@
|
|||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import ELECTRON_COMMANDS from "../../common/commands";
|
import ELECTRON_COMMANDS from "../../common/commands";
|
||||||
import { useAtom, useAtomValue, useSetAtom } from "jotai";
|
import { useAtom, useAtomValue, useSetAtom } from "jotai";
|
||||||
import { modelsListAtom } from "../atoms/modelsListAtom";
|
import { modelsListAtom } from "../atoms/models-list-atom";
|
||||||
import {
|
import {
|
||||||
batchModeAtom,
|
batchModeAtom,
|
||||||
savedOutputPathAtom,
|
savedOutputPathAtom,
|
||||||
progressAtom,
|
progressAtom,
|
||||||
rememberOutputFolderAtom,
|
rememberOutputFolderAtom,
|
||||||
} from "../atoms/userSettingsAtom";
|
} from "../atoms/user-settings-atom";
|
||||||
import useLogger from "../components/hooks/use-logger";
|
import useLogger from "../components/hooks/use-logger";
|
||||||
import { newsAtom, showNewsModalAtom } from "@/atoms/newsAtom";
|
import { newsAtom, showNewsModalAtom } from "@/atoms/news-atom";
|
||||||
import matter from "gray-matter";
|
|
||||||
import { useToast } from "@/components/ui/use-toast";
|
import { useToast } from "@/components/ui/use-toast";
|
||||||
import { ToastAction } from "@/components/ui/toast";
|
import { ToastAction } from "@/components/ui/toast";
|
||||||
import UpscaylSVGLogo from "@/components/icons/Logo";
|
import UpscaylSVGLogo from "@/components/icons/upscayl-logo-svg";
|
||||||
import { translationAtom } from "@/atoms/translations-atom";
|
import { translationAtom } from "@/atoms/translations-atom";
|
||||||
import Sidebar from "@/components/sidebar";
|
import Sidebar from "@/components/sidebar";
|
||||||
import MainContent from "@/components/main-content";
|
import MainContent from "@/components/main-content";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user