Skip to content

Commit

Permalink
Merge pull request #114 from CollActionteam/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
tomsiebring authored Apr 18, 2023
2 parents b60200a + 37418c8 commit d30bdf2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
28 changes: 16 additions & 12 deletions src/components/CrowdActionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ export default function CrowdActionCard({ ...crowdAction }: CrowdAction) {
className="bg-white rounded-xl overflow-hidden w-[300px] h-[492px] drop-shadow-lg relative"
key={`${crowdAction.id} card`}
>
<Image
src={`${staticUrl}${crowdAction.images.card}`}
alt={crowdAction.title}
width={300}
height={180}
className="max-w-[300px] max-h-[180px] h-[180px] w-[300px]"
/>
{crowdAction?.images?.card && (
<Image
src={`${staticUrl}${crowdAction.images.card}`}
alt={crowdAction.title}
width={300}
height={180}
className="max-w-[300px] max-h-[180px] h-[180px] w-[300px]"
/>
)}
<CrowdActionChipList
status={crowdAction.status}
joinStatus={crowdAction.joinStatus}
Expand All @@ -53,11 +55,13 @@ export default function CrowdActionCard({ ...crowdAction }: CrowdAction) {
<p className="font-bold text-xl text-primary-400">
{crowdAction.title}
</p>
<p className="mt-4 text-primary-300 text-sm leading-6">
{crowdAction.description.length > 175
? `${crowdAction.description.substring(0, 175)}...`
: crowdAction.description}
</p>
{crowdAction?.description && (
<p className="mt-4 text-primary-300 text-sm leading-6">
{crowdAction.description.length > 175
? `${crowdAction.description.substring(0, 175)}...`
: crowdAction.description}
</p>
)}
</div>
<div className="py-5 px-5 flex justify-center absolute bottom-0 left-0 right-0">
<Link
Expand Down
2 changes: 1 addition & 1 deletion src/components/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export default function NavBar() {
{t('app:navbar.team')}
</Link>
<Link
href="/projects"
href="/projects?page=1"
onClick={() => {
setNavbar(false);
}}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/projects/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ export default function ProjectListPage({ projects, pagination }: any) {
}

export async function getServerSideProps({ query, locale }: any) {
const page: string = query.page;
const page: string = query?.page || 1;

const { items, pageInfo } = await fetch(
`https://api.collaction.org/v1/crowdactions?page=${page}&pageSize=3`
Expand Down

1 comment on commit d30bdf2

@vercel
Copy link

@vercel vercel bot commented on d30bdf2 Apr 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.