Skip to content

Commit

Permalink
Refactor primefaces#4392 - Messages PT Demo
Browse files Browse the repository at this point in the history
  • Loading branch information
habubey committed May 22, 2023
1 parent 328477c commit c3f0c83
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions components/doc/messages/pt/ptdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,15 @@ export function PTDoc(props) {
const msgs = useRef(null);

useMountEffect(() => {
msgs.current &&
msgs.current.show([
{ sticky: true, severity: 'info', summary: 'Info', detail: 'Message Content', closable: false },
{ sticky: true, severity: 'info', summary: 'Info', detail: 'Message Content', closable: false },
{ sticky: true, severity: 'info', summary: 'Info', detail: 'Message Content', closable: false },
{ sticky: true, severity: 'info', summary: 'Info', detail: 'Message Content', closable: false }
]);
msgs.current && msgs.current.show([{ sticky: true, severity: 'info', summary: 'Info', detail: 'Message Content', closable: false }]);
});

const code = {
basic: `
<Messages
ref={msgs}
pt={{
wrapper: ({ index }) => ({ className: \`bg-yellow-\${((index + 1 > 5 && 5) || index + 1 || 1) * 100} my-4\` })
wrapper: { className: 'bg-yellow-100' }
}}
/>
`,
Expand All @@ -36,9 +30,6 @@ export default function PTDemo() {
useMountEffect(() => {
msgs.current && msgs.current.show([
{ sticky: true, severity: 'info', summary: 'Info', detail: 'Message Content', closable: false },
{ sticky: true, severity: 'info', summary: 'Info', detail: 'Message Content', closable: false },
{ sticky: true, severity: 'info', summary: 'Info', detail: 'Message Content', closable: false },
{ sticky: true, severity: 'info', summary: 'Info', detail: 'Message Content', closable: false }
]);
});
Expand All @@ -48,7 +39,7 @@ export default function PTDemo() {
<Messages
ref={msgs}
pt={{
wrapper: ({ index }) => ({ className: \`bg-yellow-\${((index + 1 > 5 && 5) || index + 1 || 1) * 100} my-4\` })
wrapper: { className: 'bg-yellow-100' }
}}
/>
</div>
Expand All @@ -65,9 +56,6 @@ export default function PTDemo() {
useMountEffect(() => {
msgs.current && msgs.current.show([
{ sticky: true, severity: 'info', summary: 'Info', detail: 'Message Content', closable: false },
{ sticky: true, severity: 'info', summary: 'Info', detail: 'Message Content', closable: false },
{ sticky: true, severity: 'info', summary: 'Info', detail: 'Message Content', closable: false },
{ sticky: true, severity: 'info', summary: 'Info', detail: 'Message Content', closable: false }
]);
});
Expand All @@ -77,7 +65,7 @@ export default function PTDemo() {
<Messages
ref={msgs}
pt={{
wrapper: ({ index }) => ({ className: \`bg-yellow-\${((index + 1 > 5 && 5) || index + 1 || 1) * 100} my-4\` })
wrapper: { className: 'bg-yellow-100' }
}}
/>
</div>
Expand All @@ -93,7 +81,7 @@ export default function PTDemo() {
<Messages
ref={msgs}
pt={{
wrapper: ({ index }) => ({ className: `bg-yellow-${((index + 1 > 5 && 5) || index + 1 || 1) * 100} my-4` })
wrapper: { className: 'bg-yellow-100' }
}}
/>
</div>
Expand Down

0 comments on commit c3f0c83

Please sign in to comment.