fix: Align delete message menu on twitter bubble correctly (#2591)
* fix: Aligns delete message menu on twitter bubble correctly * Fixes alignment issues
This commit is contained in:
committed by
GitHub
parent
38cce3c1c0
commit
efd6f735dc
@@ -43,16 +43,6 @@
|
|||||||
:source-id="data.source_id"
|
:source-id="data.source_id"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<context-menu
|
|
||||||
v-if="isBubble"
|
|
||||||
:is-open="showContextMenu"
|
|
||||||
:show-copy="hasText"
|
|
||||||
:menu-position="contextMenuPosition"
|
|
||||||
@toggle="handleContextMenuClick"
|
|
||||||
@delete="handleDelete"
|
|
||||||
@copy="handleCopy"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<spinner v-if="isPending" size="tiny" />
|
<spinner v-if="isPending" size="tiny" />
|
||||||
|
|
||||||
<a
|
<a
|
||||||
@@ -72,6 +62,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
<context-menu
|
||||||
|
v-if="isBubble"
|
||||||
|
:is-open="showContextMenu"
|
||||||
|
:show-copy="hasText"
|
||||||
|
:menu-position="contextMenuPosition"
|
||||||
|
@toggle="handleContextMenuClick"
|
||||||
|
@delete="handleDelete"
|
||||||
|
@copy="handleCopy"
|
||||||
|
/>
|
||||||
</li>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -169,11 +168,17 @@ export default {
|
|||||||
alignBubble() {
|
alignBubble() {
|
||||||
const { message_type: messageType } = this.data;
|
const { message_type: messageType } = this.data;
|
||||||
const isCentered = messageType === MESSAGE_TYPE.ACTIVITY;
|
const isCentered = messageType === MESSAGE_TYPE.ACTIVITY;
|
||||||
|
const isLeftAligned = messageType === MESSAGE_TYPE.INCOMING;
|
||||||
|
const isRightAligned =
|
||||||
|
messageType === MESSAGE_TYPE.OUTGOING ||
|
||||||
|
messageType === MESSAGE_TYPE.TEMPLATE;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
center: isCentered,
|
center: isCentered,
|
||||||
left: !messageType,
|
left: isLeftAligned,
|
||||||
right: !!messageType,
|
right: isRightAligned,
|
||||||
'has-context-menu': this.showContextMenu,
|
'has-context-menu': this.showContextMenu,
|
||||||
|
'has-tweet-menu': this.isATweet,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
readableTime() {
|
readableTime() {
|
||||||
@@ -350,22 +355,29 @@ export default {
|
|||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrap {
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-end;
|
|
||||||
}
|
|
||||||
|
|
||||||
li.right .wrap {
|
|
||||||
flex-direction: row-reverse;
|
|
||||||
}
|
|
||||||
|
|
||||||
li.left,
|
li.left,
|
||||||
li.right {
|
li.right {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
|
||||||
&:hover .button--delete-message {
|
&:hover .button--delete-message {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
li.left.has-tweet-menu .context-menu {
|
||||||
|
margin-bottom: var(--space-medium);
|
||||||
|
}
|
||||||
|
|
||||||
|
li.right .context-menu {
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
li.right {
|
||||||
|
flex-direction: row-reverse;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
.has-context-menu {
|
.has-context-menu {
|
||||||
background: var(--color-background);
|
background: var(--color-background);
|
||||||
.button--delete-message {
|
.button--delete-message {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
size="large"
|
size="large"
|
||||||
class="button--delete-message"
|
class="button--delete-message"
|
||||||
color-scheme="secondary"
|
color-scheme="secondary"
|
||||||
variant="clear"
|
variant="link"
|
||||||
@click="handleContextMenuClick"
|
@click="handleContextMenuClick"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
@@ -82,7 +82,7 @@ export default {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
/* TDOD: Remove once MenuComponent supports postions */
|
/* TDOD: Remove once MenuComponent supports postions */
|
||||||
.dropdown-pane {
|
.dropdown-pane {
|
||||||
bottom: var(--space-large);
|
bottom: var(--space-medium);
|
||||||
}
|
}
|
||||||
.dropdown-pane--left {
|
.dropdown-pane--left {
|
||||||
right: var(--space-small);
|
right: var(--space-small);
|
||||||
|
|||||||
Reference in New Issue
Block a user