Merge pull request #44286 from nextcloud/fix/app-discover-media-size

fix(settings): Ensure media for app discover section is scaled correctly
pull/44328/head
Andy Scherzinger 2024-03-19 20:08:53 +07:00 committed by GitHub
commit 83746f7049
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 31 additions and 15 deletions

@ -64,6 +64,11 @@ const shuffleArray = <T, >(array: T[]): T[] => {
onBeforeMount(async () => {
try {
const { data } = await axios.get<Record<string, unknown>[]>(generateUrl('/settings/api/apps/discover'))
if (data.length === 0) {
logger.info('No app discover elements available (empty response)')
hasError.value = true
return
}
// Parse data to ensure dates are useable and then filter out expired or future elements
const parsedElements = data.map(parseApiResponse).filter(filterElements)
// Shuffle elements to make it looks more interesting

@ -192,6 +192,7 @@ export default defineComponent({
<style scoped lang="scss">
.app-discover-post {
max-height: 300px;
width: 100%;
background-color: var(--color-primary-element-light);
border-radius: var(--border-radius-rounded);
@ -210,15 +211,20 @@ export default defineComponent({
&__text {
display: block;
padding: var(--border-radius-rounded);
width: 100%;
padding: var(--border-radius-rounded);
overflow-y: scroll;
}
// If there is media next to the text we do not want a padding on the bottom as this looks weird when scrolling
&:has(&__media) &__text {
padding-block-end: 0;
}
&__media {
display: block;
overflow: hidden;
max-height: 300px;
max-width: 450px;
border-radius: var(--border-radius-rounded);
@ -262,11 +268,16 @@ export default defineComponent({
@media only screen and (max-width: 699px) {
.app-discover-post {
flex-direction: column;
max-height: 500px;
&--reverse {
flex-direction: column-reverse;
}
&__text {
flex: 1 1 50%;
}
&__media {
min-width: 100%;

3
dist/1019-1019.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
dist/3865-3865.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

3
dist/9923-9923.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long