Skip to content

Commit

Permalink
Merge pull request #44286 from nextcloud/fix/app-discover-media-size
Browse files Browse the repository at this point in the history
fix(settings): Ensure media for app discover section is scaled correctly
  • Loading branch information
AndyScherzinger committed Mar 19, 2024
2 parents c69d1c5 + d71e693 commit 83746f7
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 13 additions & 2 deletions apps/settings/src/components/AppStoreDiscover/PostType.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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%;
Expand Down
3 changes: 3 additions & 0 deletions dist/1019-1019.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/1019-1019.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/3865-3865.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/3865-3865.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 83746f7

Please sign in to comment.