Skip to content

Commit

Permalink
fix: fix plugin file upload button (#20138)
Browse files Browse the repository at this point in the history
fix plugin file upload button
  • Loading branch information
MarconLP authored Feb 5, 2024
1 parent ca28a69 commit 08b2f71
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions frontend/src/scenes/plugins/edit/UploadField.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import { LemonButton, LemonFileInput } from '@posthog/lemon-ui'
import { IconUploadFile } from 'lib/lemon-ui/icons'
import { LemonFileInput } from '@posthog/lemon-ui'

export function UploadField({ value, onChange }: { value?: File; onChange?: (file: File) => void }): JSX.Element {
return (
<LemonFileInput
accept={'image/*'}
accept="*"
multiple={false}
onChange={(files) => onChange?.(files[0])}
value={value?.size ? [value] : []}
showUploadedFiles={false}
callToAction={
<LemonButton className="ph-ignore-input" icon={<IconUploadFile />}>
Click to upload
</LemonButton>
}
/>
)
}

0 comments on commit 08b2f71

Please sign in to comment.