ExamplePage.tsx 1.7 KB

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