Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/6/grups link #37

Merged
merged 5 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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