Files
habitica/website/client/src/components/shops/itemWithLabel.vue
T
negue a8b58815b4 Update Party / Group Sidebar / Quest states (#12793)
* move groups/sidebar to groupSidebar.vue

* lint files

* extract group/party sidebar to rightSidebar.vue

* wip stories with example data

* update stories - wip sidebar re-styling

* message party / group leader + move items to the menu

* update paddings /place for quest section

* invite to party / guild

* update labels (* Party / Guild )

* guild-background to group-background

* correct menu order + missing a label based on the group type

* no quest - styles / layout applied

* quest owner / not started - styles applied   + extracted questActions from questDetailsModal.vue to a mixin

* no challenge style

* hover with underlines

* quest-pending area layout / margins

* "Collection Quest/Quest Owner Participating" Styling Done

* group sidebar menu with icons / background

* remove most participate button styles

* fix quest-invite panel

* move "Start Quest" + add "Leave Quest"

* Not Participating + Boss + Rage Quests restyling

* party quest changes - invitedToQuest + button styles + no-items style + view details

* fix icons + rage value + colors

* fix duplicate key

* hide items label if 0 items found + hide pending damage if there is none + sidebar section margin + fix percent calculation 0 => 0%

* combine quest abandon / cancel to one call + hide begin if quest has already started + close modal if quest was canceled

* remove unused translate string

* allow leaving an accepted but inactive quest + disable leave when user is quest leader

* update "are you sure" questions - remove "doubleSureAbort" - add "sureLeaveInactive"

* sidebar margins + menu icon color

* refactored css rules

* improve some styles

* fix button spacing

* fix dropmenu with icon hover

* hide leave quest for leaders + fix quest buttons spacing

* add pending items label

* remove "X items found" label

* first round of fixes

* last v-once

* Update Quest Dialogs (#13112)

* new quest rewards panel + extract questPopover and itemWithLabel

* WIP: questInfo still not applying the row-height..

* split up start-quest-modal into select and detail modal - also rename the current quest-details to be the group-quest-details modal

* remove start-quest-modal from modal-scss

* update package-lock

* WIP before using the quest sidebar branch as a base

* move quest detail actions to the "new" details dialog

* quest details layout for owner / participant

* fix quest rewards - open details modal from sidebar

* apply quest-details dialog styles to the buyQuestModal one

* fix quest reward icons / popover / texts

* WIP back to quest selection

* fix lint

* merge selectQuestModal.vue with questDetailModal.vue + UI for the select quest

* fix margins / layout / labels

* fix quest detail + wip invitationListModal.vue / participantListModal.vue

* fix questmodal user label centered

* fix centered reward items + grouping items and adding a count-badge

* sort quests by AZ or quantity

* invitations modal

* remove console.info

* complete participantListModal.vue + extracted getClassName

* missed a file for getClassName extraction

* fix invitations

* select the actual quest on details

* fix margins on invite to party / start quest buttons

* replace buyQuestModal close button and title

* fix recursion due to the same name

* missing import

* sort quantity by highest first

* fix "Can't find a Quest to start" styles

* fix "your balance" padding

* fix quest collections / drop items

* fix member details in participants list

* fix quest info

* remove nullable because the build doesn't like it (on this file..)

* add questCompleted to the stories + fix getDropName

* replace quest-rewards in questCompleted.vue

* fix questCompleted.vue style

* delete obsolete components

* add missing spritesheets to storebook

* requested pr changes

* refactored fetchMember

* revert optional chaining

* fix merge conflicts

* fix rightSidebar hover colors - $scss var to css var

* overflow auto instead of scroll

* prevent wrapping of quest collections

* rollback to multi line quest items

* use min-width for the quest popover
2021-05-28 16:11:43 -05:00

222 lines
3.7 KiB
Vue

<template>
<div>
<div
:id="itemId"
class="item-wrapper"
tabindex="0"
@click="click()"
@keypress.enter="click()"
>
<div
class="item"
:class="getItemClasses()"
>
<slot
name="badges"
:item="item"
:emptyItem="emptyItem"
></slot>
<div class="image">
<div
v-once
:class="item.class"
></div>
<slot
name="itemImage"
:item="item"
></slot>
</div>
<div
class="d-flex label-holder align-items-center justify-content-center"
:class="labelClass"
>
<slot
name="label"
:item="item"
></slot>
</div>
</div>
</div>
<b-popover
v-if="showPopover"
:target="itemId"
triggers="hover focus"
:placement="popoverPosition"
>
<slot
name="popoverContent"
:item="item"
>
</slot>
</b-popover>
</div>
</template>
<style lang="scss" scoped>
@import '~@/assets/scss/colors.scss';
.item-wrapper {
z-index: 10;
}
.item {
height: 7.5rem;
width: 94px;
border-radius: 4px;
background-color: $white;
box-shadow: 0 1px 3px 0 rgba($black, 0.12), 0 1px 2px 0 rgba($black, 0.24);
cursor: initial;
display: flex;
flex-direction: column;
&:hover {
border-color: transparent;
}
&.locked .price {
opacity: 0.5;
}
}
.image {
margin: 12px 13px;
flex: 1;
align-items: center;
justify-content: center;
display: flex;
}
.label-holder {
height: 28px;
font-weight: bold;
line-height: 1.33;
text-align: center;
background-color: $gray-700;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
.label-holder.purple {
margin: -1px;
color: $purple-300;
background-color: rgba($purple-400, .1);
}
.label-holder.yellow {
color: $yellow-5;
}
span.svg-icon.inline.lock {
height: 12px;
width: 10px;
position: absolute;
right: 8px;
top: 8px;
margin-top: 0;
color: $gray-200;
}
span.badge.badge-round.badge-item.badge-clock {
height: 24px;
width: 24px;
background-color: $purple-300;
position: absolute;
left: -8px;
top: -12px;
margin-top: 0;
padding: 4px;
}
span.svg-icon.inline.clock {
height: 16px;
width: 16px;
}
.suggestedDot {
width: 6px;
height: 6px;
background-color: $purple-400;
border-radius: 4px;
position: absolute;
right: 8px;
top: 8px;
margin-top: 0;
}
.icon-48 {
width: 48px;
height: 48px;
}
.w-0 {
width: 0rem;
}
</style>
<script>
import { v4 as uuid } from 'uuid';
export default {
components: {
},
props: {
item: {
type: Object,
},
price: {
type: Number,
default: -1,
},
emptyItem: {
type: Boolean,
default: false,
},
highlightBorder: {
type: Boolean,
default: false,
},
popoverPosition: {
type: String,
default: 'bottom',
},
showPopover: {
type: Boolean,
default: true,
},
showEventBadge: {
type: Boolean,
default: true,
},
owned: {
type: Boolean,
default: false,
},
labelClass: {
type: String,
},
},
data () {
return Object.freeze({
itemId: uuid(),
});
},
computed: {
},
methods: {
click () {
this.$emit('click', {});
},
getItemClasses () {
return {
'item-empty': this.emptyItem,
'highlight-border': this.highlightBorder,
suggested: this.item.isSuggested,
locked: this.item.locked,
};
},
},
};
</script>