This commit is contained in:
Tomas Dvorak
2025-11-21 08:44:44 +01:00
parent c941313fd5
commit f5b6f83974
108 changed files with 8642 additions and 5871 deletions
+12 -1
View File
@@ -19,6 +19,8 @@ interface EmbeddedPollProps {
title?: string;
showTitle?: boolean;
maxPolls?: number;
// When true, render without outer background/padding so parent wrapper controls layout
unstyled?: boolean;
}
/**
@@ -32,6 +34,7 @@ const EmbeddedPoll: React.FC<EmbeddedPollProps> = ({
title = 'Hlasování',
showTitle = true,
maxPolls,
unstyled = false,
}) => {
const bgSection = useColorModeValue('gray.50', 'gray.900');
@@ -100,8 +103,13 @@ const EmbeddedPoll: React.FC<EmbeddedPollProps> = ({
return null;
}
// Wrapper styling: allow transparent/compact when unstyled
const wrapperProps = unstyled
? { bg: 'transparent', py: 0, px: 0, borderRadius: 'none' as any, my: 0 }
: { bg: bgSection, py: 8, px: 4, borderRadius: 'xl' as any, my: 8 };
return (
<Box bg={bgSection} py={8} px={4} borderRadius="xl" my={8}>
<Box {...wrapperProps}>
<VStack spacing={6} maxW="6xl" mx="auto">
{showTitle && (
<Heading size="md" textAlign="center">
@@ -139,6 +147,7 @@ const EmbeddedPoll: React.FC<EmbeddedPollProps> = ({
hasVoted={pollResponse.has_voted}
isActive={pollResponse.is_active}
canShowResults={pollResponse.can_show_results}
flat={unstyled}
/>
</Box>
);
@@ -153,6 +162,7 @@ const EmbeddedPoll: React.FC<EmbeddedPollProps> = ({
hasVoted={pollResponse.has_voted}
isActive={pollResponse.is_active}
canShowResults={pollResponse.can_show_results}
flat={unstyled}
/>
</Box>
))}
@@ -168,6 +178,7 @@ const EmbeddedPoll: React.FC<EmbeddedPollProps> = ({
hasVoted={pollResponse.has_voted}
isActive={pollResponse.is_active}
canShowResults={pollResponse.can_show_results}
flat={unstyled}
/>
</Box>
))}