Skip to content

Commit

Permalink
bug-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ritz078 committed Apr 4, 2019
1 parent 61492c1 commit 3cc87e8
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 51 deletions.
2 changes: 1 addition & 1 deletion src/components/typings/List.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export interface ListProps {
iconName?: string;
iconColor?: string;
iconBackgroundColor?: string;
title: string;
title: React.ReactText | JSX.Element;
description: JSX.Element | React.ReactText;
topRightElement?: JSX.Element | React.ReactText;
style?: any;
Expand Down
107 changes: 61 additions & 46 deletions src/recipes/Viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ export default class extends PureComponent<ViewerProps, ViewerState> {
const {
onTranferRequest,
onUnfollowRequest,
agents,
viewers,
owner,
onCall
onCall,
disabled
} = this.props;

const {
Expand Down Expand Up @@ -119,10 +119,17 @@ export default class extends PureComponent<ViewerProps, ViewerState> {

{this.isUser(owner.id) ? (
<Select
options={agents}
options={viewers}
disabled={disabled}
ref={this.selectRef}
label={() => (
<Text color={colors.violet.base}>Transfer Ownership</Text>
<Text
color={
disabled ? colors.violet.light : colors.violet.base
}
>
Transfer Ownership
</Text>
)}
onSelect={({ id }) =>
this.setState({
Expand Down Expand Up @@ -168,50 +175,58 @@ export default class extends PureComponent<ViewerProps, ViewerState> {
</View>
</View>

<InfoCard style={viewerInfoCard} title="Viewers">
{viewers.map(viewer => (
<View
key={viewer.id}
style={[
styles.container,
{
paddingVertical: 15
}
]}
>
<View style={styles.rowLeft}>
<CircularButton
style={styles.circButton}
label={nI(viewer.name)}
color={colors.white.base}
backgroundColor={colors.blue.base}
/>
<View style={{ flex: 1 }}>
<Text color={colors.gray.darker} size={15}>
{this.isUser(viewer.id) ? "You" : viewer.name}
</Text>
{viewer.subText}
</View>

{this.isUser(viewer.id) ? (
<Text
color={colors.violet.base}
onPress={this.openUnfollowConfirmationModal}
>
Unfollow
</Text>
) : (
<Icon
name="phone-filled"
color={colors.violet.base}
size={18}
onPress={() => onCall(viewer.phone)}
{viewers && (
<InfoCard style={viewerInfoCard} title="Viewers">
{viewers.map(viewer => (
<View
key={viewer.id}
style={[
styles.container,
{
paddingVertical: 15
}
]}
>
<View style={styles.rowLeft}>
<CircularButton
style={styles.circButton}
label={nI(viewer.name)}
color={colors.white.base}
backgroundColor={colors.blue.base}
/>
)}
<View style={{ flex: 1 }}>
<Text color={colors.gray.darker} size={15}>
{this.isUser(viewer.id) ? "You" : viewer.name}
</Text>
{viewer.subText}
</View>

{this.isUser(viewer.id) ? (
<Text
color={
disabled ? colors.violet.light : colors.violet.base
}
onPress={
!disabled
? this.openUnfollowConfirmationModal
: undefined
}
>
Unfollow
</Text>
) : (
<Icon
name="phone-filled"
color={colors.violet.base}
size={18}
onPress={() => onCall(viewer.phone)}
/>
)}
</View>
</View>
</View>
))}
</InfoCard>
))}
</InfoCard>
)}
</InfoCard>

<ConfirmationPopUp
Expand Down
5 changes: 1 addition & 4 deletions src/recipes/typings/Viewer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@ interface Agent {
export interface ViewerProps {
onTranferRequest: (args: { agentId: number; follow: boolean }) => void;
onUnfollowRequest: () => void;
agents: {
id: boolean;
label: string;
}[];
viewers: Agent[];
owner: Agent;
userId: number;
onCall: (phone: string) => void;
disabled?: boolean;
}

export interface ViewerState {
Expand Down

0 comments on commit 3cc87e8

Please sign in to comment.