move hint inside Timeline component

This commit is contained in:
Xiaofeng An 2019-02-05 15:43:56 -05:00
parent bf642ebab7
commit d2436fb9e5
4 changed files with 52 additions and 56 deletions

View file

@ -4,8 +4,7 @@ const PublicTimeline = {
Timeline
},
computed: {
timeline () { return this.$store.state.statuses.timelines.public },
currentUser () { return this.$store.state.users.currentUser }
timeline () { return this.$store.state.statuses.timelines.public }
},
created () {
this.$store.dispatch('startFetching', 'public')

View file

@ -1,32 +1,5 @@
<template>
<div>
<div v-if="!currentUser" class="login-hint panel panel-default">
<div class="panel-body">
<router-link :to="{ name: 'login' }">
{{ $t("login.hint") }}
</router-link>
</div>
</div>
<Timeline :title="$t('nav.public_tl')" v-bind:timeline="timeline" v-bind:timeline-name="'public'"/>
</div>
</template>
<script src="./public_timeline.js"></script>
<style lang="scss">
@import '../../_variables.scss';
.login-hint {
text-align: center;
@media all and (min-width: 801px) {
display: none;
}
a {
display: inline-block;
padding: 1em 0px;
width: 100%;
}
}
</style>

View file

@ -39,7 +39,8 @@ const Timeline = {
body: ['timeline-body'].concat(!this.embedded ? ['panel-body'] : []),
footer: ['timeline-footer'].concat(!this.embedded ? ['panel-footer'] : [])
}
}
},
currentUser () { return this.$store.state.users.currentUser }
},
components: {
Status,

View file

@ -1,4 +1,12 @@
<template>
<div>
<div v-if="!currentUser" class="login-hint panel panel-default">
<div class="panel-body">
<router-link :to="{ name: 'login' }">
{{ $t("login.hint") }}
</router-link>
</div>
</div>
<div :class="classes.root">
<div :class="classes.header">
<div class="title">
@ -31,6 +39,7 @@
</div>
</div>
</div>
</div>
</template>
<script src="./timeline.js"></script>
@ -56,4 +65,18 @@
background-color: $fallback--fg;
background-color: var(--panel, $fallback--fg);
}
.login-hint {
text-align: center;
@media all and (min-width: 801px) {
display: none;
}
a {
display: inline-block;
padding: 1em 0px;
width: 100%;
}
}
</style>