@imolko/create-ultra-reporter 2.1.33-beta → 2.1.34-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,24 +4,37 @@ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
4
4
  import Layout from '@theme/Layout';
5
5
  import HomepageFeatures from '@site/src/components/HomepageFeatures';
6
6
  import Heading from '@theme/Heading';
7
+ import { useEffect, useState } from 'react';
7
8
 
8
9
  import styles from './index.module.css';
9
10
 
10
- function HomepageHeader() {
11
- const {siteConfig} = useDocusaurusContext();
11
+ type DashboardSummary = {
12
+ readmeExcerptHtml?: string;
13
+ };
14
+
15
+ function HomepageHeader({ excerpt }: { excerpt?: string }) {
16
+ const { siteConfig } = useDocusaurusContext();
12
17
  return (
13
18
  <header className={clsx('hero hero--primary', styles.heroBanner)}>
14
19
  <div className="container">
15
20
  <Heading as="h1" className="hero__title">
16
21
  {siteConfig.title}
17
22
  </Heading>
18
- <p className="hero__subtitle">{siteConfig.tagline}</p>
23
+ {excerpt && (
24
+ <div
25
+ className={styles.heroExcerpt}
26
+ dangerouslySetInnerHTML={{ __html: excerpt }}
27
+ />
28
+ )}
19
29
  <div className={styles.buttons}>
20
- <Link
21
- className="button button--secondary button--lg"
22
- to="/docs/intro">
23
- Ver resumen del contexto
24
- </Link>
30
+ {excerpt && (
31
+ <Link
32
+ className="button button--secondary button--lg"
33
+ to="/docs/overview"
34
+ >
35
+ Getting started
36
+ </Link>
37
+ )}
25
38
  </div>
26
39
  </div>
27
40
  </header>
@@ -29,15 +42,29 @@ function HomepageHeader() {
29
42
  }
30
43
 
31
44
  export default function Home(): JSX.Element {
32
- const {siteConfig} = useDocusaurusContext();
45
+ const { siteConfig } = useDocusaurusContext();
46
+ const [excerpt, setExcerpt] = useState<string | undefined>(undefined);
47
+
48
+ useEffect(() => {
49
+ fetch('/data/dashboard-summary.json')
50
+ .then((res) => (res.ok ? res.json() : null))
51
+ .then((data: DashboardSummary | null) => {
52
+ if (data?.readmeExcerptHtml) {
53
+ setExcerpt(data.readmeExcerptHtml);
54
+ }
55
+ })
56
+ .catch(() => {});
57
+ }, []);
58
+
33
59
  return (
34
60
  <Layout
35
61
  title={`Hello from ${siteConfig.title}`}
36
- description="Description will go into a meta tag in <head />">
37
- <HomepageHeader />
38
- {/* <main>
62
+ description="Description will go into a meta tag in <head />"
63
+ >
64
+ <HomepageHeader excerpt={excerpt} />
65
+ <main>
39
66
  <HomepageFeatures />
40
- </main> */}
67
+ </main>
41
68
  </Layout>
42
69
  );
43
70
  }