Direct image upload #184

Merged
enes merged 11 commits from 106-direct-image-upload into staging 2025-01-07 18:33:56 +00:00
2 changed files with 6 additions and 5 deletions
Showing only changes of commit 4c410be9ba - Show all commits

View File

@ -23,11 +23,13 @@ import {
ModPageLoaderResult ModPageLoaderResult
} from '../types' } from '../types'
import { initializeFormState } from '../utils' import { initializeFormState } from '../utils'
import { CheckboxField, InputError, InputField } from './Inputs' import { CheckboxField, InputField, InputFieldWithImageUpload } from './Inputs'
import { OriginalAuthor } from './OriginalAuthor' import { OriginalAuthor } from './OriginalAuthor'
import { CategoryAutocomplete } from './CategoryAutocomplete' import { CategoryAutocomplete } from './CategoryAutocomplete'
import { AlertPopup } from './AlertPopup' import { AlertPopup } from './AlertPopup'
import { Editor, EditorRef } from './Markdown/Editor' import { Editor, EditorRef } from './Markdown/Editor'
import { MEDIA_OPTIONS } from 'controllers'
import { InputError } from './Inputs/Error'
interface GameOption { interface GameOption {
value: string value: string
@ -220,10 +222,9 @@ export const ModForm = () => {
/> />
</div> </div>
<InputField <InputFieldWithImageUpload
label='Featured Image URL' label='Featured Image URL'
description='We recommend to upload images to https://nostr.build/' description={`We recommend to upload images to ${MEDIA_OPTIONS[0].host}`}
type='text'
inputMode='url' inputMode='url'
placeholder='Image URL' placeholder='Image URL'
name='featuredImageUrl' name='featuredImageUrl'

View File

@ -7,7 +7,6 @@ import {
} from 'react-router-dom' } from 'react-router-dom'
import { import {
CheckboxFieldUncontrolled, CheckboxFieldUncontrolled,
InputError,
InputFieldUncontrolled InputFieldUncontrolled
} from '../../components/Inputs' } from '../../components/Inputs'
import { ProfileSection } from '../../components/ProfileSection' import { ProfileSection } from '../../components/ProfileSection'
@ -19,6 +18,7 @@ import '../../styles/write.css'
import { LoadingSpinner } from 'components/LoadingSpinner' import { LoadingSpinner } from 'components/LoadingSpinner'
import { AlertPopup } from 'components/AlertPopup' import { AlertPopup } from 'components/AlertPopup'
import { Editor, EditorRef } from 'components/Markdown/Editor' import { Editor, EditorRef } from 'components/Markdown/Editor'
import { InputError } from 'components/Inputs/Error'
export const WritePage = () => { export const WritePage = () => {
const userState = useAppSelector((state) => state.user) const userState = useAppSelector((state) => state.user)