๐
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async driveIconClicked() { | |
| console.log("Clicked"); | |
| await gapi.load("auth2", () => { | |
| console.log("Auth2 Loaded"); | |
| gapi.auth2.authorize( | |
| { | |
| client_id: this.clientId, | |
| scope: this.scope, | |
| immediate: false | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| handleAuthResult(authResult) { | |
| console.log("Handle Auth result", authResult); | |
| if (authResult && !authResult.error) { | |
| this.oauthToken = authResult.access_token; | |
| this.createPicker(); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| createPicker() { | |
| console.log("Create Picker", google.picker); | |
| if (this.pickerApiLoaded && this.oauthToken) { | |
| var picker = new google.picker.PickerBuilder() | |
| .enableFeature(google.picker.Feature.MULTISELECT_ENABLED) | |
| .addView(google.picker.ViewId.DOCS) | |
| .setOAuthToken(this.oauthToken) | |
| .setDeveloperKey("AIzaSyBaQZlYTmndQYCcdlkHoVtBzpZYandwaaA") | |
| .setCallback(this.pickerCallback) | |
| .build(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async pickerCallback(data) { | |
| console.log("PickerCallback", data); | |
| var url = "nothing"; | |
| var name = "nothing"; | |
| if (data[google.picker.Response.ACTION] === google.picker.Action.PICKED) { | |
| // Array of Picked Files | |
| console.log(docs); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mounted() { | |
| let dropBox = document.createElement("script"); | |
| dropBox.setAttribute( | |
| "src", | |
| "https://www.dropbox.com/static/api/2/dropins.js" | |
| ); | |
| dropBox.setAttribute("id", "dropboxjs"); | |
| dropBox.setAttribute("data-app-key", "<YOU_ API_KEY>"); | |
| document.head.appendChild(dropBox); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let options = | |
| { | |
| // Required. Called when a user selects an item in the Chooser. | |
| success: async files => { | |
| console.log(files); | |
| }, | |
| // Optional. Called when the user closes the dialog without selecting a file | |
| // and does not include any parameters. | |
| cancel: function() {}, | |
| linkType: "preview", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dropboxIconClicked() { | |
| let options = { | |
| success: async files => { | |
| let attachments = []; | |
| for (let i = 0; i < files.length; i++) { | |
| let attachment = {}; | |
| attachment._id = files[i].id; | |
| attachment.title = files[i].name; | |
| attachment.size = files[i].bytes; | |
| attachment.iconURL = files[i].icon; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| react-native init <Project Name> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import create from 'zustand'; | |
| const [userProfileStore] = create(set => ({ | |
| username: '', | |
| email: '', | |
| user_id: '', | |
| token: '', | |
| user_type: '', | |
| isAuthenticated: false, | |
| token: '', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| return ( | |
| <> | |
| <StatusBar barStyle="dark-content" /> | |
| <SafeAreaView> | |
| <Text>Hello,World !</Text> | |
| </SafeAreaView> | |
| </> | |
| ); |