added link component with some tweaks to transaction list #98

Merged
akinwale merged 4 commits from links into master 2018-05-10 19:38:08 +02:00
akinwale commented 2018-05-04 04:15:01 +02:00 (Migrated from github.com)
No description provided.
neb-b (Migrated from github.com) requested changes 2018-05-04 04:34:33 +02:00
neb-b (Migrated from github.com) commented 2018-05-04 04:34:07 +02:00

I think it would make more sense to add to the <Link /> component. Just use an href prop or something. You could also move the notify call and just use an errorMessage prop.

I think it would make more sense to add to the `<Link />` component. Just use an `href` prop or something. You could also move the `notify` call and just use an `errorMessage` prop.
akinwale (Migrated from github.com) reviewed 2018-05-05 16:23:37 +02:00
akinwale (Migrated from github.com) commented 2018-05-05 16:23:37 +02:00

@seanyesmunt I've pushed a new commit with the requested changes.

@seanyesmunt I've pushed a new commit with the requested changes.
neb-b (Migrated from github.com) reviewed 2018-05-10 18:34:17 +02:00
@ -28,3 +35,3 @@
<View style={transactionListStyle.row}>
<View style={transactionListStyle.col}>
<Text style={[transactionListStyle.smallText, transactionListStyle.txid]}>{txid.substring(0, 8)}</Text>
<Link style={transactionListStyle.smallLink}
neb-b (Migrated from github.com) commented 2018-05-10 18:34:17 +02:00

Will this try opening the browser?

+    if (navigation && href.startsWith('#')) {
+      navigation.navigate(href.substring(1));
+    } else {
+      Linking.openURL(href).catch(err => notify({
+        message: error,
+        displayType: ['toast']
+      }));
+    }

I think it will go into the else block and try opening the browser with no href.

Will this try opening the browser? ``` + if (navigation && href.startsWith('#')) { + navigation.navigate(href.substring(1)); + } else { + Linking.openURL(href).catch(err => notify({ + message: error, + displayType: ['toast'] + })); + } ``` I think it will go into the `else` block and try opening the browser with no href.
akinwale (Migrated from github.com) reviewed 2018-05-10 18:40:40 +02:00
@ -28,3 +35,3 @@
<View style={transactionListStyle.row}>
<View style={transactionListStyle.col}>
<Text style={[transactionListStyle.smallText, transactionListStyle.txid]}>{txid.substring(0, 8)}</Text>
<Link style={transactionListStyle.smallLink}
akinwale (Migrated from github.com) commented 2018-05-10 18:40:40 +02:00

I have the onPress specified explicitly for this link, which overrides the onPress in the component itself. Basically, the idea is you can override the default implemented Link opening behaviour if you want to implement some custom logic.

I have the `onPress` specified explicitly for this link, which overrides the `onPress` in the component itself. Basically, the idea is you can override the default implemented Link opening behaviour if you want to implement some custom logic.
neb-b (Migrated from github.com) reviewed 2018-05-10 18:41:24 +02:00
@ -28,3 +35,3 @@
<View style={transactionListStyle.row}>
<View style={transactionListStyle.col}>
<Text style={[transactionListStyle.smallText, transactionListStyle.txid]}>{txid.substring(0, 8)}</Text>
<Link style={transactionListStyle.smallLink}
neb-b (Migrated from github.com) commented 2018-05-10 18:41:24 +02:00

Ah I see that now. Cool

Ah I see that now. Cool
neb-b (Migrated from github.com) approved these changes 2018-05-10 18:41:29 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-android#98
No description provided.