-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add carousel * Add About page with content and sanitize HTML * remove use client * update about page * Implement upcoming carousel Co-authored-by: Mathilde Hagl <[email protected]> * cleanup imports * adding some design suggestions * Enhance AboutPage content and update contributor roles for clarity * Update contributor contribution description for clarity * update about page text * add highlighted add custom course phases * update icons * small design refinements * add @rappm as contributor * fix linter to use prettier * remove carousel * implement changes requested by @niclasheun * @niclasheun fixes 2.0 * update contributor mapping * update AboutPage dynamically loaded course phases layout and heading spacing --------- Co-authored-by: Mathilde Hagl <[email protected]> Co-authored-by: Stefan Niclas Heun <[email protected]>
- Loading branch information
1 parent
d18b876
commit bcf52da
Showing
6 changed files
with
345 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
clients/core/src/publicPages/legalPages/components/ContributorList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import { useEffect, useState } from 'react' | ||
import { Card, CardContent } from '@/components/ui/card' | ||
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar' | ||
import { Contributor, ContributorWithInfo } from '../interfaces/Contributor' | ||
import { contributorMapping } from './ContributorMapping' | ||
|
||
export const ContributorList = () => { | ||
const [contributors, setContributors] = useState<Contributor[]>([]) | ||
const [vali, setVali] = useState<Contributor>() | ||
|
||
useEffect(() => { | ||
fetch('https://api.github.com/repos/ls1intum/prompt2/contributors') | ||
.then((response) => response.json()) | ||
.then((data) => setContributors(data)) | ||
.catch((error) => console.error('Error fetching contributors:', error)) | ||
}, []) | ||
|
||
useEffect(() => { | ||
fetch('https://api.github.com/users/airelawaleria') | ||
.then((response) => response.json()) | ||
.then((data) => { | ||
if (data) { | ||
setVali({ | ||
login: data.login, | ||
avatar_url: data.avatar_url, | ||
html_url: data.html_url, | ||
contributions: 0, // Contributions are not available from this endpoint | ||
type: data.type, | ||
}) | ||
} | ||
}) | ||
.catch((error) => console.error('Error fetching user:', error)) | ||
}, []) | ||
|
||
const mappedContributors: ContributorWithInfo[] = [...contributors, vali] | ||
.filter( | ||
(contributor) => | ||
contributor !== undefined && | ||
contributorMapping[contributor.login] && | ||
contributor.type === 'User', | ||
) | ||
.map((contributor) => { | ||
if (contributor === undefined) { | ||
return | ||
} | ||
return { | ||
...contributor, | ||
...contributorMapping[contributor?.login], | ||
} | ||
}) | ||
.filter((contributor): contributor is ContributorWithInfo => contributor !== undefined) | ||
|
||
return ( | ||
<div className='grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6'> | ||
{mappedContributors | ||
.sort((a, b) => a.position - b.position) | ||
.map((contributor, index) => ( | ||
<Card key={index}> | ||
<CardContent className='flex items-center p-4'> | ||
<Avatar className='w-16 h-16 mr-4'> | ||
<AvatarImage src={contributor.avatar_url} alt={contributor.login} /> | ||
<AvatarFallback>{contributor.login.slice(0, 2).toUpperCase()}</AvatarFallback> | ||
</Avatar> | ||
<div> | ||
<a | ||
href={contributor.html_url} | ||
target='_blank' | ||
rel='noopener noreferrer' | ||
className='text-blue-600 hover:underline font-semibold' | ||
> | ||
{contributor.name} | ||
</a> | ||
<p className='text-sm text-gray-600 mt-1'>{contributor.contribution}</p> | ||
</div> | ||
</CardContent> | ||
</Card> | ||
))} | ||
</div> | ||
) | ||
} |
25 changes: 25 additions & 0 deletions
25
clients/core/src/publicPages/legalPages/components/ContributorMapping.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export const contributorMapping: { | ||
[username: string]: { | ||
name: string | ||
contribution: string | ||
position: number | ||
} | ||
} = { | ||
niclasheun: { | ||
name: 'Niclas Heun', | ||
contribution: 'Lead Developer & Architect of PROMPT 2.0', | ||
position: 2, | ||
}, | ||
Mtze: { name: 'Matthias Linhuber', contribution: 'Project Manager', position: 1 }, | ||
mathildeshagl: { | ||
name: 'Mathilde Hagl', | ||
contribution: 'Templating and Task Management', | ||
position: 4, | ||
}, | ||
airelawaleria: { | ||
name: 'Valeryia Andraichuk', | ||
contribution: 'Creator of PROMPT - the concept on which PROMPT 2.0 is based', | ||
position: 3, | ||
}, | ||
rappm: { name: 'Maximilian Rapp', contribution: 'Grading', position: 5 }, | ||
} |
13 changes: 13 additions & 0 deletions
13
clients/core/src/publicPages/legalPages/interfaces/Contributor.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export interface Contributor { | ||
login: string | ||
avatar_url: string | ||
html_url: string | ||
contributions: number | ||
type: string | ||
} | ||
|
||
export interface ContributorWithInfo extends Contributor { | ||
name: string | ||
contribution: string | ||
position: number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters