From 6527d6edd81f9eb89989dd7252a101049f21fdf7 Mon Sep 17 00:00:00 2001 From: Freeman Date: Wed, 1 May 2024 13:20:56 +0100 Subject: [PATCH] Fixed #9 #7 --- admin/src/components/Input/index.tsx | 31 +++++++++++++++------------- package.json | 2 +- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/admin/src/components/Input/index.tsx b/admin/src/components/Input/index.tsx index d2abe22..2893baa 100644 --- a/admin/src/components/Input/index.tsx +++ b/admin/src/components/Input/index.tsx @@ -86,26 +86,29 @@ const Input = ({ { - if (disabled) return - const newULID = ulid() - onChange({ target: { value: newULID, name }}) - }} - label={formatMessage({ - id: 'ulid.form.field.generate', - defaultMessage: 'Generate', - })} - > - - + <> + {!disabled && ( + { + const newULID = ulid() + onChange({ target: { value: newULID, name }}) + }} + label={formatMessage({ + id: 'ulid.form.field.generate', + defaultMessage: 'Generate', + })} + > + + + )} + } /> diff --git a/package.json b/package.json index 461ef29..a070b6a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "strapi-ulid", - "version": "0.1.5", + "version": "0.1.6", "description": "This plugin adds support for ULID field type to Strapi as a Custom field.", "keywords": [ "strapi",