mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Refactor styling, fix naming convention
- Emotions buttons were not displaying images correctly - Follow vue guidelines for multiword naming convention - Favor tokens over magic px numbers
This commit is contained in:
parent
eaf738c12b
commit
81cbb7a85c
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="emotion-button">
|
<div class="emotion-button">
|
||||||
<base-button :id="emotion" circle ghost @click="$emit('toggleEmotion', emotion)">
|
<base-button :id="emotion" circle ghost @click="$emit('toggleEmotion', emotion)">
|
||||||
<img :src="emojiPath" />
|
<img class="image" :src="emojiPath" />
|
||||||
</base-button>
|
</base-button>
|
||||||
<label class="label" :for="emotion">{{ $t(`contribution.emotions-label.${emotion}`) }}</label>
|
<label class="label" :for="emotion">{{ $t(`contribution.emotions-label.${emotion}`) }}</label>
|
||||||
<p v-if="emotionCount !== null" class="count">{{ emotionCount }}x</p>
|
<p v-if="emotionCount !== null" class="count">{{ emotionCount }}x</p>
|
||||||
@ -52,5 +52,10 @@ export default {
|
|||||||
> .count {
|
> .count {
|
||||||
margin: $space-x-small 0;
|
margin: $space-x-small 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
max-width: $size-button-base;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -19,7 +19,7 @@ storiesOf('Paginate', module)
|
|||||||
back: action('back'),
|
back: action('back'),
|
||||||
next: action('next'),
|
next: action('next'),
|
||||||
},
|
},
|
||||||
template: `<paginate
|
template: `<pagination-buttons
|
||||||
:hasNext="hasNext"
|
:hasNext="hasNext"
|
||||||
:hasPrevious="hasPrevious"
|
:hasPrevious="hasPrevious"
|
||||||
@back="back"
|
@back="back"
|
||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="paginate">
|
<div class="pagination-buttons">
|
||||||
<base-button
|
<base-button
|
||||||
@click="$emit('back')"
|
@click="$emit('back')"
|
||||||
:disabled="!hasPrevious"
|
:disabled="!hasPrevious"
|
||||||
@ -33,7 +33,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.paginate {
|
.pagination-buttons {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
width: $size-width-paginate;
|
width: $size-width-paginate;
|
||||||
@ -7,7 +7,7 @@
|
|||||||
</client-only>
|
</client-only>
|
||||||
</div>
|
</div>
|
||||||
<reports-table :reports="reports" @confirm="openModal" />
|
<reports-table :reports="reports" @confirm="openModal" />
|
||||||
<paginate :hasNext="hasNext" :hasPrevious="hasPrevious" @back="back" @next="next" />
|
<pagination-buttons :hasNext="hasNext" :hasPrevious="hasPrevious" @back="back" @next="next" />
|
||||||
</ds-card>
|
</ds-card>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@ -15,13 +15,13 @@ import { mapMutations } from 'vuex'
|
|||||||
import DropdownFilter from '~/components/DropdownFilter/DropdownFilter'
|
import DropdownFilter from '~/components/DropdownFilter/DropdownFilter'
|
||||||
import ReportsTable from '~/components/features/ReportsTable/ReportsTable'
|
import ReportsTable from '~/components/features/ReportsTable/ReportsTable'
|
||||||
import { reportsListQuery, reviewMutation } from '~/graphql/Moderation.js'
|
import { reportsListQuery, reviewMutation } from '~/graphql/Moderation.js'
|
||||||
import Paginate from '~/components/Paginate/Paginate'
|
import PaginationButtons from '~/components/_new/generic/PaginationButtons/PaginationButtons'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
DropdownFilter,
|
DropdownFilter,
|
||||||
ReportsTable,
|
ReportsTable,
|
||||||
Paginate,
|
PaginationButtons,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const pageSize = 25
|
const pageSize = 25
|
||||||
|
|||||||
@ -22,6 +22,6 @@ export default {
|
|||||||
|
|
||||||
// override styleguide styles
|
// override styleguide styles
|
||||||
.search-heading.ds-heading:first-child {
|
.search-heading.ds-heading:first-child {
|
||||||
margin-top: -8px;
|
margin-top: -$space-x-small;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -50,7 +50,7 @@
|
|||||||
{{ scope.row.createdAt | dateTime }}
|
{{ scope.row.createdAt | dateTime }}
|
||||||
</template>
|
</template>
|
||||||
</ds-table>
|
</ds-table>
|
||||||
<hc-paginate :hasNext="hasNext" :hasPrevious="hasPrevious" @next="next" @back="back" />
|
<pagination-buttons :hasNext="hasNext" :hasPrevious="hasPrevious" @next="next" @back="back" />
|
||||||
</ds-card>
|
</ds-card>
|
||||||
<ds-card v-else>
|
<ds-card v-else>
|
||||||
<ds-placeholder>{{ $t('admin.users.empty') }}</ds-placeholder>
|
<ds-placeholder>{{ $t('admin.users.empty') }}</ds-placeholder>
|
||||||
@ -62,11 +62,11 @@
|
|||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { isEmail } from 'validator'
|
import { isEmail } from 'validator'
|
||||||
import normalizeEmail from '~/components/utils/NormalizeEmail'
|
import normalizeEmail from '~/components/utils/NormalizeEmail'
|
||||||
import HcPaginate from '~/components/Paginate/Paginate'
|
import PaginationButtons from '~/components/_new/generic/PaginationButtons/PaginationButtons'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
HcPaginate,
|
PaginationButtons,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const pageSize = 15
|
const pageSize = 15
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import NotificationsPage from './index.vue'
|
|||||||
|
|
||||||
import DropdownFilter from '~/components/DropdownFilter/DropdownFilter'
|
import DropdownFilter from '~/components/DropdownFilter/DropdownFilter'
|
||||||
import NotificationsTable from '~/components/NotificationsTable/NotificationsTable'
|
import NotificationsTable from '~/components/NotificationsTable/NotificationsTable'
|
||||||
import Paginate from '~/components/Paginate/Paginate'
|
import PaginationButtons from '~/components/_new/generic/PaginationButtons/PaginationButtons'
|
||||||
|
|
||||||
const localVue = global.localVue
|
const localVue = global.localVue
|
||||||
|
|
||||||
@ -122,14 +122,14 @@ describe('PostIndex', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('Paginate', () => {
|
describe('PaginationButtons', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper = Wrapper()
|
wrapper = Wrapper()
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('next: given a user is on the first page', () => {
|
describe('next: given a user is on the first page', () => {
|
||||||
it('adds offset to pageSize to skip first x notifications and display next page', () => {
|
it('adds offset to pageSize to skip first x notifications and display next page', () => {
|
||||||
wrapper.find(Paginate).vm.$emit('next')
|
wrapper.find(PaginationButtons).vm.$emit('next')
|
||||||
expect(wrapper.vm.offset).toEqual(12)
|
expect(wrapper.vm.offset).toEqual(12)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -137,7 +137,7 @@ describe('PostIndex', () => {
|
|||||||
describe('back: given a user is on the third page', () => {
|
describe('back: given a user is on the third page', () => {
|
||||||
it('sets offset when back is emitted', () => {
|
it('sets offset when back is emitted', () => {
|
||||||
wrapper.setData({ offset: 24 })
|
wrapper.setData({ offset: 24 })
|
||||||
wrapper.find(Paginate).vm.$emit('back')
|
wrapper.find(PaginationButtons).vm.$emit('back')
|
||||||
expect(wrapper.vm.offset).toEqual(12)
|
expect(wrapper.vm.offset).toEqual(12)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -15,21 +15,21 @@
|
|||||||
@markNotificationAsRead="markNotificationAsRead"
|
@markNotificationAsRead="markNotificationAsRead"
|
||||||
:notifications="notifications"
|
:notifications="notifications"
|
||||||
/>
|
/>
|
||||||
<paginate :hasNext="hasNext" :hasPrevious="hasPrevious" @back="back" @next="next" />
|
<pagination-buttons :hasNext="hasNext" :hasPrevious="hasPrevious" @back="back" @next="next" />
|
||||||
</ds-card>
|
</ds-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import NotificationsTable from '~/components/NotificationsTable/NotificationsTable'
|
import NotificationsTable from '~/components/NotificationsTable/NotificationsTable'
|
||||||
import DropdownFilter from '~/components/DropdownFilter/DropdownFilter'
|
import DropdownFilter from '~/components/DropdownFilter/DropdownFilter'
|
||||||
import Paginate from '~/components/Paginate/Paginate'
|
import PaginationButtons from '~/components/_new/generic/PaginationButtons/PaginationButtons'
|
||||||
import { notificationQuery, markAsReadMutation } from '~/graphql/User'
|
import { notificationQuery, markAsReadMutation } from '~/graphql/User'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
DropdownFilter,
|
DropdownFilter,
|
||||||
NotificationsTable,
|
NotificationsTable,
|
||||||
Paginate,
|
PaginationButtons,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const pageSize = 12
|
const pageSize = 12
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user