Skip to content

Commit

Permalink
fixed condition for opening modal
Browse files Browse the repository at this point in the history
  • Loading branch information
synan798 committed Dec 11, 2024
1 parent e6d9c43 commit 45fce37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion components/home/Users/UserBox.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { ref } from 'vue';
import { FriendshipStatus } from '@/types/api/user.friends';
import { UserViewType } from '@/types/components/users.view';
const props = defineProps({
profilePicture: {
Expand Down Expand Up @@ -64,5 +65,5 @@ const showModal = ref(false);
<Icon name="mdi:play" class="w-8 h-8 sm:w-10 sm:h-10 md:w-12 md:h-12 lg:w-14 lg:h-14 text-white" />
</button>
</div>
<ProfileUserModal v-show="showModal" :profile-picture="props.profilePicture" :name="props.name" :friendship-id="props.friendshipId" :friends-status="props.friendsStatus" :friend-id="props.friendId" :view-type="props.viewType" @close-modal="showModal = false"/>
<ProfileUserModal v-if="viewType === UserViewType.FRIENDS || viewType === UserViewType.REQUESTS" v-show="showModal" :profile-picture="props.profilePicture" :name="props.name" :friendship-id="props.friendshipId" :friends-status="props.friendsStatus" :friend-id="props.friendId" :view-type="props.viewType" @close-modal="showModal = false"/>
</template>
6 changes: 3 additions & 3 deletions components/profile/UserModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const props = defineProps({
default: FriendshipStatus.ACCEPTED
},
friendId: {
type: Number,
type: String,
required: true
},
viewType: {
Expand Down Expand Up @@ -81,9 +81,9 @@ async function getFriendInformation() {
<div class="modal-overlay">
<div class="modal">
<NuxtImg :src="profilePicture" class="rounded-full h-32 w-32 mb-3" />
<p v-if="props.viewType === UserViewType.SENTREQUESTS">Do you want to accept {{ name }}'s friend request?'</p>
<p v-if="props.viewType === UserViewType.REQUESTS">Do you want to accept {{ name }}'s friend request?'</p>
<p v-else>Streak: {{ }}</p>
<div v-if="props.viewType === UserViewType.SENTREQUESTS" class="flex mt-5 gap-10">
<div v-if="props.viewType === UserViewType.REQUESTS" class="flex mt-5 gap-10">
<div :class="icon_wrapper" @click="handleFriendship(FriendshipAction.DECLINE)">
<Icon name="mdi:close" class="text-5xl text-red-600" />
</div>
Expand Down

0 comments on commit 45fce37

Please sign in to comment.