Skip to content
Snippets Groups Projects
Verified Commit bf960827 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

feat: better paragraph support

parent 9f0ff33e
No related branches found
No related tags found
1 merge request!8Support for react.js components
Pipeline #1159 passed
...@@ -6,8 +6,10 @@ import { ...@@ -6,8 +6,10 @@ import {
ButtonIncrement, ButtonIncrement,
ButtonSwitch, ButtonSwitch,
Info, Info,
Link,
Pair, Pair,
PanelSplit, PanelSplit,
Paragraph,
Section, Section,
Title Title
} from "./components"; } from "./components";
...@@ -27,6 +29,40 @@ export const App = () => { ...@@ -27,6 +29,40 @@ export const App = () => {
versionUrl="https://gitlab.stage.hive.pt/joamag/boytacean/-/blob/master/CHANGELOG.md" versionUrl="https://gitlab.stage.hive.pt/joamag/boytacean/-/blob/master/CHANGELOG.md"
iconSrc={require("../res/thunder.png")} iconSrc={require("../res/thunder.png")}
></Title> ></Title>
<Section>
<Paragraph>
This is a{" "}
<Link
href="https://en.wikipedia.org/wiki/Game_Boy"
target="_blank"
>
Game Boy
</Link>{" "}
emulator built using the{" "}
<Link href="https://www.rust-lang.org" target="_blank">
Rust Programming Language
</Link>{" "}
and is running inside this browser with the help of{" "}
<Link href="https://webassembly.org/" target="_blank">
WebAssembly
</Link>
.
</Paragraph>
<Paragraph>
You can check the source code of it at{" "}
<Link
href="https://gitlab.stage.hive.pt/joamag/boytacean"
target="_blank"
>
GitLab
</Link>
.
</Paragraph>
<Paragraph>
TIP: Drag and Drop ROM files to the Browser to load the
ROM.
</Paragraph>
</Section>
<Section> <Section>
<Button text={getText()} onClick={onClick} /> <Button text={getText()} onClick={onClick} />
<Button <Button
......
...@@ -5,5 +5,6 @@ export * from "./info/info"; ...@@ -5,5 +5,6 @@ export * from "./info/info";
export * from "./link/link"; export * from "./link/link";
export * from "./pair/pair"; export * from "./pair/pair";
export * from "./panel-split/panel-split"; export * from "./panel-split/panel-split";
export * from "./paragraph/paragraph";
export * from "./section/section"; export * from "./section/section";
export * from "./title/title"; export * from "./title/title";
.paragraph {
font-size: 18px;
line-height: 24px;
margin: 12px 0px 12px 0px;
}
import React, { ReactNode, FC } from "react";
import "./paragraph.css";
type ParagraphProps = {
children?: ReactNode;
text?: string;
style?: string[];
};
export const Paragraph: FC<ParagraphProps> = ({
children,
text,
style = []
}) => {
const classes = () => ["paragraph", ...style].join(" ");
return <p className={classes()}>{children || text}</p>;
};
export default Paragraph;
...@@ -23,7 +23,9 @@ export const Title: FC<TitleProps> = ({ ...@@ -23,7 +23,9 @@ export const Title: FC<TitleProps> = ({
<h1 className={classes()}> <h1 className={classes()}>
{text} {text}
{version && ( {version && (
<Link href={versionUrl} target="_blank">{version}</Link> <Link href={versionUrl} target="_blank">
{version}
</Link>
)} )}
{iconSrc && <img className="icon" src={iconSrc} alt="icon" />} {iconSrc && <img className="icon" src={iconSrc} alt="icon" />}
</h1> </h1>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment