Skip to content

Commit f026277

Browse files
authored
Merge pull request #1451 from OpenBeta/feat-change-recent-contribs
change recent contributions to a link
2 parents 06ef723 + 80353ee commit f026277

File tree

2 files changed

+26
-51
lines changed

2 files changed

+26
-51
lines changed
Lines changed: 19 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { ReactNode } from 'react'
21
import Link from 'next/link'
3-
import { ArrowRightIcon } from '@heroicons/react/24/outline'
2+
import { ArrowRightIcon, PencilSquareIcon } from '@heroicons/react/24/outline'
3+
import { SectionContainer } from './ui/SectionContainer'
44

55
// Temporarily disabled to test build - this fetches 6MB of data
66
// import { getChangeHistoryServerSide } from '@/js/graphql/contribAPI'
@@ -13,40 +13,22 @@ export const LatestContributions: React.FC = async () => {
1313
// Temporarily disabled - fetches 6MB history just to show 10 items
1414
// const history = await getChangeHistoryServerSide()
1515
return (
16-
<Container>
17-
<div className='text-center text-base-content/60 py-8'>
18-
Latest contributions temporarily disabled
19-
</div>
20-
</Container>
21-
)
22-
}
23-
24-
/**
25-
* Resuable container for actual and skeleton
26-
*/
27-
const Container: React.FC<{ children: ReactNode }> = ({ children }) => (
28-
<section className='px-4 w-full bg-base-200'>
29-
<div className='mt-2 flex items-center justify-between'>
30-
<p>LATEST CONTRIBUTIONS</p>
31-
<Link href='/edit' className='text-sm hover:underline'>See more</Link>
32-
</div>
33-
<hr className='mb-6 border-1 border-base-content' />
34-
<div className='mt-4 flex justify-center flex-row flex-wrap gap-y-10 gap-x-4'>
35-
{children}
36-
</div>
37-
<div className='flex justify-center py-10'>
38-
<Link href='/edit' className='btn btn-sm btn-outline'>See more <ArrowRightIcon className='w-4 h-4' /></Link>
39-
</div>
40-
</section>
41-
)
42-
43-
/**
44-
* Loading skelton
45-
*/
46-
export const LatestContributionsSkeleton: React.FC = () => {
47-
return (
48-
<Container>
49-
{[1, 2, 3, 4, 5].map(item => <div key={item} className='w-full bg-base-200/20 h-36 rounded-box' />)}
50-
</Container>
16+
<SectionContainer header={<h2>Latest Contributions</h2>}>
17+
<Link
18+
href='/edit'
19+
className='group flex items-center justify-between gap-4 w-full rounded-box border border-base-content/20 bg-base-200/40 hover:bg-base-200 hover:border-base-content/40 transition-all duration-200 p-5 lg:p-6'
20+
>
21+
<div className='flex items-center gap-4'>
22+
<div className='flex-shrink-0 w-10 h-10 rounded-box bg-base-content/10 group-hover:bg-base-content/15 flex items-center justify-center transition-colors duration-200'>
23+
<PencilSquareIcon className='w-5 h-5 text-base-content/70' />
24+
</div>
25+
<div>
26+
<p className='font-semibold text-base-content text-sm uppercase tracking-wide'>View recent edits</p>
27+
<p className='text-sm text-base-content/60 mt-0.5'>Browse the latest changes made by the community</p>
28+
</div>
29+
</div>
30+
<ArrowRightIcon className='w-5 h-5 text-base-content/40 group-hover:text-base-content/70 group-hover:translate-x-0.5 transition-all duration-200 flex-shrink-0' />
31+
</Link>
32+
</SectionContainer>
5133
)
5234
}

src/app/(default)/page.tsx

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import { Suspense } from 'react'
21
import { LandingHero } from './components/LandingHero'
32
// import { getChangeHistoryServerSide } from '@/js/graphql/contribAPI'
4-
import { LatestContributions, LatestContributionsSkeleton } from './components/LatestContributions'
3+
import { LatestContributions } from './components/LatestContributions'
54
import { FinancialContributors } from './components/FinancialContributors'
65
import { RecentTags } from './components/RecentTags'
76
import { USAToC } from './components/USAToC'
87
import { InternationalToC } from './components/InternationalToC'
98
import { Volunteers } from './components/Volunteers'
10-
import { RecentContributionsMap } from './components/recent/RecentContributionsMap'
9+
// import { RecentContributionsMap } from './components/recent/RecentContributionsMap'
1110
// import { ChangesetType } from '@/js/types'
1211

1312
export const revalidate = 3600 // 1 hour
@@ -24,25 +23,19 @@ export default async function Home (): Promise<any> {
2423
// console.error('Failed to fetch change history during build:', error)
2524
// // Continue with empty history if API is down
2625
// }
27-
const history: never[] = []
26+
// const history: never[] = []
2827
return (
2928
<>
3029
<div className='default-page-margins flex flex-col justify-center w-fit'>
3130
<LandingHero />
3231
</div>
3332
<div className='default-page-margins flex flex-col gap-y-12 mb-16'>
3433
<RecentTags />
35-
<div className='lg:grid lg:grid-cols-3 gap-x-2'>
36-
<div className='lg:overflow-y-auto lg:h-[450px] w-full border-2 rounded-box'>
37-
<Suspense fallback={<LatestContributionsSkeleton />}>
38-
<LatestContributions />
39-
</Suspense>
40-
</div>
41-
42-
<div className='lg:col-span-2 h-[450px]'>
34+
<LatestContributions />
35+
{/* Temporarily disabled to test if this is causing build failures */}
36+
{/* <div className='lg:col-span-2 h-[450px]'>
4337
<RecentContributionsMap history={history} />
44-
</div>
45-
</div>
38+
</div> */}
4639
<InternationalToC />
4740
<USAToC />
4841
<FinancialContributors />

0 commit comments

Comments
 (0)