From f01677a0072be884e4d3b2658f469953a89a921d Mon Sep 17 00:00:00 2001 From: Ivan Sekovanikj Date: Thu, 26 Feb 2026 12:18:18 +0100 Subject: [PATCH 01/16] feat: redesign poll results screen --- .../Poll/components/PollButtons.tsx | 27 +++---- .../Poll/components/PollModalHeader.tsx | 81 ++++++++++++++----- .../components/PollResults/PollResultItem.tsx | 79 ++++++++++++------ .../components/PollResults/PollResults.tsx | 77 +++++++++++++----- .../Poll/components/PollResults/PollVote.tsx | 55 ++++++++----- .../src/contexts/themeContext/utils/theme.ts | 4 + 6 files changed, 221 insertions(+), 102 deletions(-) diff --git a/package/src/components/Poll/components/PollButtons.tsx b/package/src/components/Poll/components/PollButtons.tsx index 20b3dfbbb3..aa30911df2 100644 --- a/package/src/components/Poll/components/PollButtons.tsx +++ b/package/src/components/Poll/components/PollButtons.tsx @@ -29,11 +29,6 @@ export const ViewResultsButton = (props: PollButtonProps) => { setShowResults(true); }, [message, onPress, poll]); - const { - theme: { - colors: { white }, - }, - } = useTheme(); const styles = useStyles(); const onRequestClose = useCallback(() => { @@ -50,7 +45,7 @@ export const ViewResultsButton = (props: PollButtonProps) => { /> {showResults ? ( - + @@ -80,11 +75,7 @@ export const ShowAllOptionsButton = (props: PollButtonProps) => { setShowAllOptions(false); }, []); - const { - theme: { - colors: { white }, - }, - } = useTheme(); + const styles = useStyles(); return ( <> @@ -96,7 +87,7 @@ export const ShowAllOptionsButton = (props: PollButtonProps) => { ) : null} {showAllOptions ? ( - + @@ -122,11 +113,7 @@ export const ShowAllCommentsButton = (props: PollButtonProps) => { setShowAnswers(true); }, [message, onPress, poll]); - const { - theme: { - colors: { white }, - }, - } = useTheme(); + const styles = useStyles(); const onRequestClose = useCallback(() => { setShowAnswers(false); @@ -142,7 +129,7 @@ export const ShowAllCommentsButton = (props: PollButtonProps) => { ) : null} {showAnswers ? ( - + @@ -275,6 +262,10 @@ const useStyles = () => { ? semantics.chatBorderOnChatOutgoing : semantics.chatBorderOnChatIncoming, }, + safeArea: { + backgroundColor: semantics.backgroundElevationElevation1, + flex: 1, + }, }); }, [semantics, isPollCreatedByClient]); }; diff --git a/package/src/components/Poll/components/PollModalHeader.tsx b/package/src/components/Poll/components/PollModalHeader.tsx index 9b8486a148..5b73a83bd0 100644 --- a/package/src/components/Poll/components/PollModalHeader.tsx +++ b/package/src/components/Poll/components/PollModalHeader.tsx @@ -1,8 +1,10 @@ -import React from 'react'; -import { Pressable, StyleSheet, Text, View } from 'react-native'; +import React, { useMemo } from 'react'; +import { StyleSheet, Text, View } from 'react-native'; import { useTheme } from '../../../contexts'; -import { Back } from '../../../icons'; +import { NewCross } from '../../../icons/NewCross'; +import { primitives } from '../../../theme'; +import { Button } from '../../ui'; export type PollModalHeaderProps = { onPress: () => void; @@ -12,31 +14,70 @@ export type PollModalHeaderProps = { export const PollModalHeader = ({ onPress, title }: PollModalHeaderProps) => { const { theme: { - colors: { black, text_high_emphasis, white }, poll: { modalHeader: { container, title: titleStyle }, }, }, } = useTheme(); + const styles = useStyles(); return ( - - ({ opacity: pressed ? 0.5 : 1 })}> - - - - {title} - + + +