Commit bbb2eea1 authored by Jacob Karlsson's avatar Jacob Karlsson

Rename fourstate to contactEvent

parent 44184fc1
...@@ -50,9 +50,9 @@ export type Props = { ...@@ -50,9 +50,9 @@ export type Props = {
onPressAuthor?: (ev: {authorFeedId: FeedId}) => void; onPressAuthor?: (ev: {authorFeedId: FeedId}) => void;
}; };
type Fourstate = 'followed' | 'blocked' | 'unfollowed' | 'unblocked'; type ContactEvent = 'followed' | 'blocked' | 'unfollowed' | 'unblocked';
function pickFrom(t: Fourstate, followed: any, blocked: any, unfollowed: any, unblocked: any) { function pickFrom(t: ContactEvent, followed: any, blocked: any, unfollowed: any, unblocked: any) {
if (t === 'followed') return followed; if (t === 'followed') return followed;
if (t === 'blocked') return blocked; if (t === 'blocked') return blocked;
if (t === 'unfollowed') return unfollowed; if (t === 'unfollowed') return unfollowed;
...@@ -100,7 +100,7 @@ export default class ContactMessage extends Component<Props, {}> { ...@@ -100,7 +100,7 @@ export default class ContactMessage extends Component<Props, {}> {
return null return null
} }
const fourstate: Fourstate = msgBlocking === undefined const contactEvent: ContactEvent = msgBlocking === undefined
? msgFollowing === true ? msgFollowing === true
? 'followed' ? 'followed'
: 'unfollowed' : 'unfollowed'
...@@ -118,7 +118,7 @@ export default class ContactMessage extends Component<Props, {}> { ...@@ -118,7 +118,7 @@ export default class ContactMessage extends Component<Props, {}> {
), ),
h( h(
Text, Text,
pickFrom(fourstate, ' followed ', ' blocked ', ' unfollowed ', ' unblocked '), pickFrom(contactEvent, ' followed ', ' blocked ', ' unfollowed ', ' unblocked '),
), ),
h( h(
Text, Text,
...@@ -129,7 +129,7 @@ export default class ContactMessage extends Component<Props, {}> { ...@@ -129,7 +129,7 @@ export default class ContactMessage extends Component<Props, {}> {
]), ]),
h(View, {style: styles.row}, [ h(View, {style: styles.row}, [
pickFrom( pickFrom(
fourstate, contactEvent,
h(Icon, { h(Icon, {
size: Dimensions.iconSizeSmall, size: Dimensions.iconSizeSmall,
color: Palette.textPositive, color: Palette.textPositive,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment