ExamplePage.tsx 1.6 KB

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