-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #247 from roodjong/add-boardmember-collection
Add boardmember collectiontype for nicer layout
- Loading branch information
Showing
8 changed files
with
167 additions
and
5 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
backend/src/api/boardmember/content-types/boardmember/schema.json
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,42 @@ | ||
{ | ||
"kind": "collectionType", | ||
"collectionName": "boardmembers", | ||
"info": { | ||
"singularName": "boardmember", | ||
"pluralName": "boardmembers", | ||
"displayName": "Bestuurslid", | ||
"description": "" | ||
}, | ||
"options": { | ||
"draftAndPublish": true | ||
}, | ||
"pluginOptions": {}, | ||
"attributes": { | ||
"name": { | ||
"type": "string", | ||
"required": true | ||
}, | ||
"role": { | ||
"type": "string", | ||
"required": false | ||
}, | ||
"email": { | ||
"type": "email", | ||
"required": false | ||
}, | ||
"extra": { | ||
"type": "richtext" | ||
}, | ||
"photo": { | ||
"type": "media", | ||
"multiple": false, | ||
"required": false, | ||
"allowedTypes": ["images"] | ||
}, | ||
"order": { | ||
"type": "integer", | ||
"required": true, | ||
"default": 10 | ||
} | ||
} | ||
} |
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,9 @@ | ||
"use strict"; | ||
|
||
/** | ||
* boardmember controller | ||
*/ | ||
|
||
const { createCoreController } = require("@strapi/strapi").factories; | ||
|
||
module.exports = createCoreController("api::boardmember.boardmember"); |
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,9 @@ | ||
"use strict"; | ||
|
||
/** | ||
* boardmember router | ||
*/ | ||
|
||
const { createCoreRouter } = require("@strapi/strapi").factories; | ||
|
||
module.exports = createCoreRouter("api::boardmember.boardmember"); |
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,9 @@ | ||
"use strict"; | ||
|
||
/** | ||
* boardmember service | ||
*/ | ||
|
||
const { createCoreService } = require("@strapi/strapi").factories; | ||
|
||
module.exports = createCoreService("api::boardmember.boardmember"); |
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,54 @@ | ||
import Image from "next/image"; | ||
import imageLoader from "../utils/image-loader"; | ||
import { Boardmember } from "../models/Boardmember"; | ||
import Subheader from "./Subheader"; | ||
import { IconContext } from "react-icons"; | ||
import { FaEnvelope, FaPhone } from "react-icons/fa"; | ||
import Markdown from "./Markdown"; | ||
|
||
interface Props { | ||
boardmember: Boardmember; | ||
} | ||
|
||
export default function BoardmemberCard(props: Props) { | ||
const boardmember = props.boardmember; | ||
return ( | ||
<div className="flex flex-col md:flex-row gap-8 mb-8 shadow-inner bg-gray-50 p-4 rounded"> | ||
<div className="float-right relative md:min-w-[10rem] h-[10rem] rounded shadow-lg overflow-hidden"> | ||
{boardmember.photo && ( | ||
<Image | ||
src={boardmember.photo} | ||
fill | ||
sizes="10rem" | ||
className="object-cover" | ||
loader={imageLoader} | ||
alt={`Foto van ${boardmember.name}`} | ||
/> | ||
)} | ||
</div> | ||
<div> | ||
<Subheader>{boardmember.name}</Subheader> | ||
<p>{boardmember.role}</p> | ||
<div className="flex flex-col text-base my-4 gap-4 text-primary"> | ||
<IconContext.Provider | ||
value={{ | ||
className: | ||
"!text-primary origin-center group-hover:scale-125 transition-transform inline mr-2", | ||
}} | ||
> | ||
<p> | ||
<a | ||
className="group hover:underline" | ||
href={`mailto:${boardmember.email}`} | ||
> | ||
{boardmember.email && <FaEnvelope />} | ||
{boardmember.email} | ||
</a> | ||
</p> | ||
</IconContext.Provider> | ||
</div> | ||
<Markdown content={boardmember.extra} /> | ||
</div> | ||
</div> | ||
); | ||
} |
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,7 @@ | ||
export interface Boardmember { | ||
name: string; | ||
role: string; | ||
email: string; | ||
extra: string; | ||
photo: string; | ||
} |
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