mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 02:32:57 +00:00
dev day #99
This commit is contained in:
@@ -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>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user