Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
Remove useless warning (#1435)
Ivan Starkovbcd615022b23
diff --git a/apps/builder/app/builder/features/style-panel/style-panel.tsx b/apps/builder/app/builder/features/style-panel/style-panel.tsxindex e03e0e0efe..ed01a032b0 100644--- a/apps/builder/app/builder/features/style-panel/style-panel.tsx+++ b/apps/builder/app/builder/features/style-panel/style-panel.tsx@@ -1,52 +1,17 @@-import { useStore } from "@nanostores/react";-import {- theme,- Box,- Card,- DeprecatedParagraph,- ScrollArea,-} from "@webstudio-is/design-system";+import { theme, Box, ScrollArea } from "@webstudio-is/design-system";import type { Instance } from "@webstudio-is/project-build";import type { Publish } from "~/shared/pubsub";-import { selectedBreakpointStore } from "~/shared/nano-states";+import { useStyleData } from "./shared/use-style-data";import { StyleSettings } from "./style-settings";-import { canvasWidthContainer } from "~/builder/shared/nano-states";+import { StyleSourcesSection } from "./style-source-section";-import { matchMedia } from "@webstudio-is/css-engine";-import { useEffect, useState } from "react";type StylePanelProps = {publish: Publish;selectedInstance: Instance;};-const useMatchMedia = () => {- const [matched, setMatched] = useState(false);-- useEffect(() => {- return canvasWidthContainer.subscribe((canvasWidth) => {- const breakpoint = selectedBreakpointStore.get();- if (breakpoint === undefined) {- return;- }-- if (canvasWidth === undefined) {- return;- }-- if (matchMedia(breakpoint, canvasWidth) === false) {- setMatched(true);- return;- }-- setMatched(false);- });- }, []);-- return matched;-};-export const StylePanel = ({ selectedInstance, publish }: StylePanelProps) => {const { currentStyle, setProperty, deleteProperty, createBatchUpdate } =useStyleData({@@ -54,37 +19,10 @@ export const StylePanel = ({ selectedInstance, publish }: StylePanelProps) => {publish,});- const renderWarning = useMatchMedia();-- const breakpoint = useStore(selectedBreakpointStore);-- if (- currentStyle === undefined ||- selectedInstance === undefined ||- breakpoint === undefined- ) {+ if (currentStyle === undefined || selectedInstance === undefined) {return null;}- if (renderWarning) {- return (- <Box css={{ p: theme.spacing[5] }}>- <Card css={{ p: theme.spacing[9], mt: theme.spacing[9] }}>- <DeprecatedParagraph css={{ marginBottom: theme.spacing[5] }}>- {`Please increase the canvas width.`}- </DeprecatedParagraph>- <DeprecatedParagraph>- {"minWidth" in breakpoint- ? `"${breakpoint.label}" breakpoint minimum width is ${breakpoint.minWidth}px.`- : "maxWidth" in breakpoint- ? `"${breakpoint.label}" breakpoint maximum width is ${breakpoint.maxWidth}px.`- : ""}- </DeprecatedParagraph>- </Card>- </Box>- );- }-return (<><Box