Skip to content

Commit

Permalink
Merge pull request #37 from kir-dev/feature/6/grups-link
Browse files Browse the repository at this point in the history
Feature/6/grups link
  • Loading branch information
balintking authored Nov 15, 2024
2 parents e443828 + af97e4d commit 75bcf6c
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 33 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
2 changes: 1 addition & 1 deletion frontend/components/profile-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const headerProps: ProfileHeaderProps = {
user: {
description: "I'm a passionate student leader with a keen interest in campus politics and public speaking.",
name: 'Jane Doe',
email: '',
email: '[email protected]',
building: 'Building A',
room: 'Room 101',
twitterHandle: '@janedoe',
Expand Down
62 changes: 32 additions & 30 deletions frontend/components/profile/group-membership-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,38 @@ export interface MembershipProps {

export function GroupMembershipCard({ membership }: { membership: MembershipProps }) {
return (
<Card
className={`h-full transition-shadow hover:shadow-md ${membership.primary ? 'border-blue-500' : ''} bg-gradient-to-br from-blue-50 to-purple-50`}
>
<CardHeader className='p-4'>
<CardTitle className='text-lg flex items-center justify-between text-gray-800'>
{membership.name}
{membership.primary && (
<Badge variant='secondary' className='bg-blue-100 text-blue-800'>
Primary
</Badge>
)}
</CardTitle>
<CardDescription className='text-xs text-gray-500'>
<div className='flex items-center'>
<CalendarIcon className='mr-1 h-3 w-3' />
Started: {membership.startDate}
{membership.endDate && ` | Ended: ${membership.endDate}`}
</div>
</CardDescription>
</CardHeader>
<CardContent className='p-4 pt-0'>
<p className='text-sm text-gray-600'>
<strong>Role:</strong> {membership.currentRole}
</p>
{membership.pastRoles.length > 0 && (
<p className='text-sm text-gray-600 mt-1'>
<strong>Past:</strong> {membership.pastRoles.join(', ')}
<a href={`/groups/${membership.id}`}>
<Card
className={`h-full transition-shadow hover:shadow-md ${membership.primary ? 'border-blue-500' : ''} bg-gradient-to-br from-blue-50 to-purple-50`}
>
<CardHeader className='p-4'>
<CardTitle className='text-lg flex items-center justify-between text-gray-800'>
{membership.name}
{membership.primary && (
<Badge variant='secondary' className='bg-blue-100 text-blue-800'>
Primary
</Badge>
)}
</CardTitle>
<CardDescription className='text-xs text-gray-500'>
<div className='flex items-center'>
<CalendarIcon className='mr-1 h-3 w-3' />
Started: {membership.startDate}
{membership.endDate && ` | Ended: ${membership.endDate}`}
</div>
</CardDescription>
</CardHeader>
<CardContent className='p-4 pt-0'>
<p className='text-sm text-gray-600'>
<strong>Role:</strong> {membership.currentRole}
</p>
)}
</CardContent>
</Card>
{membership.pastRoles.length > 0 && (
<p className='text-sm text-gray-600 mt-1'>
<strong>Past:</strong> {membership.pastRoles.join(', ')}
</p>
)}
</CardContent>
</Card>
</a>
);
}
6 changes: 4 additions & 2 deletions frontend/components/profile/group-memberships.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,23 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
export function GroupMemberships() {
const memberships = [
{
id: '1',
name: 'Student Council',
startDate: '2022-09-01',
currentRole: 'President',
pastRoles: ['Secretary'],
primary: true,
},
{
id: '2',
name: 'Debate Club',
startDate: '2021-09-01',
currentRole: 'Member',
pastRoles: ['Vice President'],
endDate: '2023-05-31',
},
{ name: 'Chess Club', startDate: '2022-01-15', currentRole: 'Treasurer', pastRoles: [] },
{ name: 'Environmental Society', startDate: '2023-03-01', currentRole: 'Member', pastRoles: [] },
{ id: '3', name: 'Chess Club', startDate: '2022-01-15', currentRole: 'Treasurer', pastRoles: [] },
{ id: '4', name: 'Environmental Society', startDate: '2023-03-01', currentRole: 'Member', pastRoles: [] },
];

return (
Expand Down

0 comments on commit 75bcf6c

Please sign in to comment.