Skip to content

Commit 644c23a

Browse files
committed
formatted by prettoer
1 parent febd9ee commit 644c23a

File tree

1 file changed

+25
-21
lines changed

1 file changed

+25
-21
lines changed

example/src/App.tsx

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ import Intercom, {
2020
IntercomContent,
2121
} from '@intercom/intercom-react-native';
2222

23-
import {
23+
import {
2424
CAROUSEL_ID,
2525
SURVEY_ID,
2626
EVENT_NAME,
2727
ARTICLE_ID,
2828
USER_NAME,
2929
COLLECTION_ID,
3030
SEARCH_TERM,
31-
TOKEN
32-
} from './constants'
31+
TOKEN,
32+
} from './constants';
3333

3434
import Button from './components/Button';
3535
import Input from './components/Input';
@@ -83,19 +83,21 @@ export default function App() {
8383

8484
const resetAttributes = () => {
8585
setCount(0);
86-
Intercom.setBottomPadding(0).then(() =>
87-
setBottomPadding(0)
86+
Intercom.setBottomPadding(0).then(() => setBottomPadding(0));
87+
Intercom.setLauncherVisibility(Visibility.GONE).then(() =>
88+
setLauncherVisibility(false)
89+
);
90+
Intercom.setInAppMessageVisibility(Visibility.VISIBLE).then(() =>
91+
setInAppMessageVisibility(true)
8892
);
89-
Intercom.setLauncherVisibility(Visibility.GONE).then(() => setLauncherVisibility(false));
90-
Intercom.setInAppMessageVisibility(Visibility.VISIBLE).then(() => setInAppMessageVisibility(true));
9193
setArticleId(ARTICLE_ID);
9294
setCarouselId(CAROUSEL_ID);
9395
setSurveyId(SURVEY_ID);
9496
setEventName(EVENT_NAME);
9597
setCollectionId(COLLECTION_ID);
9698
setSearchTerm(SEARCH_TERM);
97-
setUserName(USER_NAME)
98-
}
99+
setUserName(USER_NAME);
100+
};
99101

100102
useEffect(() => {
101103
/**
@@ -166,14 +168,12 @@ export default function App() {
166168
</View>
167169
<View style={styles.stickyHeaderContainer}>
168170
<Text
169-
style={styles.text}
170-
accessibilityLabel={loggedUser ? 'authenticated' : 'unauthenticated'}
171-
>
172-
{`Logged In: ${loggedUser ? 'Yes' : 'No'}`}
173-
</Text>
174-
<Text style={styles.text}>
175-
Unread messages count: {count}
171+
style={styles.text}
172+
accessibilityLabel={loggedUser ? 'authenticated' : 'unauthenticated'}
173+
>
174+
{`Logged In: ${loggedUser ? 'Yes' : 'No'}`}
176175
</Text>
176+
<Text style={styles.text}>Unread messages count: {count}</Text>
177177
</View>
178178
<ScrollView>
179179
<Button
@@ -472,15 +472,19 @@ export default function App() {
472472
/>
473473
<Button
474474
intercom_accessibilityLabel="toggle-message-visibility"
475-
intercom_title={`Toggle In App Message Visibility: ${inAppMessageVisibility ? Visibility.VISIBLE : Visibility.GONE}`}
475+
intercom_title={`Toggle In App Message Visibility: ${
476+
inAppMessageVisibility ? Visibility.VISIBLE : Visibility.GONE
477+
}`}
476478
intercom_onPress={() => {
477479
Intercom.setInAppMessageVisibility(
478480
inAppMessageVisibility ? Visibility.GONE : Visibility.VISIBLE
479481
).then(() => setInAppMessageVisibility((v) => !v));
480482
}}
481483
/>
482484
<Button
483-
intercom_title={`Toggle In Launcher Visibility: ${launcherVisibility ? Visibility.VISIBLE : Visibility.GONE}`}
485+
intercom_title={`Toggle In Launcher Visibility: ${
486+
launcherVisibility ? Visibility.VISIBLE : Visibility.GONE
487+
}`}
484488
intercom_accessibilityLabel="toggle-launcher-visibility"
485489
intercom_onPress={() => {
486490
Intercom.setLauncherVisibility(
@@ -512,7 +516,7 @@ export default function App() {
512516
intercom_disabled={!loggedUser}
513517
intercom_title="Reset Attributes"
514518
intercom_onPress={() => {
515-
resetAttributes()
519+
resetAttributes();
516520
}}
517521
/>
518522
<Button
@@ -566,5 +570,5 @@ const styles = StyleSheet.create({
566570
backgroundColor: 'green',
567571
borderRadius: 3,
568572
marginBottom: 5,
569-
}
570-
});
573+
},
574+
});

0 commit comments

Comments
 (0)