Skip to content

Commit 5906ba9

Browse files
committed
Add custom components
1 parent 9cb9732 commit 5906ba9

File tree

7 files changed

+183
-0
lines changed

7 files changed

+183
-0
lines changed

src/components/Figures.jsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* eslint-disable react/prop-types,import/no-unresolved */
2+
import React from 'react'
3+
import useBaseUrl from '@docusaurus/useBaseUrl'
4+
5+
export default function Figure({ src, caption }) {
6+
return (
7+
<div>
8+
<figure style={{ padding: 20 }}>
9+
<img src={useBaseUrl(src)} alt={caption} />
10+
<figcaption style={{textAlign: "center", fontStyle: "italic"}}>{`${caption}`}</figcaption>
11+
</figure>
12+
</div>
13+
)
14+
}

src/components/Highlight.jsx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import React from 'react'
2+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; // Import the FontAwesomeIcon component.
3+
4+
export default function Highlight({children, color, no_break}) {
5+
return (
6+
<span
7+
style={{
8+
backgroundColor: color,
9+
borderRadius: '4px',
10+
color: '#fff',
11+
padding: '0.2rem',
12+
whiteSpace: no_break ? 'pre' : null
13+
}}>
14+
{children}
15+
</span>
16+
);
17+
}
18+
19+
// Webadmin buttons
20+
21+
export function HighlightWebAdmin() {
22+
return <Highlight no_break={true} color="green"><FontAwesomeIcon icon={["fa", "cogs"]}/> Webadmin</Highlight>;
23+
}
24+
export function HighlightApplications() {
25+
return <Highlight no_break={true} color="#1877F2"><FontAwesomeIcon icon={["fa", "cubes"]}/> Applications</Highlight>;
26+
}
27+
export function HighlightAppInstall() {
28+
return <Highlight no_break={true} color="green">+ Install</Highlight>;
29+
}
30+
export function HighlightDiagnosis() {
31+
return <Highlight no_break={true} color="darkgreen"><FontAwesomeIcon icon={["fa", "stethoscope"]}/> Diagnosis</Highlight>;
32+
}
33+
34+
export function HighlightFFDN() {
35+
return <Highlight no_break={true} color="#3a87ad">FFDN</Highlight>;
36+
}
37+
export function HighlightNonProfit() {
38+
return <Highlight no_break={true} color="#32b643">Non Profit</Highlight>;
39+
}
40+
41+
export function HighlightCHATONS() {
42+
return <Highlight no_break={true} color="#f0980c">CHATONS</Highlight>;
43+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import clsx from 'clsx';
2+
import Heading from '@theme/Heading';
3+
import styles from './styles.module.css';
4+
5+
const FeatureList = [
6+
{
7+
title: 'Easy to Use',
8+
Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default,
9+
description: (
10+
<>
11+
Docusaurus was designed from the ground up to be easily installed and
12+
used to get your website up and running quickly.
13+
</>
14+
),
15+
},
16+
{
17+
title: 'Focus on What Matters',
18+
Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default,
19+
description: (
20+
<>
21+
Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go
22+
ahead and move your docs into the <code>docs</code> directory.
23+
</>
24+
),
25+
},
26+
{
27+
title: 'Powered by React',
28+
Svg: require('@site/static/img/undraw_docusaurus_react.svg').default,
29+
description: (
30+
<>
31+
Extend or customize your website layout by reusing React. Docusaurus can
32+
be extended while reusing the same header and footer.
33+
</>
34+
),
35+
},
36+
];
37+
38+
function Feature({Svg, title, description}) {
39+
return (
40+
<div className={clsx('col col--4')}>
41+
<div className="text--center">
42+
<Svg className={styles.featureSvg} role="img" />
43+
</div>
44+
<div className="text--center padding-horiz--md">
45+
<Heading as="h3">{title}</Heading>
46+
<p>{description}</p>
47+
</div>
48+
</div>
49+
);
50+
}
51+
52+
export default function HomepageFeatures() {
53+
return (
54+
<section className={styles.features}>
55+
<div className="container">
56+
<div className="row">
57+
{FeatureList.map((props, idx) => (
58+
<Feature key={idx} {...props} />
59+
))}
60+
</div>
61+
</div>
62+
</section>
63+
);
64+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.features {
2+
display: flex;
3+
align-items: center;
4+
padding: 2rem 0;
5+
width: 100%;
6+
}
7+
8+
.featureSvg {
9+
height: 200px;
10+
width: 200px;
11+
}

src/components/LinkButton.jsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React from 'react';
2+
import Link from '@docusaurus/Link';
3+
import Heading from '@theme/Heading';
4+
5+
export default function LinkButton({children, url, color}) {
6+
return (
7+
<Link to={url}>
8+
<div style={{
9+
marginBottom: "1rem",
10+
backgroundColor: color,
11+
borderRadius: '4px',
12+
padding: '0.6rem',
13+
width: 'auto',
14+
display: 'inline-block',
15+
textAlign: 'center',
16+
color: 'black',
17+
mixBlendMode: 'difference'
18+
}}>
19+
{children}
20+
</div>
21+
</Link>
22+
)
23+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from 'react';
2+
import Link from '@docusaurus/Link';
3+
import Heading from '@theme/Heading';
4+
5+
export default function YunoHostDocsCardHeading({children, url, color}) {
6+
return (
7+
<Link to={url} style={{marginBottom: "1rem"}}>
8+
<div class="card__body" style={{backgroundColor: color, color: 'white'}}>
9+
<Heading as="h3">
10+
{children}
11+
</Heading>
12+
</div>
13+
</Link>
14+
)
15+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
import React from 'react';
3+
import clsx from 'clsx';
4+
5+
export default function YunoHostDocsCard({children}) {
6+
return (
7+
<div className="col col--6 margin-bottom--lg">
8+
<div className={clsx('card')} style={{textAlign: 'center'}}>
9+
{children}
10+
</div>
11+
</div>
12+
);
13+
}

0 commit comments

Comments
 (0)