Skip to content

Commit

Permalink
chore: release V1.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
g-luca authored Dec 5, 2023
2 parents 2758155 + a5f9ba2 commit 966897b
Show file tree
Hide file tree
Showing 97 changed files with 20,174 additions and 13,737 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
.yarn
*.log*
.nuxt
.nitro
Expand Down
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
2 changes: 1 addition & 1 deletion app.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup>
// Globally executed on every page load
import { usePostStore } from "./core/store/PostStore";
import { usePostStore } from "~~/core/store/PostStore";
if (process.client) {
const { $useAuth } = useNuxtApp();
Expand Down
4 changes: 2 additions & 2 deletions components/Articles/ArticlesCreate/ArticlesCreateButtons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async function deleteDraft () {
if (useDraftStore().externalId) {
await useDraftStore().deleteDraft();
}
useRouter().push("/profile");
useRouter().push("/home");
}
async function saveDraft () {
Expand All @@ -95,7 +95,7 @@ async function publish () {
}
} else {
$useNotification().error("Ops, an error", "An error occurred while writing on chain", 7);
await useRouter().push("/profile");
await useRouter().push("/articles");
}
isPublishing.value = false;
emit("isPublishing", false);
Expand Down
28 changes: 14 additions & 14 deletions components/Articles/ArticlesCreate/ArticlesEditButtons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ import {
MsgDeletePostEncodeObject,
MsgEditPostEncodeObject
} from "@desmoslabs/desmjs";
import { Url } from "@desmoslabs/desmjs-types/desmos/posts/v2/models";
import { Url } from "@desmoslabs/desmjs-types/desmos/posts/v3/models";
import Long from "long";
import { useAccountStore } from "~~/core/store/AccountStore";
import { useDraftStore } from "~~/core/store/DraftStore";
Expand Down Expand Up @@ -116,7 +116,7 @@ async function publish () {
}
} else {
$useNotification().error("Ops, an error", "An error occurred while writing on chain", 7);
await useRouter().push("/profile");
await useRouter().push("/articles");
}
isPublishing.value = false;
emit("isPublishing", false);
Expand All @@ -132,11 +132,11 @@ async function editArticle () {
const tags = draftStore.tags.filter(tag => tag.content.value !== "" ? tag.content.value : null);
const msgEditPost: MsgEditPostEncodeObject = {
typeUrl: "/desmos.posts.v2.MsgEditPost",
typeUrl: "/desmos.posts.v3.MsgEditPost",
value: {
subspaceId: Long.fromNumber($useDesmosNetwork().subspaceId),
subspaceId: Long.fromNumber(Number($useDesmosNetwork().subspaceId)),
editor: useAccountStore().address,
postId: Long.fromNumber(draftStore.id),
postId: Long.fromNumber(Number(draftStore.id)),
tags: tags.map(tag => tag.content.value),
text: draftStore.title
}
Expand Down Expand Up @@ -186,7 +186,7 @@ async function editArticle () {
urls: entityUrls
};
$useTransaction().assertBalance("/profile");
$useTransaction().assertBalance("/articles");
const success = await $useTransaction().directTx([msgEditPost], [{
id: draftStore.id,
externalId: extId,
Expand All @@ -206,7 +206,7 @@ async function editArticle () {
useRouter().push(`/@${useAccountStore().profile.dtag}/${extId}`);
} else {
$useNotification().error("Ops, an error", "An error occurred while writing on chain", 7);
await useRouter().push("/profile");
await useRouter().push("/articles");
}
isPublishing.value = false;
emit("isPublishing", false);
Expand All @@ -233,17 +233,17 @@ async function deleteArticle () {
).json();
isPublishing.value = false;
emit("isPublishing", false);
await navigateTo("/profile");
await navigateTo("/articles");
return;
}
$useTransaction().assertBalance("/profile");
$useTransaction().assertBalance("/articles");
// otherwise, delete the post from the chain & the backend
const msgDeletePost: MsgDeletePostEncodeObject = {
typeUrl: "/desmos.posts.v2.MsgDeletePost",
typeUrl: "/desmos.posts.v3.MsgDeletePost",
value: {
subspaceId: Long.fromNumber($useDesmosNetwork().subspaceId),
postId: Long.fromNumber(useDraftStore().id),
subspaceId: Long.fromNumber(Number($useDesmosNetwork().subspaceId)),
postId: Long.fromNumber(Number(useDraftStore().id)),
signer: useAccountStore().address
}
};
Expand All @@ -254,10 +254,10 @@ async function deleteArticle () {
}]);
if (success) {
await usePostStore().updateUserPosts();
await useRouter().push("/profile");
await useRouter().push("/articles");
} else {
$useNotification().error("Ops, an error", "An error occurred while writing on chain", 7);
await useRouter().push("/profile");
await useRouter().push("/articles");
}
isPublishing.value = false;
emit("isPublishing", false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="flex flex-row items-center justify-start">
<NuxtLink to="/profile">
<NuxtLink to="/home">
<div class="flex">
<img :src="'/icons/bold/arrow-left.svg'">
<span class="font-semibold">Back</span>
Expand Down
4 changes: 2 additions & 2 deletions components/Articles/ArticlesCreate/ArticlesShareButtons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<img src="/icons/linear/export.svg" class="w-5 h-5 object-contain cursor-pointer">
</NuxtLink>
</NuxtLayout>
<NuxtLayout name="tooltip" :title="'Share on Twitter'" :position="'Bottom'">
<NuxtLayout name="tooltip" :title="'Share on X'" :position="'Bottom'">
<div @click="shareArticle(`https://twitter.com/intent/tweet?text=${title}&url=${sharingUrl}`)">
<img src="/brands/twitter/logo.svg" class="w-5 h-5 object-contain cursor-pointer">
<img src="/brands/x/logo.svg" class="w-5 h-5 object-contain cursor-pointer">
</div>
</NuxtLayout>
<NuxtLayout name="tooltip" :title="'Share on Facebook'" :position="'Bottom'">
Expand Down
17 changes: 9 additions & 8 deletions components/Articles/ArticlesView/ArticlesViewCard.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<template>
<div class="flex h-full flex-col gap-y-1 lg:gap-y-4 overflow-y-scroll bg-background px-4 py-5 md:px-32 lg:py-10 xl:py-0 2xl:w-5/6 md:rounded-2xl m-1" @scroll="handleNavbarChange">
<div class="text-right w-full">
<div class="flex h-full flex-col gap-y-1 lg:gap-y-4 overflow-y-scroll bg-background px-4 py-5 md:px-32 lg:py-10 xl:py-0 2xl:w-5/6 md:rounded-2xl m-1">
<div class="text-right w-full" @scroll="handleNavbarChange">
<ArticlesActionsOverlay :article="props.article" />
</div>
<ArticlesViewContent
:external-id="props.article.externalId"
:title="props.article.text"
:subtitle="props.article.subtitle"
:content="props.article.content"
:address="props.article.author.address"
:address="authorAddress"
:date="new Date(props.article.creationDate)"
:preview="previewImage"
:tags="tags"
/>
<div class="bg-background">
<div class="bg-background md:mx-10 lg:mx-16">
<div class="mb-3">
<a v-if="ipfsSourceUrl" :href="ipfsSourceUrl" target="_blank" class="text-xs pr-2 text-gray hover:text-primary-text">IPFS-1</a>
<a v-if="ipfsSourceAlt" :href="ipfsSourceAlt" target="_blank" class="text-xs pr-2 text-gray hover:text-primary-text">IPFS-2</a>
Expand All @@ -23,12 +23,12 @@
<ArticlesReactions :article="props.article" />
</div>
<div class="flex flex-row gap-x-1.5 place-self-end lg:flex-row-reverse lg:place-self-start">
<ArticlesTipsButton :author="props.article.author.address" />
<ArticlesTipsButton :author="authorAddress" />
</div>
<div class="flex flex-row gap-x-3 lg:col-end-12 lg:place-self-end my-auto">
<NuxtLayout name="tooltip" :title="'Share on Twitter'" :position="'Bottom'">
<div @click="shareArticle(`https://twitter.com/intent/tweet?text=${props.article.text}&url=${sharingUrl}`)">
<img src="/brands/twitter/logo.svg" class="w-5 h-5 object-contain cursor-pointer">
<NuxtLayout name="tooltip" :title="'Share on X'" :position="'Bottom'">
<div @click="shareArticle(`https://x.com/intent/tweet?text=${props.article.text}&url=${sharingUrl}`)">
<img src="/brands/x/logo.svg" class="w-5 h-5 object-contain cursor-pointer">
</div>
</NuxtLayout>
<NuxtLayout name="tooltip" :title="'Share on Facebook'" :position="'Bottom'">
Expand Down Expand Up @@ -76,6 +76,7 @@ if (process.client) {
const sharingUrl = `https://scripta.network${useRoute().fullPath}`;
const sharingUrlEncoded = encodeURIComponent(sharingUrl);
let previewImage = "";
const authorAddress: string = props.article.author?.address || props.article.author as any;
try {
previewImage = props.article.entities?.urls?.find(x => x.displayUrl === "preview")?.url;
Expand Down
4 changes: 2 additions & 2 deletions components/Articles/ArticlesView/ArticlesViewContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
</div>
</div>
</div>
<div class="col-span-12 md:col-span-5 m-auto p-4 w-full">
<div class="col-span-12 md:col-span-5 m-auto p-4 w-full ">
<img
:src="props.preview"
class="rounded-xl object-fill min-h-[8rem] max-h-64 aspect-auto w-full select-none pointer-events-none"
class="block mx-auto min-h-[8rem] max-h-64 h-full aspect-auto w-auto select-none pointer-events-none rounded-xl"
>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions components/Articles/ArticlesView/ArticlesViewSuggested.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="h-28 my-2 overflow-hidden xl:mx-2 hover:bg-background/60 rounded-lg py-2 pl-2.5 xl:pl-0 group">
<div class="w-full flex h-24">
<div class="max-h-36 my-2 overflow-hidden xl:mx-2 hover:bg-background/60 rounded-lg py-2 pl-2.5 xl:pl-0 group">
<div class="w-full flex max-h-36">
<div class="w-1/4 p-1 my-auto">
<ImageWrapper
:img-url="props.post.image ||'/img/author_pic.png'"
Expand All @@ -9,7 +9,7 @@
</div>
<div class="w-3/4 p-1 flex flex-col">
<div class="flex-1">
<p class="leading-tight pt-0.5 font-medium text-primary-text/75 group-hover:text-primary-text-light" :class="props.post.text.length + props.post.subtitle.length >= 100 ? 'block group-hover:hidden text-base' : ' text-lg'">
<p class="leading-tight font-medium text-primary-text/75 group-hover:text-primary-text-light" :class="props.post.text.length + props.post.subtitle.length >= 100 ? 'block group-hover:hidden text-base' : ' text-lg'">
{{ props.post.text.length<=100? props.post.text : props.post.text.substring(0,100) + '...' }}
</p>
<p class="h-full overflow-hidden text-sm font-light text-primary-text-light" :class="props.post.text.length + props.post.subtitle.length >= 100 ? 'hidden group-hover:block' : ''">
Expand Down
12 changes: 8 additions & 4 deletions components/Articles/ArticlesView/ArticlesViewUser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,27 @@
<div v-if="author && author.dtag" class="flex flex-row pt-2 lg:gap-x-2.5">
<NuxtLink :to="`/@${author.dtag}`" class="flex gap-x-3 group">
<ImageWrapper
:img-url="author.pictures.profile ||'/img/author_pic.png'"
:img-url="author.pictures.profile || '/img/author_pic.png'"
:img-class="'w-10 h-10 md:h-12 md:w-12 object-cover my-auto rounded-full pointer-events-none'"
/>
<div class="flex flex-col">
<p class="text-lg font-medium text-primary-text group-hover:text-primary-text-light">
{{ author.nickname || author.dtag }}
</p>
<p class="text-sm font-medium text-primary-text-light">
{{ new Date(props.date).toLocaleString() }}
<p v-if="props.date && props.date.getTime() != 0" class="text-sm font-medium text-primary-text-light">
{{ new Date(props.date).toLocaleDateString() }}
</p>
</div>
</NuxtLink>
<div class="flex-1 my-auto mx-2">
<UserFollowButton :dtag="author?.dtag || ''" :address="author?.account?.address || ''" :follows="useAccountStore().follows || []" />
</div>
</div>
</template>

<script setup lang="ts">
import { Ref } from "vue";
import { useAccountStore } from "~/core/store/AccountStore";
import { useUserStore } from "~~/core/store/UserStore";
import { NavBarReadingType } from "~~/layouts/readingCustom.vue";
Expand All @@ -30,7 +34,7 @@ interface Props {
const props = defineProps<Props>();
const author = await useUserStore().getUser(props.address, true);
const navBarReading : Ref<NavBarReadingType> = inject("navBarReading");
const navBarReading: Ref<NavBarReadingType> = inject("navBarReading");
// eslint-disable-next-line vue/no-setup-props-destructure
navBarReading.value.address = props.address;
// eslint-disable-next-line vue/no-setup-props-destructure
Expand Down
2 changes: 1 addition & 1 deletion components/Articles/Comments/CommentsActionsOverlay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function deleteComment () {
toggleOverlay();
const msgDeletePost: MsgDeletePostEncodeObject = {
typeUrl: "/desmos.posts.v2.MsgDeletePost",
typeUrl: "/desmos.posts.v3.MsgDeletePost",
value: {
subspaceId: Long.fromNumber($useDesmosNetwork().subspaceId),
postId: Long.fromNumber(props.comment.id),
Expand Down
2 changes: 1 addition & 1 deletion components/Articles/Comments/CommentsEditContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (process.client) {
function edit () {
const { $useTransaction, $useDesmosNetwork } = useNuxtApp();
const msgEditComment: MsgEditPostEncodeObject = {
typeUrl: "/desmos.posts.v2.MsgEditPost",
typeUrl: "/desmos.posts.v3.MsgEditPost",
value: {
subspaceId: Long.fromNumber($useDesmosNetwork().subspaceId),
postId: Long.fromNumber(props.comment.id),
Expand Down
2 changes: 1 addition & 1 deletion components/Articles/Comments/CommentsWriteContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function postComment () {
const extId = uuidv4();
const referencedPost = Long.fromNumber(props.referencedPost);
const msgCreateComment: MsgCreatePostEncodeObject = {
typeUrl: "/desmos.posts.v2.MsgCreatePost",
typeUrl: "/desmos.posts.v3.MsgCreatePost",
value: {
subspaceId: Long.fromNumber($useDesmosNetwork().subspaceId),
externalId: extId,
Expand Down
2 changes: 1 addition & 1 deletion components/Auth/DesmosApp/AuthDesmosAppQRCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</template>

<script setup lang="ts">
import { SupportedSigner } from "../../../types/SupportedSigner";
import { SupportedSigner } from "~~/types/SupportedSigner";
async function connect () {
const { $useWallet } = useNuxtApp();
Expand Down
12 changes: 7 additions & 5 deletions components/Auth/Keplr/AuthKeplrCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
import { useKeplrStore } from "~~/core/store/wallet/KeplrStore";
const maxPages = 1;
const count = ref(0);
const hasKeplr = computed(() => useKeplrStore().isAvailable);
// If Keplr is available, skip the download page
if (hasKeplr) {
editCount(1);
}
// If Leap is available, skip the download page
onMounted(() => {
if (useKeplrStore().isInstalled) {
editCount(1);
}
});
function editCount (n: number) {
if (n > 0 && count.value < maxPages) {
count.value += n;
Expand Down
2 changes: 1 addition & 1 deletion components/Auth/Keplr/AuthKeplrConnectCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</template>

<script setup lang="ts">
import { SupportedSigner } from "../../../types/SupportedSigner";
import { SupportedSigner } from "~~/types/SupportedSigner";
const isConnecting = ref(false);
/**
* Keplr Connection
Expand Down
36 changes: 36 additions & 0 deletions components/Auth/Leap/AuthLeapCard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<template>
<AuthCard>
<template #card>
<AuthLeapDownloadCard v-if="count == 0" />
<AuthLeapConnectCard v-else />
</template>
<template #buttons>
<AuthButtonsBack @edit-page="editCount">
<AuthButtonsBackRouting v-if="count == 0" to="/auth" />
</AuthButtonsBack>
<!-- Let the user proceed only if Leap is installed -->
<AuthButtonsNext v-if="count < maxPages && useLeapStore().isAvailable" @edit-page="editCount" />
</template>
</AuthCard>
</template>

<script setup lang="ts">
import { useLeapStore } from "~~/core/store/wallet/LeapStore";
const maxPages = 1;
const count = ref(0);
// If Leap is available, skip the download page
onMounted(() => {
if (useLeapStore().isInstalled) {
editCount(1);
}
});
function editCount (n: number) {
if (n > 0 && count.value < maxPages) {
count.value += n;
} else if (n < 0 && count.value > 0) {
count.value += n;
}
}
</script>
Loading

0 comments on commit 966897b

Please sign in to comment.