-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new image uploader, link previews refactored
- Loading branch information
1 parent
f61b4d9
commit 21dd0b8
Showing
29 changed files
with
1,219 additions
and
498 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
TENOR_KEY= | ||
WEB3_STORAGE_KEY= | ||
RPC_CUSTOM= | ||
FILE_UPLOAD_SERVICE= | ||
LINK_PREVIEW_SERVICE= | ||
RPC_CUSTOM= | ||
SPHERON_BUCKET_NAME= | ||
SPHERON_STORAGE_TOKEN= | ||
TENOR_KEY= |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
node_modules | ||
*.log* | ||
.nuxt | ||
.netlify | ||
.nitro | ||
.nuxt | ||
.cache | ||
.output | ||
.env | ||
dist | ||
|
||
# Local Netlify folder | ||
.netlify | ||
.vercel | ||
dist |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Vercel serverless function | ||
|
||
This folder contains serverless functions for Vercel. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const { SpheronClient, ProtocolEnum } = require("@spheron/storage"); | ||
|
||
export default async function handler(request, response) { | ||
try { | ||
const bucketName = process.env.SPHERON_BUCKET_NAME; // enter bucket name in environment variables | ||
const token = process.env.SPHERON_STORAGE_TOKEN; // add spheron storage token in environment variables | ||
|
||
const protocol = ProtocolEnum.IPFS; | ||
|
||
const client = new SpheronClient({ token }); | ||
|
||
const { uploadToken } = await client.createSingleUploadToken({ | ||
name: bucketName, | ||
protocol, | ||
}); | ||
|
||
return response.status(200).json({ | ||
data: uploadToken | ||
}); | ||
|
||
} catch (error) { | ||
console.error(error); | ||
next(error); | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const { fetchMetadata } = require('../utils/linkPreviewUtils'); | ||
|
||
export default async function handler(request, response) { | ||
const url = request.query.url; | ||
|
||
const { metadata, status } = await fetchMetadata(url); | ||
|
||
return response.status(status).json({ | ||
data: metadata | ||
}); | ||
|
||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<template> | ||
<!-- Verify Account Ownership modal --> | ||
<div class="modal fade" id="verifyAccountModal" tabindex="-1" aria-labelledby="verifyAccountModalLabel" aria-hidden="true"> | ||
<div class="modal-dialog" role="document"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title">Verify Account Ownership</h5> | ||
<button id="closeVerifyAccountModal" type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"> | ||
<span aria-hidden="true"></span> | ||
</button> | ||
</div> | ||
<div class="modal-body p-3 mb-3"> | ||
|
||
<p> | ||
Verify that you really own this account/wallet. This will allow you to use chat, change profile image, and set some other settings. | ||
</p> | ||
|
||
<button class="btn btn-primary" @click="connectToOrbis"> | ||
Verify your account | ||
</button> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<!-- END Connect Wallet modal --> | ||
</template> | ||
|
||
<script> | ||
import { useUserStore } from '~/store/user'; | ||
import { useToast } from "vue-toastification/dist/index.mjs"; | ||
export default { | ||
name: "VerifyAccountOwnership", | ||
methods: { | ||
async connectToOrbis() { | ||
let provider = this.$getFallbackProvider(this.$config.supportedChainId); | ||
let res = await this.$orbis.connect_v2({ | ||
provider: provider.provider, | ||
lit: false | ||
}); | ||
/** Check if connection is successful or not */ | ||
if(res.status == 200) { | ||
this.userStore.setIsConnectedToOrbis(true); | ||
if (this.$orbis.session) { | ||
this.userStore.setDid(this.$orbis.session.did._id); | ||
this.userStore.setDidParent(this.$orbis.session.did._parentId); | ||
} | ||
document.getElementById('closeVerifyAccountModal').click(); | ||
} else { | ||
console.log("Error verifying account: ", res); | ||
this.toast(res.result, {type: "error"}); | ||
} | ||
}, | ||
}, | ||
setup() { | ||
const userStore = useUserStore(); | ||
const toast = useToast(); | ||
return { userStore, toast }; | ||
}, | ||
} | ||
</script> |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.