mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 18:52:56 +00:00
dev day #70
This commit is contained in:
@@ -53,6 +53,7 @@ const PollLinker: React.FC<PollLinkerProps> = ({ articleId, eventId, onPollsChan
|
||||
title: '',
|
||||
description: '',
|
||||
type: 'single',
|
||||
style: 'auto',
|
||||
status: 'active',
|
||||
allow_multiple: false,
|
||||
max_choices: 1,
|
||||
@@ -199,6 +200,7 @@ const PollLinker: React.FC<PollLinkerProps> = ({ articleId, eventId, onPollsChan
|
||||
title: '',
|
||||
description: '',
|
||||
type: 'single',
|
||||
style: 'auto',
|
||||
status: 'active',
|
||||
allow_multiple: false,
|
||||
max_choices: 1,
|
||||
@@ -447,6 +449,29 @@ const PollLinker: React.FC<PollLinkerProps> = ({ articleId, eventId, onPollsChan
|
||||
</Select>
|
||||
</FormControl>
|
||||
|
||||
<FormControl>
|
||||
<FormLabel fontSize="sm">Styl</FormLabel>
|
||||
<Select
|
||||
size="sm"
|
||||
value={(newPollData as any).style || 'auto'}
|
||||
onChange={(e) => setNewPollData(prev => ({ ...prev, style: e.target.value as any }))}
|
||||
>
|
||||
<option value="auto">Automaticky</option>
|
||||
{newPollData.type === 'rating' ? (
|
||||
<>
|
||||
<option value="rating-stars">Hvězdičky</option>
|
||||
<option value="rating-scale">Číselná stupnice</option>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<option value="choices-list">Seznam</option>
|
||||
<option value="choices-chips">Štítky</option>
|
||||
<option value="choices-cards">Karty</option>
|
||||
</>
|
||||
)}
|
||||
</Select>
|
||||
</FormControl>
|
||||
|
||||
<FormControl>
|
||||
<FormLabel fontSize="sm">Možnosti (min. 2)</FormLabel>
|
||||
<VStack spacing={2} align="stretch">
|
||||
@@ -478,6 +503,42 @@ const PollLinker: React.FC<PollLinkerProps> = ({ articleId, eventId, onPollsChan
|
||||
>
|
||||
Přidat možnost
|
||||
</Button>
|
||||
<HStack>
|
||||
<Button size="xs" onClick={() => setNewPollData(prev => ({
|
||||
...prev,
|
||||
title: 'Hodnocení zápasu',
|
||||
description: 'Ohodnoťte zápas (1 = nejhorší, 5 = nejlepší)',
|
||||
type: 'rating',
|
||||
style: 'rating-stars',
|
||||
allow_multiple: false,
|
||||
max_choices: 1,
|
||||
options: Array.from({ length: 5 }).map((_, i) => ({ text: String(i+1), display_order: i+1 }))
|
||||
}))}>⭐ 5</Button>
|
||||
<Button size="xs" onClick={() => setNewPollData(prev => ({
|
||||
...prev,
|
||||
title: 'Hodnocení (1–10)',
|
||||
description: 'Ohodnoťte (1 = nejhorší, 10 = nejlepší)',
|
||||
type: 'rating',
|
||||
style: 'rating-scale',
|
||||
allow_multiple: false,
|
||||
max_choices: 1,
|
||||
options: Array.from({ length: 10 }).map((_, i) => ({ text: String(i+1), display_order: i+1 }))
|
||||
}))}>1–10</Button>
|
||||
<Button size="xs" onClick={() => setNewPollData(prev => ({
|
||||
...prev,
|
||||
title: 'Docházka',
|
||||
description: 'Dej vědět, zda dorazíš.',
|
||||
type: 'single',
|
||||
style: 'choices-chips',
|
||||
allow_multiple: false,
|
||||
max_choices: 1,
|
||||
options: [
|
||||
{ text: 'Ano', display_order: 0 },
|
||||
{ text: 'Ne', display_order: 1 },
|
||||
{ text: 'Možná', display_order: 2 },
|
||||
]
|
||||
}))}>Docházka</Button>
|
||||
</HStack>
|
||||
</VStack>
|
||||
</FormControl>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user