Skip to content

Commit

Permalink
Refactor feed handling and improve component behavior.
Browse files Browse the repository at this point in the history
Replaces static feed data with dynamic API integration in `FeedPageContent.vue`, mapping API responses for better flexibility. Adjusts `Feed.vue` to include asset and address links, and refines layout by fixing footer positioning and main scrolling behavior.
  • Loading branch information
kazuyoshi80 committed Jan 18, 2025
1 parent f150261 commit ced2487
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
29 changes: 14 additions & 15 deletions src/components/Feed/FeedPageContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ export type FeedType = {
url: string
name: string
avatar: string
},
}
ownerDetails: {
address: string
avatar: string
username: string
},
}
passportDetails: {
id: string
sTokenPayload: string
Expand All @@ -29,18 +29,17 @@ const props = defineProps<{
feeds: FeedType[]
}>()
const mappedFeeds:
{
avatarSrc: string
badgeSrc: string
assetSrc: string
tag: PassportItemAssetType
name: string
address: string
badgeName: string
description?: string
assetLink: string
}[] = props.feeds.map((feed) => {
const mappedFeeds: {
avatarSrc: string
badgeSrc: string
assetSrc: string
tag: PassportItemAssetType
name: string
address: string
badgeName: string
description?: string
assetLink: string
}[] = props.feeds.map((feed) => {
return {
avatarSrc: feed.ownerDetails.avatar,
badgeSrc: feed.clubDetails.avatar,
Expand All @@ -50,7 +49,7 @@ const mappedFeeds:
address: feed.ownerDetails.address,
badgeName: feed.clubDetails.name,
assetLink: feed.passportDetails.itemLink,
description: feed.passportDetails.itemDescription
description: feed.passportDetails.itemDescription,
}
})
</script>
Expand Down
5 changes: 3 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import FeedPageContent from '@components/Feed/FeedPageContent.vue'
import { getFeed } from '../fixtures/api/feed'
import type { FeedType } from '@components/Feed/FeedPageContent.vue'
const feeds = Array.isArray(await getFeed()) ? (await getFeed()) as FeedType[] : []
const feeds = Array.isArray(await getFeed())
? ((await getFeed()) as FeedType[])
: []
---

<Layout connectButton="hidden" theme="auto" pageTitle="Feed">
Expand Down

0 comments on commit ced2487

Please sign in to comment.