be-components 2.8.2 → 3.0.0
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/ApiOverrides/index.js +3 -3
- package/lib/commonjs/ApiOverrides/index.js.map +1 -1
- package/lib/commonjs/Authenticator/Components/LoginForm.js +4 -1
- package/lib/commonjs/Authenticator/Components/LoginForm.js.map +1 -1
- package/lib/commonjs/Authenticator/Components/StrategyForm.js +6 -0
- package/lib/commonjs/Authenticator/Components/StrategyForm.js.map +1 -1
- package/lib/commonjs/Authenticator/api/index.js +4 -5
- package/lib/commonjs/Authenticator/api/index.js.map +1 -1
- package/lib/commonjs/Competition/components/AthleteMarketCard.js +1 -3
- package/lib/commonjs/Competition/components/AthleteMarketCard.js.map +1 -1
- package/lib/commonjs/Competition/components/CompetitionPlay.js +3 -3
- package/lib/commonjs/Competition/components/CompetitionPlay.js.map +1 -1
- package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js +1 -3
- package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js.map +1 -1
- package/lib/commonjs/Competition/index.js +9 -14
- package/lib/commonjs/Competition/index.js.map +1 -1
- package/lib/commonjs/Components/Button.js +3 -2
- package/lib/commonjs/Components/Button.js.map +1 -1
- package/lib/commonjs/Components/Icons.js +642 -942
- package/lib/commonjs/Components/Icons.js.map +1 -1
- package/lib/commonjs/Components/ImageUploader.js +96 -45
- package/lib/commonjs/Components/ImageUploader.js.map +1 -1
- package/lib/commonjs/Components/Jerseys.js +114 -124
- package/lib/commonjs/Components/Jerseys.js.map +1 -1
- package/lib/commonjs/Components/LinearDiagnal.js +2 -2
- package/lib/commonjs/Components/LinearDiagnal.js.map +1 -1
- package/lib/commonjs/Components/Spring.js +19 -7
- package/lib/commonjs/Components/Spring.js.map +1 -1
- package/lib/commonjs/Components/Text.js +6 -6
- package/lib/commonjs/Components/Text.js.map +1 -1
- package/lib/commonjs/Components/TextInput.js +2 -2
- package/lib/commonjs/Components/TextInput.js.map +1 -1
- package/lib/commonjs/Components/ViewportObserver.js +7 -0
- package/lib/commonjs/Components/ViewportObserver.js.map +1 -1
- package/lib/commonjs/EventComponents/TeamProfile/index.js +2 -2
- package/lib/commonjs/EventComponents/TeamProfile/index.js.map +1 -1
- package/lib/commonjs/Font.css +4 -4
- package/lib/commonjs/LocationTracker/LocationStatus.js +7 -4
- package/lib/commonjs/LocationTracker/LocationStatus.js.map +1 -1
- package/lib/commonjs/LocationTracker/api/index.js +225 -96
- package/lib/commonjs/LocationTracker/api/index.js.map +1 -1
- package/lib/commonjs/LocationTracker/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/api/index.js +0 -2
- package/lib/commonjs/MarketComponents/api/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/AthleteMarket/index.js +0 -2
- package/lib/commonjs/MarketComponents/components/AthleteMarket/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/EventMarket/index.js +0 -1
- package/lib/commonjs/MarketComponents/components/EventMarket/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/MatchMarket/index.js +1 -3
- package/lib/commonjs/MarketComponents/components/MatchMarket/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/TeamEventMarket/index.js +6 -5
- package/lib/commonjs/MarketComponents/components/TeamEventMarket/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/TournamentMarket/index.js +10 -6
- package/lib/commonjs/MarketComponents/components/TournamentMarket/index.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/PasswordManager.js +8 -7
- package/lib/commonjs/ProfileManager/Components/PasswordManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js +4 -1
- package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js.map +1 -1
- package/lib/commonjs/SocialComponents/AudioPlayer.js +2 -3
- package/lib/commonjs/SocialComponents/AudioPlayer.js.map +1 -1
- package/lib/commonjs/SocialComponents/PlayerProfile/components/PostsList.js +60 -51
- package/lib/commonjs/SocialComponents/PlayerProfile/components/PostsList.js.map +1 -1
- package/lib/commonjs/SocialComponents/PlayerProfile/index.js +5 -7
- package/lib/commonjs/SocialComponents/PlayerProfile/index.js.map +1 -1
- package/lib/commonjs/Squares/components/BidForm.js +1 -7
- package/lib/commonjs/Squares/components/BidForm.js.map +1 -1
- package/lib/commonjs/Squares/components/BidToggle.js +0 -1
- package/lib/commonjs/Squares/components/BidToggle.js.map +1 -1
- package/lib/commonjs/Squares/components/SquareCard.js +2 -1
- package/lib/commonjs/Squares/components/SquareCard.js.map +1 -1
- package/lib/commonjs/Squares/components/SquaresBoard.js +11 -7
- package/lib/commonjs/Squares/components/SquaresBoard.js.map +1 -1
- package/lib/commonjs/Squares/index.js +10 -10
- package/lib/commonjs/Squares/index.js.map +1 -1
- package/lib/commonjs/constants/styles.js +9 -9
- package/lib/commonjs/constants/styles.js.map +1 -1
- package/lib/commonjs/index.js +2 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/ApiOverrides/index.js +3 -3
- package/lib/module/ApiOverrides/index.js.map +1 -1
- package/lib/module/Authenticator/Components/LoginForm.js +4 -1
- package/lib/module/Authenticator/Components/LoginForm.js.map +1 -1
- package/lib/module/Authenticator/Components/StrategyForm.js +6 -0
- package/lib/module/Authenticator/Components/StrategyForm.js.map +1 -1
- package/lib/module/Authenticator/api/index.js +4 -5
- package/lib/module/Authenticator/api/index.js.map +1 -1
- package/lib/module/Competition/components/AthleteMarketCard.js +1 -3
- package/lib/module/Competition/components/AthleteMarketCard.js.map +1 -1
- package/lib/module/Competition/components/CompetitionPlay.js +1 -1
- package/lib/module/Competition/components/CompetitionPlay.js.map +1 -1
- package/lib/module/Competition/components/EnterCompetitionPrompt.js +1 -3
- package/lib/module/Competition/components/EnterCompetitionPrompt.js.map +1 -1
- package/lib/module/Competition/index.js +10 -15
- package/lib/module/Competition/index.js.map +1 -1
- package/lib/module/Components/Button.js +3 -2
- package/lib/module/Components/Button.js.map +1 -1
- package/lib/module/Components/Icons.js +640 -942
- package/lib/module/Components/Icons.js.map +1 -1
- package/lib/module/Components/ImageUploader.js +96 -45
- package/lib/module/Components/ImageUploader.js.map +1 -1
- package/lib/module/Components/Jerseys.js +112 -124
- package/lib/module/Components/Jerseys.js.map +1 -1
- package/lib/module/Components/LinearDiagnal.js +1 -1
- package/lib/module/Components/LinearDiagnal.js.map +1 -1
- package/lib/module/Components/Spring.js +19 -7
- package/lib/module/Components/Spring.js.map +1 -1
- package/lib/module/Components/Text.js +6 -6
- package/lib/module/Components/Text.js.map +1 -1
- package/lib/module/Components/TextInput.js +2 -2
- package/lib/module/Components/TextInput.js.map +1 -1
- package/lib/module/Components/ViewportObserver.js +7 -0
- package/lib/module/Components/ViewportObserver.js.map +1 -1
- package/lib/module/EventComponents/TeamProfile/index.js +1 -1
- package/lib/module/EventComponents/TeamProfile/index.js.map +1 -1
- package/lib/module/Font.css +4 -4
- package/lib/module/LocationTracker/LocationStatus.js +5 -4
- package/lib/module/LocationTracker/LocationStatus.js.map +1 -1
- package/lib/module/LocationTracker/api/index.js +222 -96
- package/lib/module/LocationTracker/api/index.js.map +1 -1
- package/lib/module/LocationTracker/index.js.map +1 -1
- package/lib/module/MarketComponents/api/index.js +0 -2
- package/lib/module/MarketComponents/api/index.js.map +1 -1
- package/lib/module/MarketComponents/components/AthleteMarket/index.js +0 -2
- package/lib/module/MarketComponents/components/AthleteMarket/index.js.map +1 -1
- package/lib/module/MarketComponents/components/EventMarket/index.js +0 -1
- package/lib/module/MarketComponents/components/EventMarket/index.js.map +1 -1
- package/lib/module/MarketComponents/components/MatchMarket/index.js +1 -3
- package/lib/module/MarketComponents/components/MatchMarket/index.js.map +1 -1
- package/lib/module/MarketComponents/components/TeamEventMarket/index.js +5 -4
- package/lib/module/MarketComponents/components/TeamEventMarket/index.js.map +1 -1
- package/lib/module/MarketComponents/components/TournamentMarket/index.js +11 -7
- package/lib/module/MarketComponents/components/TournamentMarket/index.js.map +1 -1
- package/lib/module/ProfileManager/Components/PasswordManager.js +8 -7
- package/lib/module/ProfileManager/Components/PasswordManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/ProfilePicManager.js +4 -1
- package/lib/module/ProfileManager/Components/ProfilePicManager.js.map +1 -1
- package/lib/module/SocialComponents/AudioPlayer.js +2 -3
- package/lib/module/SocialComponents/AudioPlayer.js.map +1 -1
- package/lib/module/SocialComponents/PlayerProfile/components/PostsList.js +59 -50
- package/lib/module/SocialComponents/PlayerProfile/components/PostsList.js.map +1 -1
- package/lib/module/SocialComponents/PlayerProfile/index.js +6 -8
- package/lib/module/SocialComponents/PlayerProfile/index.js.map +1 -1
- package/lib/module/Squares/components/BidForm.js +1 -7
- package/lib/module/Squares/components/BidForm.js.map +1 -1
- package/lib/module/Squares/components/BidToggle.js +0 -1
- package/lib/module/Squares/components/BidToggle.js.map +1 -1
- package/lib/module/Squares/components/SquareCard.js +2 -1
- package/lib/module/Squares/components/SquareCard.js.map +1 -1
- package/lib/module/Squares/components/SquaresBoard.js +12 -8
- package/lib/module/Squares/components/SquaresBoard.js.map +1 -1
- package/lib/module/Squares/index.js +11 -11
- package/lib/module/Squares/index.js.map +1 -1
- package/lib/module/constants/styles.js +9 -9
- package/lib/module/constants/styles.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/ApiOverrides/index.d.ts.map +1 -1
- package/lib/typescript/src/Authenticator/Components/LoginForm.d.ts.map +1 -1
- package/lib/typescript/src/Authenticator/Components/StrategyForm.d.ts.map +1 -1
- package/lib/typescript/src/Authenticator/api/index.d.ts.map +1 -1
- package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts +1 -1
- package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -1
- package/lib/typescript/src/Competition/index.d.ts.map +1 -1
- package/lib/typescript/src/Components/Icons.d.ts +1 -2
- package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/src/Components/ImageUploader.d.ts +2 -2
- package/lib/typescript/src/Components/ImageUploader.d.ts.map +1 -1
- package/lib/typescript/src/Components/Jerseys.d.ts.map +1 -1
- package/lib/typescript/src/Components/Spring.d.ts.map +1 -1
- package/lib/typescript/src/Components/Text.d.ts.map +1 -1
- package/lib/typescript/src/Components/TextInput.d.ts +2 -2
- package/lib/typescript/src/Components/TextInput.d.ts.map +1 -1
- package/lib/typescript/src/Components/ViewportObserver.d.ts.map +1 -1
- package/lib/typescript/src/EventComponents/index.d.ts.map +1 -1
- package/lib/typescript/src/LocationTracker/LocationStatus.d.ts +2 -1
- package/lib/typescript/src/LocationTracker/LocationStatus.d.ts.map +1 -1
- package/lib/typescript/src/LocationTracker/api/index.d.ts +5 -3
- package/lib/typescript/src/LocationTracker/api/index.d.ts.map +1 -1
- package/lib/typescript/src/LocationTracker/index.d.ts +2 -1
- package/lib/typescript/src/LocationTracker/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/api/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/components/MatchMarket/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/components/TeamEventMarket/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/components/TournamentMarket/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/index.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/PasswordManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/ProfilePicManager.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/PlayerProfile/components/PostsList.d.ts +1 -1
- package/lib/typescript/src/SocialComponents/PlayerProfile/components/PostsList.d.ts.map +1 -1
- package/lib/typescript/src/Squares/components/BidForm.d.ts +1 -1
- package/lib/typescript/src/Squares/components/BidForm.d.ts.map +1 -1
- package/lib/typescript/src/Squares/components/SquaresBoard.d.ts.map +1 -1
- package/lib/typescript/src/Squares/index.d.ts.map +1 -1
- package/lib/typescript/src/constants/styles.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +23 -7
- package/src/ApiOverrides/index.ts +4 -3
- package/src/Authenticator/Components/LoginForm.tsx +4 -1
- package/src/Authenticator/Components/StrategyForm.tsx +6 -0
- package/src/Authenticator/api/index.ts +6 -8
- package/src/Competition/components/AthleteMarketCard.tsx +1 -1
- package/src/Competition/components/CompetitionPlay.tsx +1 -1
- package/src/Competition/components/EnterCompetitionPrompt.tsx +3 -3
- package/src/Competition/index.tsx +11 -12
- package/src/Components/Button.tsx +20 -20
- package/src/Components/Icons.tsx +778 -897
- package/src/Components/ImageUploader.tsx +59 -12
- package/src/Components/Jerseys.tsx +127 -132
- package/src/Components/LinearDiagnal.tsx +1 -1
- package/src/Components/Spring.tsx +24 -7
- package/src/Components/Text.tsx +6 -9
- package/src/Components/TextInput.tsx +3 -3
- package/src/Components/ViewportObserver.tsx +4 -0
- package/src/EventComponents/TeamProfile/index.tsx +1 -1
- package/src/Font.css +4 -4
- package/src/LocationTracker/LocationStatus.tsx +6 -6
- package/src/LocationTracker/api/index.tsx +172 -59
- package/src/LocationTracker/index.tsx +2 -1
- package/src/MarketComponents/api/index.ts +0 -2
- package/src/MarketComponents/components/AthleteMarket/index.tsx +2 -2
- package/src/MarketComponents/components/EventMarket/index.tsx +1 -1
- package/src/MarketComponents/components/MatchMarket/index.tsx +3 -4
- package/src/MarketComponents/components/TeamEventMarket/index.tsx +16 -12
- package/src/MarketComponents/components/TournamentMarket/index.tsx +12 -11
- package/src/ProfileManager/Components/PasswordManager.tsx +6 -7
- package/src/ProfileManager/Components/ProfilePicManager.tsx +4 -1
- package/src/SocialComponents/AudioPlayer.tsx +4 -4
- package/src/SocialComponents/PlayerProfile/components/PostsList.tsx +14 -7
- package/src/SocialComponents/PlayerProfile/index.tsx +4 -4
- package/src/Squares/components/BidForm.tsx +4 -5
- package/src/Squares/components/BidToggle.tsx +1 -1
- package/src/Squares/components/SquareCard.tsx +2 -2
- package/src/Squares/components/SquaresBoard.tsx +22 -20
- package/src/Squares/index.tsx +10 -7
- package/src/constants/styles.ts +9 -9
- package/src/index.tsx +2 -0
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
// Set your cloud name and unsigned upload preset here:
|
|
2
2
|
const YOUR_CLOUD_NAME = "hoabts6mc";
|
|
3
3
|
const YOUR_UNSIGNED_UPLOAD_PRESET = "be_auth_svc";
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
import React from "react";
|
|
5
7
|
import { TouchableOpacity } from "react-native";
|
|
8
|
+
import * as ImagePicker from 'expo-image-picker';
|
|
9
|
+
import axios from 'axios';
|
|
6
10
|
|
|
7
11
|
|
|
8
12
|
type CldUploaderProps = {
|
|
9
|
-
onFinishUpload : (obj:any) => void
|
|
13
|
+
onFinishUpload : (obj:any | undefined) => void
|
|
10
14
|
onStartUpload?: () => void,
|
|
11
15
|
onCancelUpload?: () => void,
|
|
12
16
|
children?:any,
|
|
13
17
|
public_id: string
|
|
14
18
|
}
|
|
15
|
-
const ImageUploader = ({ onStartUpload,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const processFile = async (
|
|
19
|
+
const ImageUploader = ({ onStartUpload, onFinishUpload, public_id, children }:CldUploaderProps) => {
|
|
20
|
+
|
|
21
|
+
/*
|
|
22
|
+
const processFile = async (file:any) => {
|
|
19
23
|
if(onStartUpload){ onStartUpload() }
|
|
20
|
-
var file = e.target.files[0];
|
|
24
|
+
//var file = e.target.files[0];
|
|
21
25
|
if(!file && onCancelUpload){ onCancelUpload()}
|
|
22
26
|
var POST_URL =
|
|
23
27
|
"https://api.cloudinary.com/v1_1/" + YOUR_CLOUD_NAME + "/auto/upload";
|
|
@@ -87,19 +91,62 @@ const ImageUploader = ({ onStartUpload, onCancelUpload, onFinishUpload, public_i
|
|
|
87
91
|
|
|
88
92
|
function noop() {}
|
|
89
93
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
const upload = async(file:any) => {
|
|
97
|
+
const formData = new FormData();
|
|
98
|
+
formData.append('file', file); // 'imageFile' is your selected image file
|
|
99
|
+
formData.append("cloud_name", YOUR_CLOUD_NAME);
|
|
100
|
+
formData.append("upload_preset", YOUR_UNSIGNED_UPLOAD_PRESET);
|
|
101
|
+
formData.append("public_id", public_id);
|
|
102
|
+
const uploadUrl = `https://api.cloudinary.com/v1_1/${YOUR_CLOUD_NAME}/image/upload`;
|
|
103
|
+
var XUniqueUploadId = +new Date();
|
|
104
|
+
try {
|
|
105
|
+
const response = await axios.post(uploadUrl, formData, {
|
|
106
|
+
headers: {
|
|
107
|
+
'Content-Type': 'multipart/form-data',
|
|
108
|
+
"X-Unique-Upload-Id": XUniqueUploadId,
|
|
109
|
+
'Authorization': undefined,
|
|
110
|
+
'x-api-key':undefined,
|
|
111
|
+
'sessionid':undefined,
|
|
112
|
+
'distinctid':undefined
|
|
113
|
+
}
|
|
114
|
+
})
|
|
115
|
+
return response.data
|
|
116
|
+
} catch (error) {
|
|
117
|
+
return onFinishUpload(undefined)
|
|
118
|
+
}
|
|
94
119
|
}
|
|
95
120
|
|
|
121
|
+
const handleClick = async() => {
|
|
122
|
+
if(onStartUpload){onStartUpload()}
|
|
123
|
+
let result = await ImagePicker.launchImageLibraryAsync({
|
|
124
|
+
mediaTypes: ['images', 'videos'],
|
|
125
|
+
allowsEditing: true,
|
|
126
|
+
base64:true,
|
|
127
|
+
//aspect: [4, 3],
|
|
128
|
+
quality: 1,
|
|
129
|
+
});
|
|
130
|
+
if(!result?.assets){ return onFinishUpload(undefined)}
|
|
131
|
+
let file = result.assets[0]
|
|
132
|
+
if(!file){ return onFinishUpload(undefined) }
|
|
133
|
+
let mimeType = file.mimeType
|
|
134
|
+
let base_64 = file.base64
|
|
135
|
+
if(!mimeType || !base_64){ return onFinishUpload(undefined) }
|
|
136
|
+
let url = `data:${mimeType};base64,${base_64}`
|
|
137
|
+
let object = await upload(url);
|
|
138
|
+
return onFinishUpload(object)
|
|
139
|
+
}
|
|
96
140
|
return (
|
|
97
141
|
<TouchableOpacity style={{ padding:10 }} onPress={() => handleClick()}>
|
|
98
|
-
<input ref={upload_ref as any} style={{ display:'none' }} type="file" onChange={processFile} onAbort={() => onCancelUpload ? onCancelUpload() : console.log('cancelled')}/>
|
|
99
142
|
{children}
|
|
100
143
|
</TouchableOpacity>
|
|
101
144
|
);
|
|
102
145
|
|
|
103
146
|
}
|
|
104
147
|
|
|
148
|
+
/*
|
|
149
|
+
<input ref={upload_ref as any} style={{ display:'none' }} type="file" onChange={processFile} onAbort={() => onCancelUpload ? onCancelUpload() : console.log('cancelled')}/>
|
|
150
|
+
*/
|
|
151
|
+
|
|
105
152
|
export default ImageUploader;
|