-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPageHeader.tsx
More file actions
68 lines (61 loc) · 2.53 KB
/
Copy pathPageHeader.tsx
File metadata and controls
68 lines (61 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { ComponentConfig } from '@puckeditor/core';
import React from 'react';
export interface PageHeaderProps {
title?: string;
subtitle?: string;
description?: string;
additionalText?: string;
}
export const PageHeader: React.FC<PageHeaderProps> = ({
title,
subtitle,
description,
additionalText,
}) => {
return (
<div className="pb-5 pt-15 w-full max-w-screen font-sans bg-white box-border overflow-hidden">
<div className="max-w-6xl mx-auto w-full box-border">
<h1 className="text-3xl sm:text-4xl lg:text-5xl font-bold uppercase text-black mb-6 leading-tight break-words">
{title}
</h1>
{subtitle && (
<h2 className="text-lg sm:text-xl lg:text-2xl font-semibold text-black mb-4 leading-snug break-words">
{subtitle}
</h2>
)}
{description && (
<p className="text-sm sm:text-base lg:text-lg text-black mb-4 leading-relaxed max-w-full break-words">
{description.split('**').map((part, index) =>
index % 2 === 1 ? (
<strong key={index}>{part}</strong>
) : (
part
)
)}
</p>
)}
{additionalText && (
<p className="text-sm sm:text-base lg:text-lg text-black m-0 leading-relaxed max-w-full break-words">
{additionalText}
</p>
)}
</div>
</div>
);
};
export default PageHeader;
export const PageHeaderConfig: ComponentConfig<PageHeaderProps> = {
fields: {
title: { type: "text" },
subtitle: { type: "text" },
description: { type: "textarea" },
additionalText: { type: "textarea" },
},
defaultProps: {
title: "JOIN A COMMITTEE",
subtitle: "",
description: "SGA Committees meet once a week to focus on a specific aspect of the student experience and work on projects related to improving an aspect of the university. They are open to all undergraduate Northeastern students on the Boston Campus, and no experience or commitment is necessary!",
additionalText: "To join a committee just show up! Find more information about each committee at the links below.",
},
render: (props) => <PageHeader {...props} />,
}