Skip to content

Commit

Permalink
Refactor feed components to improve layout and dynamic sizing
Browse files Browse the repository at this point in the history
Adjust media height and layout styles for better responsiveness across devices. Refactor VirtualScroll to streamline logic and add dynamic item height handling. Update FeedPageContent to simplify item filtering and integrate dynamic item height calculations.
  • Loading branch information
kazuyoshi80 committed Feb 5, 2025
1 parent 9393a5b commit 1e86a30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/components/Feed/Feed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const mediaHeight = ref(0)
onMounted(() => {
mediaHeight.value = window.innerWidth > 768 ? 200 : 110
})
</script>

<template>
Expand Down Expand Up @@ -108,7 +107,11 @@ onMounted(() => {
:found="!!assetSrc"
/>
</div>
<div v-if="tag === 'ugc'" class="media-wrapper p-2 rounded-xl bg-violet-50" :style="{ height: `${mediaHeight}px` }">
<div
v-if="tag === 'ugc'"
class="media-wrapper p-2 rounded-xl bg-violet-50"
:style="{ height: `${mediaHeight}px` }"
>
<MediaEmbed
class="w-full rounded-xl aspect-[3/2] mx-auto max-w-40 lg:max-w-xs pointer-events-none overflow-hidden"
:found="!!assetSrc"
Expand Down
1 change: 0 additions & 1 deletion src/components/Feed/FeedPageContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const itemHeight = ref(278)
onMounted(() => {
itemHeight.value = window.innerWidth > 768 ? 278 : 180
})
</script>
<template>
<nav>
Expand Down

0 comments on commit 1e86a30

Please sign in to comment.