Some style fixes

This commit is contained in:
Adolfo Reyna
2023-01-25 14:34:23 -05:00
parent 93b84ada33
commit 03e20edbcc
7 changed files with 17 additions and 14 deletions

View File

@@ -53,6 +53,7 @@ let MenuView = ({ navigation }) => {
left={props => <List.Icon {...props} icon={icon} />} left={props => <List.Icon {...props} icon={icon} />}
titleStyle={{fontWeight:"bold"}} titleStyle={{fontWeight:"bold"}}
descriptionNumberOfLines={3} descriptionNumberOfLines={3}
key={profile._id}
/> />
</> </>
}) })

View File

@@ -103,7 +103,7 @@ let NewPostView = (props) => {
return ( return (
<SafeAreaView> <SafeAreaView>
<View style={{ padding: 10 }}> <View style={{ padding: 10}}>
<View style={{ flexDirection: "row", marginBottom: 10, justifyContent: "space-around" }}> <View style={{ flexDirection: "row", marginBottom: 10, justifyContent: "space-around" }}>
<Text style={{ fontSize: 25 }}>{i18n.t("message.statusUpdate")}:</Text> <Text style={{ fontSize: 25 }}>{i18n.t("message.statusUpdate")}:</Text>
<Button icon="send" mode="outlined" onPress={handleNewPostButton}> <Button icon="send" mode="outlined" onPress={handleNewPostButton}>
@@ -127,6 +127,7 @@ let NewPostView = (props) => {
textAlignVertical: "center", textAlignVertical: "center",
textAlign: "center", textAlign: "center",
fontSize: 20, fontSize: 20,
minHeight: 200
}} }}
autoFocus={true} autoFocus={true}
/> />

View File

@@ -3,6 +3,7 @@ import { Text, View, ScrollView, StyleSheet } from 'react-native';
import { FAB, Button, Card, Title, IconButton } from 'react-native-paper'; import { FAB, Button, Card, Title, IconButton } from 'react-native-paper';
import API from './../API.js'; import API from './../API.js';
import UserName from './UserName.js'; import UserName from './UserName.js';
import Media from './Media.js';
import { useSnapshot } from 'valtio'; import { useSnapshot } from 'valtio';
import GlobalState from '../contexts/GlobalState.js'; import GlobalState from '../contexts/GlobalState.js';
import Moment from 'moment'; import Moment from 'moment';
@@ -14,6 +15,7 @@ let Comment = ({ comment, postid }) => {
const gState = useSnapshot(GlobalState); const gState = useSnapshot(GlobalState);
const viewer = gState.me; const viewer = gState.me;
let [likes, changeLikes] = useState(Object.keys(comment.reactions).length); let [likes, changeLikes] = useState(Object.keys(comment.reactions).length);
let cleanContent = comment.content.replace(/@[A-z]+:.+\w/g, '');
const newCommentReaction = () => { const newCommentReaction = () => {
if (!comment.reactions[viewer._id]) { if (!comment.reactions[viewer._id]) {
comment.reactions[viewer._id] = { type: "like" }; comment.reactions[viewer._id] = { type: "like" };
@@ -44,8 +46,8 @@ let Comment = ({ comment, postid }) => {
>{likes ? likes : ''}</Button> >{likes ? likes : ''}</Button>
</View> </View>
</View> </View>
<Text style={{fontSize: 16}}>{comment.content}</Text> <Text style={{fontSize: 14}}>{cleanContent}</Text>
<Media content={comment.content} postId={postid} skiptVideo={true}/>
</Card.Content> </Card.Content>
</Card> </Card>
); );

View File

@@ -88,7 +88,7 @@ const styles = StyleSheet.create({
content: { content: {
margin: 4, margin: 4,
padding: 0, padding: 0,
borderRadius: 10, borderRadius: 5,
}, },
centerItems: { centerItems: {
justifyContent: 'center', justifyContent: 'center',

View File

@@ -82,7 +82,7 @@ let Media = (props) => {
subscribed = false; subscribed = false;
}; };
}, [props.content]) }, [props.content])
const video = videosFiles.length ? ( const video = (videosFiles.length && !props.skiptVideo) ? (
loaded ? <VideoPlayer videosFiles={videosFiles} poster={poster} videoId={videosId[1]} /> : loaded ? <VideoPlayer videosFiles={videosFiles} poster={poster} videoId={videosId[1]} /> :
( (
<TouchableHighlight onPress={() => setLoaded(true)}> <TouchableHighlight onPress={() => setLoaded(true)}>
@@ -91,7 +91,7 @@ let Media = (props) => {
) )
) : ) :
(videosId.length ? <VimeoPlayer videoId={videosId[1]} /> : <></>); (videosId.length ? <VimeoPlayer videoId={videosId[1]} /> : <></>);
const video2 = hlsUrl ? ( const video2 = (hlsUrl && !props.skiptVideo) ? (
loaded ? loaded ?
<VideoPlayer videoUrl={hlsUrl} postId={props.postId} /> : <VideoPlayer videoUrl={hlsUrl} postId={props.postId} /> :
<TouchableHighlight onPress={() => { <TouchableHighlight onPress={() => {

View File

@@ -69,7 +69,7 @@ let Post = (props) => {
{" " + Moment(post.createdAt).fromNow()} {" " + Moment(post.createdAt).fromNow()}
</Text> </Text>
</Text> </Text>
<Text style={{ fontSize: 18 }}>{cleanContent}</Text> <Text style={{ fontSize: 16, paddingBottom:5 }}>{cleanContent}</Text>
<Media content={post.content} postId={post._id} post={post} /> <Media content={post.content} postId={post._id} post={post} />
</View> : </View> :
<View> <View>
@@ -120,12 +120,12 @@ const styles = StyleSheet.create({
fontSize: 14, fontSize: 14,
fontWeight: 'bold', fontWeight: 'bold',
marginBottom: 5, marginBottom: 5,
fontSize: 18, fontSize: 17,
}, },
card: { card: {
margin: 8, margin: 8,
backgroundColor: "#FFFFFF", backgroundColor: "#FFFFFF",
borderRadius: 10, borderRadius: 5,
}, },
comment: { comment: {
margin: 8, margin: 8,

View File

@@ -50,6 +50,7 @@ let UserName = ({ profileid, hideIcon }) => {
icon = icon === "person-outline" && profile.subscription && profile.subscription > (new Date() - 0) ? "assignment-ind" : icon; icon = icon === "person-outline" && profile.subscription && profile.subscription > (new Date() - 0) ? "assignment-ind" : icon;
icon = icon === "group" && profile.isCourse ? "subscriptions" : icon; icon = icon === "group" && profile.isCourse ? "subscriptions" : icon;
icon = icon === "group" && profile.isPrivate ? "screen-lock-portrait" : icon; icon = icon === "group" && profile.isPrivate ? "screen-lock-portrait" : icon;
const fullName = " " + profile.profile?.firstName + " " + profile.profile?.lastName;
const onPress = () => { const onPress = () => {
return navigation.navigate('Profile', { profileid }) return navigation.navigate('Profile', { profileid })
@@ -57,11 +58,9 @@ let UserName = ({ profileid, hideIcon }) => {
return ( return (
<Text onPress={onPress}> <Text onPress={onPress}>
<Text style={{ paddingTop: 10 }}> {!hideIcon ?
{!hideIcon ? <Icon name={icon} size={18} /> : <></>} <Icon name={icon} style={{fontSize:13, marginRight: 10}} /> : <></>}
</Text> {fullName}
<Text> {profile.profile && profile.profile.firstName} {profile.profile && profile.profile.lastName}</Text>
</Text> </Text>
); );
} }