pinafore/routes/_components/status/StatusToolbar.html

69 lines
1.6 KiB
HTML
Raw Normal View History

<div class="status-toolbar {{isStatusInOwnThread ? 'status-in-own-thread' : ''}}">
2018-01-28 20:51:48 +00:00
<IconButton
label="Reply"
href="#fa-reply"
/>
<IconButton
2018-02-19 18:34:36 +00:00
label="{{boostLabel}}"
pressable="{{!boostDisabled}}"
2018-01-28 20:51:48 +00:00
pressed="{{status.reblogged}}"
2018-02-19 18:34:36 +00:00
disabled="{{boostDisabled}}"
href="{{boostIcon}}"
2018-01-28 20:51:48 +00:00
/>
<IconButton
label="Favorite"
pressable="true"
pressed="{{status.favourited}}"
href="#fa-star"
/>
<IconButton
label="Show more actions"
href="#fa-ellipsis-h"
/>
</div>
<style>
.status-toolbar {
2018-02-10 04:07:48 +00:00
grid-area: toolbar;
display: flex;
justify-content: space-between;
}
.status-toolbar.status-in-own-thread {
margin-left: 58px;
}
</style>
<script>
2018-01-28 20:51:48 +00:00
import IconButton from '../IconButton.html'
export default {
2018-01-28 20:51:48 +00:00
components: {
IconButton
2018-02-19 18:34:36 +00:00
},
computed: {
visibility: (status) => status.visibility,
boostLabel: (visibility) => {
switch (visibility) {
case 'private':
return 'Cannot be boosted because this is followers-only'
case 'direct':
return 'Cannot be boosted because this is a direct message'
default:
return 'Boost'
}
},
boostIcon: (visibility) => {
switch (visibility) {
case 'private':
return '#fa-lock'
case 'direct':
return '#fa-envelope'
default:
return '#fa-retweet'
}
},
boostDisabled: (visibility) => {
return visibility === 'private' || visibility === 'direct'
}
2018-01-28 20:51:48 +00:00
}
}
</script>