Skip to content

Commit

Permalink
Fixed #9 #7
Browse files Browse the repository at this point in the history
  • Loading branch information
soranoo committed May 1, 2024
1 parent 0d08ee3 commit 6527d6e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
31 changes: 17 additions & 14 deletions admin/src/components/Input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,26 +86,29 @@ const Input = ({
<FieldInput
onChange={onChange}
labelAction={labelAction}
placeholder={placeholder}
placeholder={placeholder && formatMessage(placeholder)}
disabled={disabled}
required
value={initialValue}
ref={ref}
readOnly
endAction={
<FieldActionWrapper
onClick={() => {
if (disabled) return
const newULID = ulid()
onChange({ target: { value: newULID, name }})
}}
label={formatMessage({
id: 'ulid.form.field.generate',
defaultMessage: 'Generate',
})}
>
<Refresh />
</FieldActionWrapper>
<>
{!disabled && (
<FieldActionWrapper
onClick={() => {
const newULID = ulid()
onChange({ target: { value: newULID, name }})
}}
label={formatMessage({
id: 'ulid.form.field.generate',
defaultMessage: 'Generate',
})}
>
<Refresh />
</FieldActionWrapper>
)}
</>
}
/>
<FieldHint />
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 6527d6e

Please sign in to comment.