mirror of
https://github.com/elementor/hello-theme.git
synced 2026-07-30 15:16:56 +08:00
Some checks failed
Build / Build theme (push) Failing after 1s
Lint / ESLint (push) Failing after 0s
PHPUnit / File Diff (push) Failing after 1s
Lint / PHPCS (push) Failing after 41s
PHPUnit / PHPUnit - WordPress 6.8 - PHP version 7.4 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.9 - PHP version 7.4 (push) Has been skipped
PHPUnit / PHPUnit - WordPress latest - PHP version 7.4 (push) Has been skipped
PHPUnit / PHPUnit - WordPress nightly - PHP version 7.4 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.8 - PHP version 8.0 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.9 - PHP version 8.0 (push) Has been skipped
PHPUnit / PHPUnit - WordPress latest - PHP version 8.0 (push) Has been skipped
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.0 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.8 - PHP version 8.1 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.9 - PHP version 8.1 (push) Has been skipped
PHPUnit / PHPUnit - WordPress latest - PHP version 8.1 (push) Has been skipped
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.1 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.8 - PHP version 8.2 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.9 - PHP version 8.2 (push) Has been skipped
PHPUnit / PHPUnit - WordPress latest - PHP version 8.2 (push) Has been skipped
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.2 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.8 - PHP version 8.3 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.9 - PHP version 8.3 (push) Has been skipped
PHPUnit / PHPUnit - WordPress latest - PHP version 8.3 (push) Has been skipped
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.3 (push) Has been skipped
PHPUnit / PHPUnit - Test Results (push) Successful in 2s
* Setup prettier * Fix lint/format issues
25 lines
769 B
JavaScript
25 lines
769 B
JavaScript
import Box from '@elementor/ui/Box';
|
|
import Typography from '@elementor/ui/Typography';
|
|
import { useMemo } from 'react';
|
|
|
|
export default function Update({ title, description }) {
|
|
const descriptionToShow = useMemo(() => {
|
|
const parser = new DOMParser();
|
|
const doc = parser.parseFromString(description, 'text/html');
|
|
const listItems = doc.querySelectorAll('li');
|
|
const extractedContent = Array.from(listItems).map((item) =>
|
|
item.textContent.trim(),
|
|
);
|
|
return extractedContent.join('\n');
|
|
}, [description]);
|
|
return (
|
|
<Box sx={{ py: 2, px: 3 }}>
|
|
<Typography variant={'subtitle1'} sx={{ pb: 0.75 }}>
|
|
{title}
|
|
</Typography>
|
|
<Typography variant={'body2'} sx={{ whiteSpace: 'pre-line' }}>
|
|
{descriptionToShow}
|
|
</Typography>
|
|
</Box>
|
|
);
|
|
}
|