-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f2c7e7
commit bc0dd78
Showing
4 changed files
with
206 additions
and
12 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions
61
website/src/app/[lang]/[region]/(website)/techstack/(sections)/techcard.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,61 @@ | ||
import { Badge, Card, CardContent, CardHeader, CardTitle, Typography } from '@socialincome/ui'; | ||
import Image from 'next/image'; | ||
import Link from 'next/link'; | ||
|
||
type TechCardTranslations = { | ||
badgeDonated: string; | ||
} | ||
|
||
type TechCardProps = { | ||
title: string; | ||
description: string; | ||
link: string; | ||
logo: string; | ||
donated: boolean; | ||
translations: TechCardTranslations; | ||
}; | ||
|
||
function getLogoSrc(logo: string) { | ||
const image_base_path = '/assets/tech/'; | ||
return image_base_path.concat(logo); | ||
} | ||
|
||
export default function TechCard({ title, description, link, logo, donated, translations }: TechCardProps) { | ||
return ( | ||
<Card className="hover:bg-primary max-w-lg rounded-lg p-6 shadow-none hover:bg-opacity-10"> | ||
<Link href={link} target="_blank" rel="noreferrer" className="flex flex-col gap-6 sm:flex-row"> | ||
{!!logo && ( | ||
<div className="w-fit basis-1/4 self-center"> | ||
<Image | ||
src={getLogoSrc(logo)} | ||
alt={title} | ||
className="mx-auto w-1/2 rounded-sm sm:w-full" | ||
width="48" | ||
height="48" | ||
unoptimized | ||
/> | ||
</div> | ||
)} | ||
<div className={'' + (!!logo ? 'w-fit basis-3/4' : '')}> | ||
{donated && ( | ||
<Badge className="bg-accent hover:bg-accent text-primary text-md float-right -m-3 border-none"> | ||
<Typography size="md" weight="normal" className="p-1"> | ||
{translations.badgeDonated} | ||
</Typography> | ||
</Badge> | ||
)} | ||
<CardHeader className="p-0"> | ||
<CardTitle className="flex items-center justify-between"> | ||
<Typography size="2xl" weight="medium"> | ||
{title} | ||
</Typography> | ||
</CardTitle> | ||
</CardHeader> | ||
<CardContent className="my-4 p-0"> | ||
<Typography size="lg">{description}</Typography> | ||
</CardContent> | ||
</div> | ||
</Link> | ||
</Card> | ||
); | ||
} |
22 changes: 17 additions & 5 deletions
22
website/src/app/[lang]/[region]/(website)/techstack/(sections)/techlist.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 |
---|---|---|
@@ -1,18 +1,30 @@ | ||
import { DefaultParams } from '@/app/[lang]/[region]'; | ||
import TechCard from '@/app/[lang]/[region]/(website)/techstack/(sections)/techcard'; | ||
import { Translator } from '@socialincome/shared/src/utils/i18n'; | ||
import { Typography } from '@socialincome/ui'; | ||
|
||
type TechEntryJSON = { | ||
title: string; | ||
description: string; | ||
link: string; | ||
logo: string; | ||
donated: boolean; | ||
}; | ||
|
||
export async function TechList({ lang }: DefaultParams) { | ||
const translator = await Translator.getInstance({ | ||
language: lang, | ||
namespaces: ['website-techstack'], | ||
}); | ||
|
||
const techArray: TechEntryJSON[] = translator.t('cards'); | ||
|
||
return ( | ||
<div> | ||
<Typography color="accent" className="text-center"> | ||
{translator.t('cards.title-1')} | ||
</Typography> | ||
<div className="mx-auto max-w-6xl"> | ||
<div className="grid grid-cols-1 gap-4 p-4 sm:grid-cols-2 lg:grid-cols-2"> | ||
{techArray.map((techEntry, index) => ( | ||
<TechCard {...techEntry} translations={{badgeDonated: translator.t('badges.donated')}} key={index} /> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
} |