From 1c74df026678e96189163f28cb83dd6c58c14bcc Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Thu, 20 Jan 2022 17:02:32 +0100 Subject: [PATCH] #225 - removed slug validation in button for dependent placeholders --- src/panelWebView/components/Actions.tsx | 2 +- src/panelWebView/components/SlugAction.tsx | 16 +++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/panelWebView/components/Actions.tsx b/src/panelWebView/components/Actions.tsx index 9a51d496..7997fcfd 100644 --- a/src/panelWebView/components/Actions.tsx +++ b/src/panelWebView/components/Actions.tsx @@ -21,7 +21,7 @@ const Actions: React.FunctionComponent = ({ metadata, settings }:
- { metadata && metadata.title && } + { metadata && metadata.title && } { settings?.preview?.host && } diff --git a/src/panelWebView/components/SlugAction.tsx b/src/panelWebView/components/SlugAction.tsx index 15967aad..c27fb888 100644 --- a/src/panelWebView/components/SlugAction.tsx +++ b/src/panelWebView/components/SlugAction.tsx @@ -1,28 +1,18 @@ import * as React from 'react'; import { MessageHelper } from '../../helpers/MessageHelper'; -import { SlugHelper } from '../../helpers/SlugHelper'; -import { Slug } from '../../models/PanelSettings'; import { CommandToCode } from '../CommandToCode'; import { ActionButton } from './ActionButton'; -export interface ISlugActionProps { - value: string; - crntValue: string; - slugOpts: Slug; -} +export interface ISlugActionProps {} -const SlugAction: React.FunctionComponent = (props: React.PropsWithChildren) => { - const { value, crntValue, slugOpts } = props; - - let slug = SlugHelper.createSlug(value); - slug = `${slugOpts.prefix}${slug}${slugOpts.suffix}`; +const SlugAction: React.FunctionComponent = ({}: React.PropsWithChildren) => { const optimize = () => { MessageHelper.sendMessage(CommandToCode.updateSlug); }; return ( - + ); };