mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Add: overflow container when list has more than 7 items
This commit is contained in:
parent
bf7bd6fd59
commit
5a2c8220af
@ -58,6 +58,7 @@ describe('FollowList.vue', () => {
|
|||||||
it(`shows the users ${type}`, () => {
|
it(`shows the users ${type}`, () => {
|
||||||
expect(wrapper.findAll('.user-teaser').length).toEqual(user[type].length)
|
expect(wrapper.findAll('.user-teaser').length).toEqual(user[type].length)
|
||||||
})
|
})
|
||||||
|
|
||||||
it(`has a button to load all remaining users ${type}`, async () => {
|
it(`has a button to load all remaining users ${type}`, async () => {
|
||||||
jest.useFakeTimers()
|
jest.useFakeTimers()
|
||||||
|
|
||||||
@ -74,6 +75,12 @@ describe('FollowList.vue', () => {
|
|||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('given more than 7 connections', () => {
|
||||||
|
it('displays them in an overflow container', () => {
|
||||||
|
wrapper.find('')
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
{{ userName | truncate(15) }} {{ $t(`profile.network.${type}`) }}
|
{{ userName | truncate(15) }} {{ $t(`profile.network.${type}`) }}
|
||||||
</ds-text>
|
</ds-text>
|
||||||
</ds-space>
|
</ds-space>
|
||||||
<template v-if="this.connections && this.connections.length">
|
<template v-if="this.connections && this.connections.length <= 7">
|
||||||
<ds-space v-for="follow in uniq(this.connections)" :key="follow.id" margin="x-small">
|
<ds-space v-for="follow in uniq(this.connections)" :key="follow.id" margin="x-small">
|
||||||
<!-- TODO: find better solution for rendering errors -->
|
<!-- TODO: find better solution for rendering errors -->
|
||||||
<client-only>
|
<client-only>
|
||||||
@ -22,6 +22,15 @@
|
|||||||
</base-button>
|
</base-button>
|
||||||
</ds-space>
|
</ds-space>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-else-if="this.connections.length > 7">
|
||||||
|
<div class="overflow-container">
|
||||||
|
<ds-space v-for="follow in uniq(this.connections)" :key="follow.id" margin="x-small">
|
||||||
|
<client-only>
|
||||||
|
<user-teaser :user="follow" />
|
||||||
|
</client-only>
|
||||||
|
</ds-space>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<p style="text-align: center; opacity: .5;">
|
<p style="text-align: center; opacity: .5;">
|
||||||
{{ userName }} {{ $t(`profile.network.${type}Nobody`) }}
|
{{ userName }} {{ $t(`profile.network.${type}Nobody`) }}
|
||||||
@ -80,3 +89,10 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.overflow-container {
|
||||||
|
max-height: 350px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user