Skip to content

Commit

Permalink
fixing button colours and placement
Browse files Browse the repository at this point in the history
  • Loading branch information
aradavi63 committed Jan 13, 2025
1 parent 8082b34 commit 613b746
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
18 changes: 3 additions & 15 deletions client/src/components/FriendComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,19 @@ const emit = defineEmits(['accept', 'reject', 'dismiss', 'delete', 'addFriend'])
></v-img>
<v-text class="me-auto font-weight-bold truncate-name">{{ name }}</v-text>

<!-- Default slot for custom content -->
<!-- Default slot-->
<slot name="default"></slot>

<!-- Accept/Reject variant -->
<div v-if="variant === 'acceptReject'" class="acceptreject">
<slot name="acceptreject">
<v-icon
icon="mdi-check"
color="success"
@click="emit('accept')"
class="cursor-pointer"
/>
<v-icon
icon="mdi-close"
color="error"
@click="emit('reject')"
class="cursor-pointer"
/>
Expand All @@ -51,7 +49,6 @@ const emit = defineEmits(['accept', 'reject', 'dismiss', 'delete', 'addFriend'])
<v-btn
color="primaryBlue"
variant="flat"
density="comfortable"
@click="emit('dismiss')"
class="dismiss-btn"
>
Expand All @@ -66,7 +63,6 @@ const emit = defineEmits(['accept', 'reject', 'dismiss', 'delete', 'addFriend'])
<v-btn
color="primaryPink"
variant="flat"
density="comfortable"
@click="showDialog = true"
>
Delete
Expand All @@ -80,10 +76,10 @@ const emit = defineEmits(['accept', 'reject', 'dismiss', 'delete', 'addFriend'])
<v-card-text>Are you sure you want to delete this friend?</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="grey-darken-1" variant="text" @click="showDialog = false">
<v-btn color="primaryBlue" variant="flat" @click="showDialog = false">
Cancel
</v-btn>
<v-btn color="error" variant="text" @click="emit('delete'); showDialog = false">
<v-btn color="primaryPink" variant="flat" @click="emit('delete'); showDialog = false">
Confirm
</v-btn>
</v-card-actions>
Expand All @@ -97,7 +93,6 @@ const emit = defineEmits(['accept', 'reject', 'dismiss', 'delete', 'addFriend'])
<v-btn
color="primaryPink"
variant="flat"
density="comfortable"
@click="emit('addFriend')"
>
Add Friend
Expand Down Expand Up @@ -141,13 +136,6 @@ const emit = defineEmits(['accept', 'reject', 'dismiss', 'delete', 'addFriend'])
margin-left: 8px;
}
.dismiss-btn {
background-color: #1B2B4B !important;
color: white !important;
text-transform: none;
border-radius: 8px;
}
.cursor-pointer {
cursor: pointer;
}
Expand Down
8 changes: 8 additions & 0 deletions client/src/views/FriendView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ const handleAddFriend = (index: number) => {
@addFriend="handleAddFriend(index)"
/>
</v-col>
<v-col v-for="(friend, index) in currentFriends" :key="index" cols="12">
<FriendComponent
:avatar-index="friend.avatarIndex"
:name="friend.name"
variant="accept"
@addFriend="handleAccept(index)"
/>
</v-col>
</v-row>
</v-container>
</template>
Expand Down

0 comments on commit 613b746

Please sign in to comment.