ExamplePage.tsx 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import * as React from 'react';
  2. import Helmet from 'react-helmet';
  3. import { useTranslation } from 'react-i18next';
  4. import { Page, PageSection, Text, TextContent, Title } from '@patternfly/react-core';
  5. import { CheckCircleIcon } from '@patternfly/react-icons';
  6. import './example.css';
  7. export default function ExamplePage() {
  8. const { t } = useTranslation('plugin__console-plugin-template');
  9. return (
  10. <>
  11. <Helmet>
  12. <title data-test="example-page-title">{t('Hello, Plugin!')}</title>
  13. </Helmet>
  14. <Page>
  15. <PageSection variant="light">
  16. <Title headingLevel="h1">{t('Hello, Plugin!')}</Title>
  17. </PageSection>
  18. <PageSection variant="light">
  19. <TextContent>
  20. <Text component="p">
  21. <span className="console-plugin-template__nice">
  22. <CheckCircleIcon /> {t('Success!')}
  23. </span>{' '}
  24. {t('Your plugin is working.')}
  25. </Text>
  26. <Text component="p">
  27. {t(
  28. 'This is a custom page contributed by the console plugin template. The extension that adds the page is declared in console-extensions.json in the project root along with the corresponding nav item. Update console-extensions.json to change or add extensions. Code references in console-extensions.json must have a corresponding property',
  29. )}
  30. <code>{t('exposedModules')}</code>{' '}
  31. {t('in package.json mapping the reference to the module.')}
  32. </Text>
  33. <Text component="p">
  34. {t('After cloning this project, replace references to')}{' '}
  35. <code>{t('console-template-plugin')}</code>{' '}
  36. {t('and other plugin metadata in package.json with values for your plugin.')}
  37. </Text>
  38. </TextContent>
  39. </PageSection>
  40. </Page>
  41. </>
  42. );
  43. }