Barazo default frontend barazo.forum
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(admin): add recommended dimensions and format hints to image uploads (#147)

authored by

Guido X Jansen and committed by
GitHub
4f33f65d 4d1d76ad

+30 -18
+4 -2
src/app/admin/design/page.test.tsx
··· 56 56 expect(screen.getByRole('heading', { name: /design/i })).toBeInTheDocument() 57 57 }) 58 58 59 - it('renders logo upload section', async () => { 59 + it('renders logo upload section with help text', async () => { 60 60 render(<AdminDesignPage />) 61 61 await waitFor(() => { 62 62 expect(screen.getByText('Community Logo')).toBeInTheDocument() 63 63 }) 64 + expect(screen.getByText(/512×512px.*JPEG, PNG, WebP, GIF/)).toBeInTheDocument() 64 65 }) 65 66 66 - it('renders favicon upload section', async () => { 67 + it('renders favicon upload section with help text', async () => { 67 68 render(<AdminDesignPage />) 68 69 await waitFor(() => { 69 70 expect(screen.getByText('Favicon')).toBeInTheDocument() 70 71 }) 72 + expect(screen.getByText(/256×256px.*JPEG, PNG, WebP, GIF/)).toBeInTheDocument() 71 73 }) 72 74 73 75 it('renders primary color input', async () => {
+26 -16
src/components/admin/design/design-images-section.tsx
··· 26 26 <fieldset className="space-y-6"> 27 27 <legend className="text-sm font-medium text-foreground">Images</legend> 28 28 29 - <ImageUpload 30 - currentUrl={settings.communityLogoUrl} 31 - onUpload={onLogoUpload} 32 - onRemove={onLogoRemove} 33 - label="Community Logo" 34 - aspectRatio="1/1" 35 - className="w-40" 36 - /> 29 + <div> 30 + <ImageUpload 31 + currentUrl={settings.communityLogoUrl} 32 + onUpload={onLogoUpload} 33 + onRemove={onLogoRemove} 34 + label="Community Logo" 35 + aspectRatio="1/1" 36 + className="w-40" 37 + /> 38 + <p className="mt-1.5 text-xs text-muted-foreground"> 39 + Recommended: 512&times;512px. Accepted formats: JPEG, PNG, WebP, GIF. 40 + </p> 41 + </div> 37 42 38 - <ImageUpload 39 - currentUrl={settings.faviconUrl} 40 - onUpload={onFaviconUpload} 41 - onRemove={onFaviconRemove} 42 - label="Favicon" 43 - aspectRatio="1/1" 44 - className="w-16" 45 - /> 43 + <div> 44 + <ImageUpload 45 + currentUrl={settings.faviconUrl} 46 + onUpload={onFaviconUpload} 47 + onRemove={onFaviconRemove} 48 + label="Favicon" 49 + aspectRatio="1/1" 50 + className="w-16" 51 + /> 52 + <p className="mt-1.5 text-xs text-muted-foreground"> 53 + Recommended: 256&times;256px. Accepted formats: JPEG, PNG, WebP, GIF. 54 + </p> 55 + </div> 46 56 </fieldset> 47 57 ) 48 58 }