pinafore/routes/_components/profile/AccountProfileMeta.html

92 lines
2.1 KiB
HTML
Raw Normal View History

{#if emojifiedFields.length}
<div class="account-profile-meta">
<div class="account-profile-meta-border"></div>
{#each emojifiedFields as field, i}
<div class="account-profile-meta-cell account-profile-meta-name">
{field.name}
</div>
<div class="account-profile-meta-cell account-profile-meta-value">
{@html field.value}
</div>
{/each}
<div class="account-profile-meta-border"></div>
</div>
{/if}
2018-08-21 04:41:42 +02:00
<style>
.account-profile-meta {
grid-area: meta;
2018-08-21 04:41:42 +02:00
display: grid;
grid-template-columns: max-content 1fr;
grid-row-gap: 5px;
align-items: center;
2018-08-21 04:41:42 +02:00
padding: 10px 0;
}
.account-profile-meta-border {
height: 1px;
width: 100%;
grid-column: 1 / 3;
background: var(--main-border);
justify-self: center;
2018-08-21 04:41:42 +02:00
}
.account-profile-meta-cell {
word-wrap: break-word;
overflow: hidden;
white-space: pre-wrap;
text-overflow: ellipsis;
font-size: 1.1em;
2018-08-21 04:41:42 +02:00
}
.account-profile-meta-name {
padding: 10px 20px 10px 0;
text-transform: uppercase;
color: var(--deemphasized-text-color);
2018-08-21 04:41:42 +02:00
position: relative;
max-width: 40vw;
2018-08-21 04:41:42 +02:00
}
.account-profile-meta-name:after {
2018-08-21 04:41:42 +02:00
content: '';
position: absolute;
right: 0;
top: 15%;
height: 70%;
border-right: 1px solid var(--main-border);
}
.account-profile-meta-value {
padding: 10px 10px 10px 20px;
2018-08-21 04:41:42 +02:00
}
@media (max-width: 767px) {
.account-profile-meta {
padding: 5px 0;
}
.account-profile-meta-cell {
font-size: 1em;
2018-08-21 04:41:42 +02:00
}
.account-profile-meta-name {
padding: 5px 10px 5px 0;
2018-08-21 04:41:42 +02:00
}
.account-profile-meta-value {
padding: 5px 10px 5px 10px;
2018-08-21 04:41:42 +02:00
}
}
</style>
<script>
import { emojifyText } from '../../_utils/emojifyText'
import { store } from '../../_store/store'
2018-08-21 04:41:42 +02:00
export default {
store: () => store,
2018-08-21 04:41:42 +02:00
computed: {
emojis: ({ account }) => account.emojis || [],
fields: ({ account }) => account.fields || [],
emojifiedFields: ({ fields, emojis, $autoplayGifs }) => (fields.map(field => ({
name: field.name,
value: emojifyText(field.value, emojis, $autoplayGifs)
})))
2018-08-21 04:41:42 +02:00
}
}
</script>