Skip to content

Commit b196c9c

Browse files
committed
fix: poll styles
1 parent 43a59b1 commit b196c9c

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

package/src/components/Poll/components/CreatePollOptions.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ const styles = StyleSheet.create({
333333
optionInput: {
334334
flex: 1,
335335
fontSize: 16,
336+
paddingRight: 4,
336337
paddingVertical: 0, // android is adding extra padding so we remove it
337338
},
338339
optionValidationError: { fontSize: 12, left: 16, position: 'absolute', top: 4 },

package/src/components/Poll/components/PollOption.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export const PollOption = ({ option, showProgressBar = true }: PollOptionProps)
116116
progressBarVotedFill,
117117
progressBarWinnerFill,
118118
text,
119+
votesContainer,
119120
wrapper,
120121
},
121122
},
@@ -127,8 +128,10 @@ export const PollOption = ({ option, showProgressBar = true }: PollOptionProps)
127128
<View style={[styles.wrapper, wrapper]}>
128129
<View style={[styles.container, container]}>
129130
<VoteButton option={option} />
130-
<Text style={[styles.text, { color: black }, text]}>{option.text}</Text>
131-
<View style={{ flexDirection: 'row' }}>
131+
<View style={{ flex: 1, alignItems: 'flex-start', justifyContent: 'flex-start' }}>
132+
<Text style={[styles.text, { color: black }, text]}>{option.text}</Text>
133+
</View>
134+
<View style={[styles.votesContainer, votesContainer]}>
132135
{relevantVotes.map((vote: PollVote) => (
133136
<Avatar image={vote.user?.image as string} key={vote.id} size={20} />
134137
))}
@@ -176,6 +179,10 @@ const styles = StyleSheet.create({
176179
allOptionsWrapper: { flex: 1, marginBottom: 16, padding: 16 },
177180
container: { flexDirection: 'row' },
178181
progressBar: { borderRadius: 4, flex: 1, flexDirection: 'row', height: 4, marginTop: 2 },
179-
text: { flex: 1, fontSize: 16, marginLeft: 4 },
182+
text: {
183+
fontSize: 16,
184+
marginLeft: 4,
185+
},
186+
votesContainer: { flexDirection: 'row', marginLeft: 4 },
180187
wrapper: { marginTop: 8, paddingVertical: 8 },
181188
});

package/src/contexts/themeContext/utils/theme.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,7 @@ export type Theme = {
710710
voteButtonActive: string;
711711
voteButtonContainer: ViewStyle;
712712
voteButtonInactive: string;
713+
votesContainer: ViewStyle;
713714
wrapper: ViewStyle;
714715
};
715716
optionsWrapper: ViewStyle;
@@ -1452,6 +1453,7 @@ export const defaultTheme: Theme = {
14521453
voteButtonActive: '',
14531454
voteButtonContainer: {},
14541455
voteButtonInactive: '',
1456+
votesContainer: {},
14551457
wrapper: {},
14561458
},
14571459
optionsWrapper: {},

0 commit comments

Comments
 (0)