ExamplePage.tsx 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import * as React from 'react';
  2. import Helmet from 'react-helmet';
  3. import {
  4. Page,
  5. PageSection,
  6. Text,
  7. TextContent,
  8. Title,
  9. } from '@patternfly/react-core';
  10. import './example.css';
  11. import { useTranslation } from 'react-i18next';
  12. export default function ExamplePage() {
  13. const { t } = useTranslation('plugin__console-plugin-template');
  14. return (
  15. <>
  16. <Helmet>
  17. <title data-test="example-page-title">{t('Hello, Plugin!')}</title>
  18. </Helmet>
  19. <Page>
  20. <PageSection variant="light">
  21. <Title headingLevel="h1">{t('Hello, Plugin!')}</Title>
  22. </PageSection>
  23. <PageSection variant="light">
  24. <TextContent>
  25. <Text component="p">
  26. <span className="console-plugin-template__nice">
  27. {t('Nice!')}
  28. </span>{' '}
  29. {t('Your plugin is working.')}
  30. </Text>
  31. <Text component="p">
  32. {t(
  33. '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 corresonding property',
  34. )}
  35. <code>{t('exposedModules')}</code>{' '}
  36. {t('in package.json mapping the reference to the module.')}
  37. </Text>
  38. <Text component="p">
  39. {t('After cloning this project, replace references to')}{' '}
  40. <code>{t('console-template-plugin')}</code>{' '}
  41. {t(
  42. 'and other plugin metadata in package.json with values for your plugin.',
  43. )}
  44. </Text>
  45. </TextContent>
  46. </PageSection>
  47. </Page>
  48. </>
  49. );
  50. }