Skip to content

Commit a7bed56

Browse files
authored
Merge pull request #575 from iitzIrFan/bug/community_details
Enhance community page with dropdown details for contribution section…
2 parents ed365ca + 017dbaf commit a7bed56

File tree

2 files changed

+110
-26
lines changed

2 files changed

+110
-26
lines changed

src/pages/community/community.css

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,10 +437,11 @@
437437
display: flex;
438438
align-items: center;
439439
gap: 16px;
440-
padding: 10px 0;
440+
padding: 12px 0 10px;
441441
font-size: 0.95rem;
442442
color: #374151;
443443
border-bottom: 1px solid #f1f5f9;
444+
font-weight: 600;
444445
}
445446

446447
[data-theme='dark'] .section-item {
@@ -924,3 +925,40 @@
924925
[data-theme='dark'] .contribution-section h6 {
925926
color: #ffffff;
926927
}
928+
929+
/* Dropdown Details Styling */
930+
.section-item-details {
931+
margin: 5px 0 10px 25px;
932+
padding: 12px 15px;
933+
background: #f8fafc;
934+
border-radius: 8px;
935+
border-left: 3px solid #8b5cf6;
936+
overflow: hidden;
937+
}
938+
939+
[data-theme='dark'] .section-item-details {
940+
background: #2d2d2d;
941+
border-left: 3px solid #8b5cf6;
942+
}
943+
944+
.section-item-details p {
945+
margin: 0;
946+
color: #64748b;
947+
font-size: 0.95rem;
948+
line-height: 1.6;
949+
}
950+
951+
[data-theme='dark'] .section-item-details p {
952+
color: #e2e8f0;
953+
}
954+
955+
.item-arrow {
956+
color: #8b5cf6;
957+
font-size: 0.8rem;
958+
flex-shrink: 0;
959+
transition: transform 0.3s ease;
960+
}
961+
962+
.item-arrow.rotate {
963+
transform: rotate(90deg);
964+
}

src/pages/community/index.tsx

Lines changed: 71 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ interface ContributionSection {
1111
icon: string;
1212
description: string;
1313
items: string[];
14+
details?: string[];
1415
links: { text: string; url: string; }[];
1516
color: string;
1617
}
@@ -22,13 +23,18 @@ const contributionSections: ContributionSection[] = [
2223
icon: '💻',
2324
description: "If you're a developer, you can:",
2425
items: [
25-
'Write code 🧑‍💻',
26-
'Fix bugs 🐞',
27-
'Add new features 🚀'
26+
'Access coding standards 🧑‍💻',
27+
'Find debugging tips 🐞',
28+
'Propose new features 🚀'
29+
],
30+
details: [
31+
'Access coding standards and setup instructions to streamline your work with the team\'s codebase.',
32+
'Find tips for debugging, troubleshooting common errors, and submitting clear bug reports.',
33+
'Read about how to propose new features, collaborate on pull requests, and review peer code.'
2834
],
2935
links: [
3036
{ text: 'GitHub', url: 'https://github.com/recodehive' },
31-
{ text: 'GitLab', url: 'https://gitlab.com' }
37+
{ text: 'GitLab', url: 'https://gitlab.com' }
3238
],
3339
color: '#8b5cf6'
3440
},
@@ -39,9 +45,14 @@ const contributionSections: ContributionSection[] = [
3945
description: "If you're a writer or educator, you can:",
4046
items: [
4147
'Improve documentation 🖋️',
42-
'Write tutorials 📚',
48+
'Structure tutorials 📚',
4349
'Translate content 🌍'
4450
],
51+
details: [
52+
'Explore detailed guides for improving existing documentation, including style and terminology tips.',
53+
'Learn how to structure tutorials, add examples, and make learning resources more accessible.',
54+
'See guidelines for translating technical content into different languages or for various backgrounds.'
55+
],
4556
links: [
4657
{ text: 'GitHub Docs', url: 'https://www.recodehive.com/docs' }
4758
],
@@ -53,13 +64,18 @@ const contributionSections: ContributionSection[] = [
5364
icon: '🤝',
5465
description: "If you're a community-minded person, you can:",
5566
items: [
56-
'Help answer questions',
57-
'Support new members 💬',
58-
'Share knowledge and insights'
67+
'Connect with members 👥',
68+
'Support newcomers 💬',
69+
'Share resources 📝'
70+
],
71+
details: [
72+
'Connect with fellow members by joining active discussions in forums and chats.',
73+
'Offer support to newcomers by guiding them through onboarding and answering beginner questions.',
74+
'Share resources, tutorials, and best practices to help others grow.'
5975
],
6076
links: [
61-
{ text: 'Discord', url: 'https://discord.com/invite/w2V2aH6U' },
62-
{ text: 'Whatsapp', url: 'https://chat.whatsapp.com/Izl2yfbFlmY8CExjnIpNkX?mode=ems_copy_t' }
77+
{ text: 'Discord', url: 'https://discord.com/invite/w2V2aH6U' },
78+
{ text: 'Whatsapp', url: 'https://chat.whatsapp.com/Izl2yfbFlmY8CExjnIpNkX?mode=ems_copy_t' }
6379
],
6480
color: '#10b981'
6581
},
@@ -69,13 +85,18 @@ const contributionSections: ContributionSection[] = [
6985
icon: '🚀',
7086
description: 'To begin your journey with RecodeHive:',
7187
items: [
72-
'Join our community on Discord or Slack',
73-
'Explore our repositories on GitHub',
74-
'Pick a task or area you\'re excited about!'
88+
'Sign up and introduce yourself 👋',
89+
'Discover key repositories 🔍',
90+
'Browse beginner tasks 📋'
91+
],
92+
details: [
93+
'Learn how to sign up and introduce yourself in the welcome channels on Discord or Slack.',
94+
'Discover key open source repositories and find out how you can contribute, regardless of experience level.',
95+
'Browse a list of beginner-friendly tasks and guides to help select your first area of involvement.'
7596
],
7697
links: [
77-
{ text: 'Discord', url: 'https://discord.com/invite/w2V2aH6U' },
78-
{ text: 'Whatsapp', url: 'https://chat.whatsapp.com/Izl2yfbFlmY8CExjnIpNkX?mode=ems_copy_t' },
98+
{ text: 'Discord', url: 'https://discord.com/invite/w2V2aH6U' },
99+
{ text: 'Whatsapp', url: 'https://chat.whatsapp.com/Izl2yfbFlmY8CExjnIpNkX?mode=ems_copy_t' },
79100
{ text: 'GitHub', url: 'https://github.com/recodehive' }
80101
],
81102
color: '#6366f1'
@@ -94,6 +115,7 @@ const tableOfContents = [
94115
export default function CommunityPage(): React.ReactElement {
95116
const [activeSections, setActiveSections] = useState<string[]>(['how-you-can-contribute']);
96117
const [selectedSection, setSelectedSection] = useState<string | null>(null);
118+
const [openDropdowns, setOpenDropdowns] = useState<string[]>([]);
97119

98120
useEffect(() => {
99121
const handleScroll = () => {
@@ -148,6 +170,14 @@ export default function CommunityPage(): React.ReactElement {
148170
setSelectedSection(sectionId);
149171
}
150172
};
173+
174+
const toggleDropdown = (itemId: string) => {
175+
setOpenDropdowns(prev =>
176+
prev.includes(itemId)
177+
? prev.filter(id => id !== itemId)
178+
: [...prev, itemId]
179+
);
180+
};
151181

152182
const [isMobile, setIsMobile] = useState(false);
153183

@@ -250,16 +280,32 @@ export default function CommunityPage(): React.ReactElement {
250280

251281
<ul className="section-items">
252282
{section.items.map((item, itemIndex) => (
253-
<motion.li
254-
key={itemIndex}
255-
className="section-item"
256-
initial={{ opacity: 0, x: -20 }}
257-
animate={{ opacity: 1, x: 0 }}
258-
transition={{ duration: 0.3, delay: (0.1 * index) + (0.05 * itemIndex) }}
259-
>
260-
<span className="item-arrow"></span>
261-
{item}
262-
</motion.li>
283+
<React.Fragment key={itemIndex}>
284+
<motion.li
285+
className="section-item"
286+
initial={{ opacity: 0, x: -20 }}
287+
animate={{ opacity: 1, x: 0 }}
288+
transition={{ duration: 0.3, delay: (0.1 * index) + (0.05 * itemIndex) }}
289+
onClick={() => toggleDropdown(`${section.id}-${itemIndex}`)}
290+
style={{ cursor: 'pointer' }}
291+
>
292+
<span className={`item-arrow ${openDropdowns.includes(`${section.id}-${itemIndex}`) ? 'rotate' : ''}`}>
293+
294+
</span>
295+
{item}
296+
</motion.li>
297+
298+
{section.details && openDropdowns.includes(`${section.id}-${itemIndex}`) && (
299+
<motion.div
300+
className="section-item-details"
301+
initial={{ opacity: 0, height: 0 }}
302+
animate={{ opacity: 1, height: 'auto' }}
303+
transition={{ duration: 0.3 }}
304+
>
305+
<p>{section.details[itemIndex]}</p>
306+
</motion.div>
307+
)}
308+
</React.Fragment>
263309
))}
264310
</ul>
265311

0 commit comments

Comments
 (0)