- Timestamp:
- 06/24/26 16:28:50 (11 days ago)
- Branches:
- main
- Children:
- a8f4a2d
- Parents:
- 0b502c2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapterx-frontend/src/pages/writer/CreateStoryPage.tsx
r0b502c2 r99c1e45 21 21 short_description: '', 22 22 content: '', 23 cover_image: '', 23 24 genres: [] as string[], 24 25 mature_content: false, … … 45 46 story_id: Date.now(), 46 47 ...form, 48 cover_image: form.cover_image || undefined, 47 49 user_id: currentUser.user_id, 48 50 author_username: currentUser.username, … … 124 126 <span className="text-slate-600 text-xs">{form.short_description.length}/280</span> 125 127 </div> 128 </div> 129 130 {/* Cover image */} 131 <div> 132 <label className="block text-sm font-medium text-slate-300 mb-1.5">Cover Image URL <span className="text-slate-500 font-normal">(optional)</span></label> 133 <input 134 value={form.cover_image} 135 onChange={e => { 136 const val = e.target.value 137 if (!val || val.startsWith('http')) setField('cover_image', val) 138 }} 139 placeholder="https://example.com/image.jpg" 140 className="w-full px-4 py-3 bg-slate-800 border border-slate-700 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:border-indigo-500" 141 /> 142 {form.cover_image?.startsWith('http') && ( 143 <img src={form.cover_image} alt="Cover preview" className="mt-2 h-32 w-full object-cover rounded-xl opacity-80" onError={e => (e.currentTarget.style.display = 'none')} /> 144 )} 126 145 </div> 127 146
Note:
See TracChangeset
for help on using the changeset viewer.
