-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v3 - InformationMessage Component + replacement in main/page.tsx (#532)
* InformationMessageComponent + replacement in main/page.tsx * update role attribute in InformationMessage component * refactor: improve code formatting in InformationMessage component * Moved links to utils section * Rename informationMessage to informationSection * prettier fix
- Loading branch information
Showing
6 changed files
with
95 additions
and
29 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
20 changes: 1 addition & 19 deletions
20
src/blog/components/customErrorMessage/CustomErrorMessage.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
34 changes: 34 additions & 0 deletions
34
src/blog/components/informationSection/InformationSection.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,34 @@ | ||
import LinkButton from "src/components/linkButton/LinkButton"; | ||
import Text from "src/components/text/Text"; | ||
import { ILink } from "studio/lib/payloads/navigation"; | ||
import styles from "./informationSection.module.css"; | ||
import React from "react"; | ||
|
||
interface InformationSectionProps { | ||
title: string; | ||
body: string; | ||
link?: ILink; | ||
} | ||
|
||
const InformationSection = ({ title, body, link }: InformationSectionProps) => { | ||
return ( | ||
<section className={styles.wrapper}> | ||
<div className={styles.info}> | ||
<Text type="h1">{title}</Text> | ||
<span> | ||
{body.split("\n").map((line, index) => ( | ||
<Text key={index}> | ||
{line} | ||
<br /> | ||
</Text> | ||
))} | ||
</span> | ||
<div className={styles.buttonWrapper}> | ||
{link && <LinkButton type="primary" link={link} />} | ||
</div> | ||
</div> | ||
</section> | ||
); | ||
}; | ||
|
||
export default InformationSection; |
31 changes: 31 additions & 0 deletions
31
src/blog/components/informationSection/informationSection.module.css
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,31 @@ | ||
.wrapper { | ||
display: flex; | ||
padding: 5rem 2rem; | ||
align-items: center; | ||
align-self: stretch; | ||
@media (min-width: 640px) { | ||
padding: 5rem 3rem; | ||
justify-content: center; | ||
} | ||
|
||
@media (min-width: 1024px) { | ||
padding: 7.5rem; | ||
} | ||
} | ||
|
||
.info { | ||
max-width: 88rem; | ||
display: flex; | ||
padding: 3rem; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 1.5rem; | ||
align-self: stretch; | ||
border-radius: 1rem; | ||
} | ||
|
||
.buttonWrapper { | ||
display: flex; | ||
align-items: flex-start; | ||
gap: 1.5rem; | ||
} |
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,19 @@ | ||
import { LinkType } from "studio/lib/payloads/navigation"; | ||
|
||
export const homeLink = { | ||
_key: "return-home", | ||
_type: "link", | ||
linkTitle: "Return to home", | ||
linkType: LinkType.Internal, | ||
internalLink: { | ||
_ref: "/", | ||
}, | ||
}; | ||
|
||
export const studioLink = { | ||
_key: "go-to-studio", | ||
_type: "link", | ||
linkTitle: "Go to studio", | ||
linkType: LinkType.Internal, | ||
internalLink: { _ref: "/studio" }, | ||
}; |