From cf6988ffcd8b4e65fb045ee1825e2b1359371065 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Wed, 6 Jun 2018 09:42:19 +0100 Subject: [PATCH] Make channel names displayed on file items and the file page touchable --- app/src/component/fileItem/view.js | 6 +++++- app/src/page/file/view.js | 11 +++++++++-- app/src/styles/discover.js | 4 ++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/src/component/fileItem/view.js b/app/src/component/fileItem/view.js index 4e418bdb..1743e5b2 100644 --- a/app/src/component/fileItem/view.js +++ b/app/src/component/fileItem/view.js @@ -4,6 +4,7 @@ import { NavigationActions } from 'react-navigation'; import { NativeModules, Text, View, TouchableOpacity } from 'react-native'; import FileItemMedia from '../fileItemMedia'; import FilePrice from '../filePrice'; +import Link from '../link'; import NsfwOverlay from '../nsfwOverlay'; import discoverStyle from '../../styles/discover'; @@ -68,7 +69,10 @@ class FileItem extends React.PureComponent { {title} {channelName && - {channelName}} + { + const channelUri = normalizeURI(channelName); + navigation.navigate({ routeName: 'File', key: channelUri, params: { uri: channelUri }}); + }} />} {obscureNsfw && navigation.navigate('Settings')} />} diff --git a/app/src/page/file/view.js b/app/src/page/file/view.js index 746987e5..3ddac55e 100644 --- a/app/src/page/file/view.js +++ b/app/src/page/file/view.js @@ -1,5 +1,5 @@ import React from 'react'; -import { Lbry } from 'lbry-redux'; +import { Lbry, normalizeURI } from 'lbry-redux'; import { ActivityIndicator, Alert, @@ -20,6 +20,7 @@ import ChannelPage from '../channel'; import FileDownloadButton from '../../component/fileDownloadButton'; import FileItemMedia from '../../component/fileItemMedia'; import FilePrice from '../../component/filePrice'; +import Link from '../../component/link'; import MediaPlayer from '../../component/mediaPlayer'; import UriBar from '../../component/uriBar'; import Video from 'react-native-video'; @@ -245,7 +246,13 @@ class FilePage extends React.PureComponent { } {title} - {channelName && {channelName}} + {channelName && { + const channelUri = normalizeURI(channelName); + navigation.navigate({ routeName: 'File', key: channelUri, params: { uri: channelUri }}); + }} />} {description && {description}} diff --git a/app/src/styles/discover.js b/app/src/styles/discover.js index 2d04307a..96c9b6aa 100644 --- a/app/src/styles/discover.js +++ b/app/src/styles/discover.js @@ -42,11 +42,11 @@ const discoverStyle = StyleSheet.create({ fileItemName: { fontFamily: 'Metropolis-Bold', marginTop: 8, - fontSize: 16 + fontSize: 18 }, channelName: { fontFamily: 'Metropolis-SemiBold', - fontSize: 14, + fontSize: 16, marginTop: 4, color: '#c0c0c0' }, -- 2.45.3