Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(settings): Ensure media for app discover section is scaled correctly #44286

Merged
merged 3 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading