Ignore:
Timestamp:
06/24/26 16:28:50 (11 days ago)
Author:
kikisrbinoska <srbinoskakristina07@…>
Branches:
main
Children:
a8f4a2d
Parents:
0b502c2
Message:

Fixed writer section and admin management

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapterx-frontend/src/pages/writer/CreateStoryPage.tsx

    r0b502c2 r99c1e45  
    2121    short_description: '',
    2222    content: '',
     23    cover_image: '',
    2324    genres: [] as string[],
    2425    mature_content: false,
     
    4546      story_id: Date.now(),
    4647      ...form,
     48      cover_image: form.cover_image || undefined,
    4749      user_id: currentUser.user_id,
    4850      author_username: currentUser.username,
     
    124126              <span className="text-slate-600 text-xs">{form.short_description.length}/280</span>
    125127            </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            )}
    126145          </div>
    127146
Note: See TracChangeset for help on using the changeset viewer.