diff --git a/components/doc/messages/index.js b/components/doc/messages/index.js
index f8fdaaa4ff..d1471b8422 100644
--- a/components/doc/messages/index.js
+++ b/components/doc/messages/index.js
@@ -15,6 +15,9 @@ import { Messages } from 'primereact/messages';
import { Message } from 'primereact/message';
import { InputText } from 'primereact/inputtext';
import { Button } from 'primereact/button';
+import getConfig from 'next/config';
+import * as CustomImage from './custom-icon-active.png';
+import Image from 'next/image';
export class MessagesDemo extends Component {
@@ -82,7 +85,7 @@ export class MessagesDemo extends Component {
@@ -118,49 +121,71 @@ export class MessagesDemo extends Component {
tabName: 'Hooks Source',
content: `
import React, { useEffect, useRef } from 'react';
-import { Messages } from 'primereact/messages';
-import { Message } from 'primereact/message';
-import { InputText } from 'primereact/inputtext';
-import { Button } from 'primereact/button';
-
+import { Messages } from '../../components/lib/messages/Messages';
+import { Message } from '../../components/lib/message/Message';
+import { InputText } from '../../components/lib/inputtext/InputText';
+import { Button } from '../../components/lib/button/Button';
+import MessagesDoc from '../../components/doc/messages';
+import { DocActions } from '../../components/doc/common/docactions';
+import Head from 'next/head';
+import getConfig from 'next/config';
+import * as CustomImage from './custom-icon-active.png';
+import Image from 'next/image';
+
const MessagesDemo = () => {
- const msgs1 = useRef(null);
- const msgs2 = useRef(null);
- const msgs3 = useRef(null);
-
- useEffect(() => {
- msgs1.current.show([
- { severity: 'success', summary: 'Success', detail: 'Message Content', sticky: true },
- { severity: 'info', summary: 'Info', detail: 'Message Content', sticky: true },
- { severity: 'warn', summary: 'Warning', detail: 'Message Content', sticky: true },
- { severity: 'error', summary: 'Error', detail: 'Message Content', sticky: true }
- ]);
-
- msgs3.current.show({
- severity: 'info', sticky: true, content: (
-
- e.target.src='https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png'} width="32" />
- Always bet on Prime.
-
- )
- });
- }, []); // eslint-disable-line react-hooks/exhaustive-deps
-
- const addMessages = () => {
- msgs2.current.show([
- { severity: 'success', summary: 'Success', detail: 'Message Content', sticky: true },
- { severity: 'info', summary: 'Info', detail: 'Message Content', sticky: true },
- { severity: 'warn', summary: 'Warning', detail: 'Message Content', sticky: true },
- { severity: 'error', summary: 'Error', detail: 'Message Content', sticky: true }
- ]);
- }
-
- const clearMessages = () => {
- msgs2.current.clear();
- }
+const msgs1 = useRef(null);
+const msgs2 = useRef(null);
+const msgs3 = useRef(null);
+const contextPath = getConfig().publicRuntimeConfig.contextPath;
+
+useEffect(() => {
+ msgs1.current.show([
+ { severity: 'success', icon: 'pi pi-apple', summary: 'Success', detail: 'Message Content', sticky: true },
+ { severity: 'info', summary: 'Info', detail: 'Message Content', sticky: true },
+ { severity: 'warn', summary: 'Warning', detail: 'Message Content', sticky: true },
+ { severity: 'error', summary: 'Error', detail: 'Message Content', sticky: true }
+ ]);
+
+ msgs3.current.show({
+ severity: 'info',
+ sticky: true,
+ content: (
+
+ (e.target.src = 'https://www.primefaces.org/wp-content/uploads/2020/05/placeholder.png')} width="32" />
+ Always bet on Prime.
+
+ )
+ });
+}, []); // eslint-disable-line react-hooks/exhaustive-deps
+
+const addMessages = () => {
+ msgs2.current.show([
+ { severity: 'success', summary: 'Success', detail: 'Message Content', sticky: true },
+ { severity: 'info', summary: 'Info', detail: 'Message Content', sticky: true },
+ { severity: 'warn', summary: 'Warning', detail: 'Message Content', sticky: true },
+ { severity: 'error', summary: 'Error', detail: 'Message Content', sticky: true }
+ ]);
+};
+
+const clearMessages = () => {
+ msgs2.current.clear();
+};
+
+return (
+
+
+
React Messages Component
+
+
+
+
+
Messages
+
Messages is used to display inline messages with various severities.
+
+
+
- return (
-
+
Severities
@@ -181,24 +206,28 @@ const MessagesDemo = () => {
-
+ } text="Message Content" />
-
+
-
+
Validation Message
-
+
-
+
@@ -207,13 +236,17 @@ const MessagesDemo = () => {
- Username is not available.
+
+ Username is not available.
+
- )
-}
- `
+
+);
+};
+
+`
},
ts: {
tabName: 'TS Source',
@@ -223,6 +256,9 @@ import { Messages } from 'primereact/messages';
import { Message } from 'primereact/message';
import { InputText } from 'primereact/inputtext';
import { Button } from 'primereact/button';
+import getConfig from 'next/config';
+import * as CustomImage from './custom-icon-active.png';
+import Image from 'next/image';
const MessagesDemo = () => {
const msgs1 = useRef(null);
@@ -285,7 +321,7 @@ const MessagesDemo = () => {