be-components 3.5.1 → 3.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/Competition/index.js +7 -1
- package/lib/commonjs/Competition/index.js.map +1 -1
- package/lib/commonjs/SocialComponents/PostCard/components/DraftTextViewer.js.map +1 -1
- package/lib/commonjs/SocialComponents/PostCard/components/PostHeader.js +11 -9
- package/lib/commonjs/SocialComponents/PostCard/components/PostHeader.js.map +1 -1
- package/lib/commonjs/SocialComponents/PostCard/components/PostReactionBar.js +18 -18
- package/lib/commonjs/SocialComponents/PostCard/components/PostReactionBar.js.map +1 -1
- package/lib/commonjs/SocialComponents/PostCard/index.js +35 -35
- package/lib/commonjs/SocialComponents/PostCard/index.js.map +1 -1
- package/lib/commonjs/SocialComponents/SocialOrderCard.js +64 -48
- package/lib/commonjs/SocialComponents/SocialOrderCard.js.map +1 -1
- package/lib/commonjs/SocialComponents/SocialOrdersList.js +3 -2
- package/lib/commonjs/SocialComponents/SocialOrdersList.js.map +1 -1
- package/lib/commonjs/SocialComponents/index.js +7 -0
- package/lib/commonjs/SocialComponents/index.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/Competition/index.js +8 -2
- package/lib/module/Competition/index.js.map +1 -1
- package/lib/module/SocialComponents/PostCard/components/DraftTextViewer.js.map +1 -1
- package/lib/module/SocialComponents/PostCard/components/PostHeader.js +8 -6
- package/lib/module/SocialComponents/PostCard/components/PostHeader.js.map +1 -1
- package/lib/module/SocialComponents/PostCard/components/PostReactionBar.js +14 -13
- package/lib/module/SocialComponents/PostCard/components/PostReactionBar.js.map +1 -1
- package/lib/module/SocialComponents/PostCard/index.js +30 -30
- package/lib/module/SocialComponents/PostCard/index.js.map +1 -1
- package/lib/module/SocialComponents/SocialOrderCard.js +46 -30
- package/lib/module/SocialComponents/SocialOrderCard.js.map +1 -1
- package/lib/module/SocialComponents/SocialOrdersList.js +2 -1
- package/lib/module/SocialComponents/SocialOrdersList.js.map +1 -1
- package/lib/module/SocialComponents/index.js +2 -1
- package/lib/module/SocialComponents/index.js.map +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/Competition/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/PostCard/components/PostHeader.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/PostCard/components/PostReactionBar.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/PostCard/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/SocialOrderCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/SocialOrdersList.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/index.d.ts +1 -0
- package/lib/typescript/lib/commonjs/index.d.ts +9 -0
- package/lib/typescript/lib/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Competition/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/PostCard/components/PostHeader.d.ts +1 -2
- package/lib/typescript/lib/module/SocialComponents/PostCard/components/PostHeader.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/PostCard/components/PostReactionBar.d.ts +1 -2
- package/lib/typescript/lib/module/SocialComponents/PostCard/components/PostReactionBar.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/PostCard/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/SocialOrderCard.d.ts +1 -2
- package/lib/typescript/lib/module/SocialComponents/SocialOrderCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/SocialOrdersList.d.ts +1 -2
- package/lib/typescript/lib/module/SocialComponents/SocialOrdersList.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/index.d.ts +2 -1
- package/lib/typescript/lib/module/SocialComponents/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/index.d.ts +2 -1
- package/lib/typescript/lib/module/index.d.ts.map +1 -1
- package/lib/typescript/src/Competition/index.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/PostCard/components/DraftTextViewer.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/PostCard/components/PostHeader.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/PostCard/components/PostReactionBar.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/PostCard/index.d.ts +4 -3
- package/lib/typescript/src/SocialComponents/PostCard/index.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/SocialOrderCard.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/SocialOrdersList.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/index.d.ts +2 -1
- package/lib/typescript/src/SocialComponents/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Competition/index.tsx +19 -13
- package/src/SocialComponents/PostCard/components/DraftTextViewer.tsx +5 -4
- package/src/SocialComponents/PostCard/components/PostHeader.tsx +6 -7
- package/src/SocialComponents/PostCard/components/PostReactionBar.tsx +13 -14
- package/src/SocialComponents/PostCard/index.tsx +33 -26
- package/src/SocialComponents/SocialOrderCard.tsx +29 -28
- package/src/SocialComponents/SocialOrdersList.tsx +2 -1
- package/src/SocialComponents/index.tsx +3 -1
- package/src/index.tsx +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAC,cAAc,EAAC,MAAM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a,MAAM,4BAA4B,CAAC;AACvD,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,gBAAgB,MAAM,wDAAwD,CAAC;AACtF,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,eAAe,MAAM,qCAAqC,CAAC;AAClE,OAAO,sBAAsB,MAAM,4CAA4C,CAAC;AAChF,OAAO,sBAAsB,MAAM,4CAA4C,CAAC;AAChF,OAAO,UAAU,MAAM,gCAAgC,CAAC;AACxD,OAAO,kBAAkB,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,EACL,aAAa,EACb,QAAQ,EACR,UAAU,EACV,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,OAAO,EACP,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,EACpB,QAAQ,EACR,UAAU,EACV,WAAW,EACX,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,UAAU,EACX,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { CompetitionApi, CompetitionHelpers, CompetitionMatchApi, CompetitionPlayerApi, PlayerPicksApi } from './api';
|
|
3
|
-
import { Image, ActivityIndicator, Modal, FlatList } from 'react-native';
|
|
3
|
+
import { Image, ActivityIndicator, Modal, FlatList, KeyboardAvoidingView, Platform } from 'react-native';
|
|
4
4
|
import { view_styles } from '../constants/styles';
|
|
5
5
|
import { ConfirmationModal, Icons } from '../Components';
|
|
6
6
|
import Colors from '../constants/colors';
|
|
@@ -518,18 +518,24 @@ const CompetitionModule = ({ competition_id, player_id, confirm_padding, onManag
|
|
|
518
518
|
onRequestClose={() => setShowEnterPrompt(false)}
|
|
519
519
|
animationType='slide'
|
|
520
520
|
>
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
521
|
+
<KeyboardAvoidingView
|
|
522
|
+
style={{ flex:1 }}
|
|
523
|
+
keyboardVerticalOffset={-150}
|
|
524
|
+
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
|
525
|
+
>
|
|
526
|
+
<View type='blur' style={{ flex:1, justifyContent:'flex-end' }}>
|
|
527
|
+
<WagerPickForm
|
|
528
|
+
event_start={draft_player_pick.event_start ?? ''}
|
|
529
|
+
event_title={draft_player_pick.event_title ?? ''}
|
|
530
|
+
width={module_size.width}
|
|
531
|
+
balance={authenticated_competition_player?.wager_based_balance ?? 0}
|
|
532
|
+
loading={pick_loading}
|
|
533
|
+
player_pick={draft_player_pick.draft_pick}
|
|
534
|
+
onCancel={() => setDraftPlayerPick({})}
|
|
535
|
+
onSubmit={(pp) => handleWagerSubmit(pp)}
|
|
536
|
+
/>
|
|
537
|
+
</View>
|
|
538
|
+
</KeyboardAvoidingView>
|
|
533
539
|
</Modal>
|
|
534
540
|
:<></>}
|
|
535
541
|
<Modal
|
|
@@ -14,6 +14,7 @@ type DraftTextViewerProps = {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
function DraftTextViewer({ post_id, formatted_body, text_fallback }:DraftTextViewerProps) {
|
|
17
|
+
|
|
17
18
|
const [ failed, setFailed ] = useState(false)
|
|
18
19
|
const [editorState, setEditorState] = useState(
|
|
19
20
|
() => EditorState.createEmpty(),
|
|
@@ -48,10 +49,10 @@ function DraftTextViewer({ post_id, formatted_body, text_fallback }:DraftTextVie
|
|
|
48
49
|
if(failed){ return (<></>) }
|
|
49
50
|
return (
|
|
50
51
|
<View>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
<Editor
|
|
53
|
+
readOnly
|
|
54
|
+
editorState={editorState}
|
|
55
|
+
onChange={setEditorState} />
|
|
55
56
|
</View>
|
|
56
57
|
|
|
57
58
|
)
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Image
|
|
3
|
-
import { view_styles } from '../../../constants/styles';
|
|
2
|
+
import { Image } from 'react-native';
|
|
4
3
|
import type { PostProps, PublicPlayerProps } from '../../../types';
|
|
5
|
-
import { Text } from '../../../Components';
|
|
6
4
|
import moment from 'moment-mini';
|
|
5
|
+
import { Text, View } from '../../../Components/Themed';
|
|
7
6
|
|
|
8
7
|
type PostHeaderProps = {
|
|
9
8
|
player: PublicPlayerProps,
|
|
@@ -12,15 +11,15 @@ type PostHeaderProps = {
|
|
|
12
11
|
|
|
13
12
|
const PostHeader = ({ player, post }:PostHeaderProps) => {
|
|
14
13
|
return (
|
|
15
|
-
<View style={{
|
|
14
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', paddingLeft:10, padding:10 }}>
|
|
16
15
|
<Image
|
|
17
16
|
source={{ uri: player.profile_pic && player.profile_pic != '' ? player.profile_pic : 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp' }}
|
|
18
17
|
style={{ height:32, width:32, borderRadius:100 }}
|
|
19
18
|
resizeMode='cover'
|
|
20
19
|
/>
|
|
21
|
-
<View style={{ flex:1, marginLeft:10 }}>
|
|
22
|
-
<Text theme='
|
|
23
|
-
<Text style={{ marginTop:3 }} theme='
|
|
20
|
+
<View transparent style={{ flex:1, marginLeft:10 }}>
|
|
21
|
+
<Text theme='h2'>{player.first_name} {player.last_name}</Text>
|
|
22
|
+
<Text style={{ marginTop:3 }} theme='description'>@{player.username} • {moment(post.create_datetime).fromNow()}</Text>
|
|
24
23
|
</View>
|
|
25
24
|
</View>
|
|
26
25
|
)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { FlatList,
|
|
2
|
+
import { FlatList, ActivityIndicator } from "react-native"
|
|
3
3
|
import type { PostReactionProps, PostReactionStatsProps } from '../../../types';
|
|
4
|
-
import { Button, Text } from '../../../Components';
|
|
5
|
-
import Colors from '../../../constants/colors';
|
|
6
4
|
import { view_styles } from '../../../constants/styles';
|
|
5
|
+
import { Button, Text, View } from '../../../Components/Themed';
|
|
6
|
+
import { useColors } from '../../../constants/useColors';
|
|
7
7
|
|
|
8
8
|
type PostReactionBarProps = {
|
|
9
9
|
post_id:string,
|
|
@@ -26,6 +26,7 @@ const available_reactions = [
|
|
|
26
26
|
]
|
|
27
27
|
|
|
28
28
|
const PostReactionBar = ({ post_id, loading, post_reaction_stats, my_post_reactions, onReactionSelect }:PostReactionBarProps) => {
|
|
29
|
+
const Colors = useColors();
|
|
29
30
|
const [ more_selected, setMoreSelected ] = useState(false);
|
|
30
31
|
|
|
31
32
|
const handleReaction = async(reaction:string) => {
|
|
@@ -50,17 +51,17 @@ const PostReactionBar = ({ post_id, loading, post_reaction_stats, my_post_reacti
|
|
|
50
51
|
const my_reaction = my_post_reactions.find(pr => pr.reaction === data.item.reaction)
|
|
51
52
|
const selected = my_reaction?.status === 'visible' ? true : false
|
|
52
53
|
return (
|
|
53
|
-
<
|
|
54
|
+
<Button style={
|
|
54
55
|
reacted ?
|
|
55
|
-
{ ...view_styles.float, marginBottom:5, marginLeft:data.index===0?0:-5, paddingRight:10, paddingLeft:5, flexDirection:'row', alignItems:'center', padding:2, borderRadius:100, backgroundColor:selected?Colors.
|
|
56
|
+
{ ...view_styles.float, marginBottom:5, marginLeft:data.index===0?0:-5, paddingRight:10, paddingLeft:5, flexDirection:'row', alignItems:'center', padding:2, borderRadius:100, backgroundColor:selected?Colors.text.success:Colors.text.white }
|
|
56
57
|
:
|
|
57
|
-
{}} onPress={() => handleReaction(data.item.reaction)}>
|
|
58
|
+
{ padding:3 }} onPress={() => handleReaction(data.item.reaction)}>
|
|
58
59
|
|
|
59
60
|
<Text style={{fontSize:12, padding:6}}>{data.item.label}</Text>
|
|
60
61
|
{reaction_stat && !more_selected && post_reaction_stats.length < 5 ?
|
|
61
|
-
<Text size={12} color={selected ? Colors.
|
|
62
|
+
<Text size={12} color={selected ? Colors.text.h1 : Colors.text.h1} weight='regular' style={{ padding:3 }}>{reaction_stat.reaction_count}</Text>
|
|
62
63
|
:<></>}
|
|
63
|
-
</
|
|
64
|
+
</Button>
|
|
64
65
|
)
|
|
65
66
|
}
|
|
66
67
|
|
|
@@ -74,16 +75,14 @@ const PostReactionBar = ({ post_id, loading, post_reaction_stats, my_post_reacti
|
|
|
74
75
|
{post_reaction_stats.length > 0 && !more_selected ?
|
|
75
76
|
<Button
|
|
76
77
|
title='MORE'
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
style={{ marginLeft:4 }}
|
|
80
|
-
padding={0}
|
|
78
|
+
type='text'
|
|
79
|
+
style={{ padding:5 }}
|
|
81
80
|
onPress={() => setMoreSelected(true)}
|
|
82
81
|
/>
|
|
83
82
|
:<></>}
|
|
84
83
|
{loading ?
|
|
85
|
-
<View style={{ position:'absolute', top:0, left:0, right:0, bottom:0, justifyContent:'center',
|
|
86
|
-
<ActivityIndicator size='small' color={Colors.
|
|
84
|
+
<View type='blur' style={{ position:'absolute', top:0, left:0, right:0, bottom:0, justifyContent:'center', borderRadius:22 }}>
|
|
85
|
+
<ActivityIndicator size='small' color={Colors.text.h1} />
|
|
87
86
|
</View>
|
|
88
87
|
:<></>}
|
|
89
88
|
</View>
|
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import DraftTextViewer from './components/DraftTextViewer';
|
|
4
|
-
import type { OrderProps, PostCommentStatProps, PostProps, PostReactionProps, PostReactionStatsProps, PublicPlayerProps } from '../../types';
|
|
2
|
+
import type { ArticleProps, OrderProps, PostCommentStatProps, PostProps, PostReactionProps, PostReactionStatsProps, PublicPlayerProps } from '../../types';
|
|
5
3
|
import PostHeader from './components/PostHeader';
|
|
6
|
-
import { view_styles } from '../../constants/styles';
|
|
7
4
|
import { useIsInViewport } from '../../Components/ViewportObserver';
|
|
8
5
|
import { SocialProfileApi } from '../PlayerProfile/api';
|
|
9
6
|
|
|
10
7
|
import PostReactionBar from './components/PostReactionBar';
|
|
11
|
-
import
|
|
12
|
-
import { Icons, Text } from '../../Components';
|
|
8
|
+
import { Icons } from '../../Components';
|
|
13
9
|
import SocialOrdersList from '../SocialOrdersList';
|
|
14
10
|
import ImageList from './components/ImageList';
|
|
15
11
|
import { SocialComponentApi } from '../api';
|
|
12
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
13
|
+
import { useColors } from '../../constants/useColors';
|
|
14
|
+
|
|
16
15
|
|
|
17
16
|
type PostCardProps = {
|
|
18
17
|
post: PostProps,
|
|
19
|
-
player
|
|
18
|
+
player?:PublicPlayerProps,
|
|
19
|
+
articles:ArticleProps[],
|
|
20
20
|
orders:OrderProps[],
|
|
21
21
|
player_id?:string,
|
|
22
22
|
onRequestAuthenticate:() => void,
|
|
23
23
|
onCopyOrder?:(order:OrderProps) => void,
|
|
24
24
|
onFadeOrder?:(order:OrderProps) => void,
|
|
25
|
-
onViewComments
|
|
25
|
+
onViewComments?:(post_id:string) => void
|
|
26
26
|
}
|
|
27
27
|
const PostCard = ({ player_id, post, player, orders, onRequestAuthenticate, onCopyOrder, onFadeOrder, onViewComments }:PostCardProps) => {
|
|
28
|
+
const Colors = useColors();
|
|
28
29
|
const [ post_data, setPostData ] = useState<{
|
|
29
30
|
loading:boolean,
|
|
30
31
|
reactions_loaded:boolean,
|
|
@@ -36,6 +37,7 @@ const PostCard = ({ player_id, post, player, orders, onRequestAuthenticate, onCo
|
|
|
36
37
|
post_comment_stat: { activity_post_id:post.memo_post_id, comment_count: 0 },
|
|
37
38
|
post_reaction_stats: []
|
|
38
39
|
})
|
|
40
|
+
|
|
39
41
|
const { reactions_loaded, post_reaction_stats, post_comment_stat } = post_data;
|
|
40
42
|
|
|
41
43
|
const [ my_data, setMyData ] = useState<{
|
|
@@ -117,28 +119,31 @@ const PostCard = ({ player_id, post, player, orders, onRequestAuthenticate, onCo
|
|
|
117
119
|
}
|
|
118
120
|
}
|
|
119
121
|
|
|
122
|
+
|
|
120
123
|
return (
|
|
121
|
-
<View ref={post_ref as any}
|
|
124
|
+
<View float ref={post_ref as any}>
|
|
125
|
+
{player ?
|
|
122
126
|
<PostHeader
|
|
123
127
|
player={player}
|
|
124
128
|
post={post}
|
|
125
129
|
/>
|
|
126
|
-
|
|
127
|
-
|
|
130
|
+
:<></>}
|
|
131
|
+
<View transparent style={{ padding:10 }}>
|
|
132
|
+
<Text theme='h2'>{post.title}</Text>
|
|
133
|
+
</View>
|
|
134
|
+
<View transparent style={{ padding:10, paddingTop:0, paddingBottom:0 }}>
|
|
135
|
+
<Text theme='description'>{post.body}</Text>
|
|
128
136
|
</View>
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
formatted_body={post.formatted_body}
|
|
133
|
-
view_type='memo'
|
|
134
|
-
text_fallback={post.body}
|
|
135
|
-
/>
|
|
137
|
+
{post.memo_articles && post.memo_articles.length > 0 ?
|
|
138
|
+
<View transparent>
|
|
139
|
+
|
|
136
140
|
</View>
|
|
137
|
-
|
|
141
|
+
:<></>}
|
|
142
|
+
{player && post.memo_orders && post.memo_orders.length > 0 ?
|
|
138
143
|
<SocialOrdersList
|
|
139
144
|
players={[player]}
|
|
140
145
|
orders={orders}
|
|
141
|
-
maxWidth={
|
|
146
|
+
maxWidth={300}
|
|
142
147
|
direction='horizontal'
|
|
143
148
|
onCopyOrder={onCopyOrder}
|
|
144
149
|
onFadeOrder={onFadeOrder}
|
|
@@ -151,8 +156,8 @@ const PostCard = ({ player_id, post, player, orders, onRequestAuthenticate, onCo
|
|
|
151
156
|
width={300}
|
|
152
157
|
/>
|
|
153
158
|
:<></>}
|
|
154
|
-
<View style={{
|
|
155
|
-
<View style={{}}>
|
|
159
|
+
<View type='footer' style={{ flexDirection:'row', alignItems:'center', padding:5 }}>
|
|
160
|
+
<View float transparent style={{ padding:5 }}>
|
|
156
161
|
<PostReactionBar
|
|
157
162
|
loading={my_data_loading}
|
|
158
163
|
post_id={post.memo_post_id}
|
|
@@ -161,13 +166,15 @@ const PostCard = ({ player_id, post, player, orders, onRequestAuthenticate, onCo
|
|
|
161
166
|
onReactionSelect={(r) => handleReaction(r)}
|
|
162
167
|
/>
|
|
163
168
|
</View>
|
|
164
|
-
|
|
169
|
+
{onViewComments ?
|
|
170
|
+
<Button
|
|
165
171
|
style={{ flex:1, flexDirection:'row', alignItems:'center', justifyContent:'flex-end' }}
|
|
166
172
|
onPress={() => onViewComments(post.memo_post_id)}
|
|
167
173
|
>
|
|
168
|
-
<Text style={{ marginRight:4 }} theme='
|
|
169
|
-
<Icons.ChatIcon size={18} color={Colors.
|
|
170
|
-
</
|
|
174
|
+
<Text style={{ marginRight:4 }} theme='h2'>{post_comment_stat.comment_count}</Text>
|
|
175
|
+
<Icons.ChatIcon size={18} color={Colors.text.h1}/>
|
|
176
|
+
</Button>
|
|
177
|
+
:<></>}
|
|
171
178
|
</View>
|
|
172
179
|
</View>
|
|
173
180
|
)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Image } from 'react-native';
|
|
3
3
|
import type { AthleteProps, LeagueProps, OrderProps, PublicPlayerProps, TeamProps } from '../types';
|
|
4
|
-
import {
|
|
5
|
-
import { Button, Icons, Text } from '../Components';
|
|
4
|
+
import { Icons } from '../Components';
|
|
6
5
|
import { SocialComponentApi, SocialOrderHelpers } from './api';
|
|
7
|
-
import Colors from '../constants/colors';
|
|
8
6
|
import moment from 'moment-mini';
|
|
9
7
|
import { AthleteImage } from '../Components/Jerseys';
|
|
8
|
+
import { View, Button, Text } from '../Components/Themed';
|
|
9
|
+
import { useColors } from '../constants/useColors';
|
|
10
10
|
|
|
11
11
|
type SocialOrderCardProps = {
|
|
12
12
|
player?:PublicPlayerProps,
|
|
@@ -22,6 +22,7 @@ type SocialOrderCardProps = {
|
|
|
22
22
|
onFadeOrder?:(order:OrderProps) => void
|
|
23
23
|
}
|
|
24
24
|
const SocialOrderCard = ({ player, show_player, maxWidth, league, team, athlete, order, contest_title, contest_time, onCopyOrder, onFadeOrder }:SocialOrderCardProps) => {
|
|
25
|
+
const Colors = useColors();
|
|
25
26
|
const [ fade_loading, setFadeLoading ] = useState(false);
|
|
26
27
|
const { result_label, color } = SocialOrderHelpers.getResultDetails(order)
|
|
27
28
|
|
|
@@ -50,26 +51,26 @@ const SocialOrderCard = ({ player, show_player, maxWidth, league, team, athlete,
|
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
return (
|
|
53
|
-
<View style={{
|
|
54
|
+
<View float style={{ minWidth:275, maxWidth }}>
|
|
54
55
|
{show_player && player ?
|
|
55
|
-
<View style={{
|
|
56
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10, borderTopRightRadius:8, borderTopLeftRadius:8 }}>
|
|
56
57
|
<Image
|
|
57
58
|
source={{ uri: player.profile_pic && player.profile_pic != '' ? player.profile_pic : 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp' }}
|
|
58
59
|
style={{ height:35, width:35, borderRadius:100 }}
|
|
59
60
|
resizeMode='cover'
|
|
60
61
|
/>
|
|
61
|
-
<View style={{ flex:1, marginLeft:10, marginRight:10 }}>
|
|
62
|
-
<Text theme='
|
|
63
|
-
<Text theme='
|
|
62
|
+
<View transparent style={{ flex:1, marginLeft:10, marginRight:10 }}>
|
|
63
|
+
<Text theme='h1'>{player.first_name} {player.last_name}</Text>
|
|
64
|
+
<Text theme='description' style={{ marginTop:3 }}>@{player.username}</Text>
|
|
64
65
|
</View>
|
|
65
66
|
<Text size={14} color={color} weight='bold'>{result_label}</Text>
|
|
66
67
|
</View>
|
|
67
68
|
:<></>}
|
|
68
|
-
<View style={{
|
|
69
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10 }}>
|
|
69
70
|
|
|
70
|
-
<View style={{ flex:1, marginRight:10 }}>
|
|
71
|
-
<Text theme='
|
|
72
|
-
<Text style={{ marginTop:3 }} size={12}
|
|
71
|
+
<View transparent style={{ flex:1, marginRight:10 }}>
|
|
72
|
+
<Text theme='description'>{contest_title}</Text>
|
|
73
|
+
<Text style={{ marginTop:3 }} size={12} theme='light' weight='regular'>{contest_time}</Text>
|
|
73
74
|
</View>
|
|
74
75
|
{league ?
|
|
75
76
|
<Image
|
|
@@ -78,13 +79,13 @@ const SocialOrderCard = ({ player, show_player, maxWidth, league, team, athlete,
|
|
|
78
79
|
resizeMode='cover'
|
|
79
80
|
/>
|
|
80
81
|
:
|
|
81
|
-
<View style={{ height:30, width:30, borderRadius:4, justifyContent:'center', alignItems:'center', backgroundColor:SocialOrderHelpers.getIconColor(order) }}>
|
|
82
|
-
<Icons.ActivityIcon size={14} color={Colors.
|
|
82
|
+
<View transparent style={{ height:30, width:30, borderRadius:4, justifyContent:'center', alignItems:'center', backgroundColor:SocialOrderHelpers.getIconColor(order) }}>
|
|
83
|
+
<Icons.ActivityIcon size={14} color={Colors.text.white}/>
|
|
83
84
|
</View>
|
|
84
85
|
}
|
|
85
86
|
</View>
|
|
86
|
-
<View style={{
|
|
87
|
-
<View style={{
|
|
87
|
+
<View type='body' style={{ padding:10 }}>
|
|
88
|
+
<View transparent type='row' style={{ padding:5 }}>
|
|
88
89
|
{team ?
|
|
89
90
|
<Image
|
|
90
91
|
source={{ uri: team.image?.url }}
|
|
@@ -97,26 +98,26 @@ const SocialOrderCard = ({ player, show_player, maxWidth, league, team, athlete,
|
|
|
97
98
|
size={16}
|
|
98
99
|
/>
|
|
99
100
|
:<></>}
|
|
100
|
-
<View style={{ flex:1, marginLeft:10, marginRight:10 }}>
|
|
101
|
-
<Text theme='
|
|
102
|
-
<Text style={{ marginTop:3 }} theme='
|
|
101
|
+
<View transparent style={{ flex:1, marginLeft:10, marginRight:10 }}>
|
|
102
|
+
<Text theme='h2'>{order.title}</Text>
|
|
103
|
+
<Text style={{ marginTop:3 }} theme='description'>Created on {moment(order.create_datetime).format('MM/DD hh:mm a')}</Text>
|
|
103
104
|
</View>
|
|
104
|
-
<View>
|
|
105
|
-
<Text theme='
|
|
105
|
+
<View transparent>
|
|
106
|
+
<Text theme='h1'>{SocialOrderHelpers.getOddsLabel(order.odds)}</Text>
|
|
106
107
|
{!show_player ?
|
|
107
|
-
<Text style={{ marginTop:3 }} size={14} color={color}
|
|
108
|
+
<Text style={{ marginTop:3 }} size={14} color={color} theme='h1'>{result_label}</Text>
|
|
108
109
|
:<></>}
|
|
109
110
|
</View>
|
|
110
111
|
</View>
|
|
111
112
|
</View>
|
|
112
113
|
{order.resolution_status == 'inprogress' ?
|
|
113
|
-
<View style={{
|
|
114
|
+
<View type='row' style={{ padding:0, borderBottomLeftRadius:8, borderBottomRightRadius:8 }}>
|
|
114
115
|
{onCopyOrder ?
|
|
115
116
|
<Button
|
|
116
117
|
style={{ flex:1, borderRadius:0, borderBottomLeftRadius:8 }}
|
|
117
118
|
title='Copy'
|
|
118
|
-
title_color={Colors.
|
|
119
|
-
backgroundColor={Colors.brand.midnight}
|
|
119
|
+
title_color={Colors.text.white}
|
|
120
|
+
backgroundColor={Colors.absolutes.brand.midnight}
|
|
120
121
|
onPress={() => onCopyOrder({
|
|
121
122
|
...order,
|
|
122
123
|
buy_sell_ind:'buy',
|
|
@@ -139,8 +140,8 @@ const SocialOrderCard = ({ player, show_player, maxWidth, league, team, athlete,
|
|
|
139
140
|
style={{ flex:1, borderRadius:0, borderBottomRightRadius:8, opacity:fade_loading?0.5:1 }}
|
|
140
141
|
title='Fade'
|
|
141
142
|
loading={fade_loading}
|
|
142
|
-
title_color={Colors.
|
|
143
|
-
backgroundColor={Colors.brand.cyan}
|
|
143
|
+
title_color={Colors.text.white}
|
|
144
|
+
backgroundColor={Colors.absolutes.brand.cyan}
|
|
144
145
|
onPress={() => handleFadeOrder()}
|
|
145
146
|
/>
|
|
146
147
|
:<></>}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FlatList } from 'react-native';
|
|
3
3
|
import type { AthleteProps, EventProps, LeagueProps, MatchProps, OrderProps, PublicPlayerProps, TeamProps, TournamentProps } from '../types';
|
|
4
4
|
import SocialOrderCard from './SocialOrderCard';
|
|
5
5
|
import { SocialComponentApi, SocialOrderHelpers } from './api';
|
|
6
|
+
import { View } from '../Components/Themed';
|
|
6
7
|
|
|
7
8
|
type SocialOrdersListProps = {
|
|
8
9
|
players:PublicPlayerProps[],
|
|
@@ -5,6 +5,7 @@ import CompanyProfile from './CompanyProfile';
|
|
|
5
5
|
import PodcastModule from './PodcastModule';
|
|
6
6
|
import AudioPlayer from "./AudioPlayer";
|
|
7
7
|
import { useContacts } from "./Contacts/useContacts";
|
|
8
|
+
import PostCard from './PostCard';
|
|
8
9
|
export {
|
|
9
10
|
PlayerCard,
|
|
10
11
|
PlayerList,
|
|
@@ -12,5 +13,6 @@ export {
|
|
|
12
13
|
CompanyProfile,
|
|
13
14
|
PodcastModule,
|
|
14
15
|
AudioPlayer,
|
|
15
|
-
useContacts
|
|
16
|
+
useContacts,
|
|
17
|
+
PostCard
|
|
16
18
|
}
|
package/src/index.tsx
CHANGED
|
@@ -37,6 +37,7 @@ import SquaresCompetitionCard from './Engage/components/SquaresCompetitionCard';
|
|
|
37
37
|
import BracketCompetitionCard from './Engage/components/BracketCompetitionCard';
|
|
38
38
|
import SeasonCard from './Engage/components/SeasonCard';
|
|
39
39
|
import NotificationModule from './Notifications';
|
|
40
|
+
import { useNotifications } from './Notifications/useNotifications';
|
|
40
41
|
|
|
41
42
|
export {
|
|
42
43
|
Authenticator,
|
|
@@ -45,6 +46,7 @@ export {
|
|
|
45
46
|
BELinkApi,
|
|
46
47
|
LocationTracker,
|
|
47
48
|
NotificationModule,
|
|
49
|
+
useNotifications,
|
|
48
50
|
ProfileManager,
|
|
49
51
|
CompetitionManager,
|
|
50
52
|
Components,
|