Error al cargar en el cliente los bloques predefinidos
This commit is contained in:
parent
b743fc226f
commit
4a53730bbb
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@uecko-presupuestador/client",
|
"name": "@uecko-presupuestador/client",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.0.9",
|
"version": "1.1.0",
|
||||||
"author": "Rodax Software <dev@rodax-software.com>",
|
"author": "Rodax Software <dev@rodax-software.com>",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -99,39 +99,42 @@ export const BlockList = ({
|
|||||||
onSelect: (data: BlockDataType, quantity: number) => void;
|
onSelect: (data: BlockDataType, quantity: number) => void;
|
||||||
}) => {
|
}) => {
|
||||||
const { i18n } = useTranslation();
|
const { i18n } = useTranslation();
|
||||||
const [language] = useState(i18n.language);
|
const [language] = useState(i18n.resolvedLanguage || "es");
|
||||||
const [listState] = useState(blockData[language.toLowerCase()]);
|
const [listState] = useState(blockData[language.toLowerCase()]);
|
||||||
|
|
||||||
|
console.log(language);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ScrollArea className='h-96'>
|
<ScrollArea className='h-96'>
|
||||||
<div className='flex flex-col gap-2 p-4 pt-0'>
|
<div className='flex flex-col gap-2 p-4 pt-0'>
|
||||||
{listState
|
{listState &&
|
||||||
.sort((a, b) => a.title.localeCompare(b.title))
|
listState
|
||||||
.map((_block, _blockIdx) => {
|
.sort((a, b) => a.title.localeCompare(b.title))
|
||||||
return (
|
.map((_block, _blockIdx) => {
|
||||||
<button
|
return (
|
||||||
key={_block.id}
|
<button
|
||||||
className='flex flex-col items-start gap-2 p-3 text-sm text-left transition-all border rounded-lg hover:bg-accent'
|
key={_block.id}
|
||||||
onClick={() => onSelect && onSelect(_block, 1)}
|
className='flex flex-col items-start gap-2 p-3 text-sm text-left transition-all border rounded-lg hover:bg-accent'
|
||||||
>
|
onClick={() => onSelect && onSelect(_block, 1)}
|
||||||
<div className='flex flex-col w-full gap-1'>
|
>
|
||||||
<div className='flex items-center'>
|
<div className='flex flex-col w-full gap-1'>
|
||||||
<div className='flex items-center gap-2'>
|
<div className='flex items-center'>
|
||||||
<div className='font-semibold'>{_block.title}</div>
|
<div className='flex items-center gap-2'>
|
||||||
|
<div className='font-semibold'>{_block.title}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className='text-xs line-clamp-2 text-muted-foreground'>
|
||||||
|
<p
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: _block.body.substring(0, 300).replace("\r\n", "<br>"),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</button>
|
||||||
<div className='text-xs line-clamp-2 text-muted-foreground'>
|
);
|
||||||
<p
|
})}
|
||||||
dangerouslySetInnerHTML={{
|
|
||||||
__html: _block.body.substring(0, 300).replace("\r\n", "<br>"),
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</div>
|
</div>
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
);
|
);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
2
dist/client/index.html
vendored
2
dist/client/index.html
vendored
@ -8,7 +8,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<link href="https://fonts.upset.dev/css2?family=Poppins&display=swap" rel="stylesheet" />
|
<link href="https://fonts.upset.dev/css2?family=Poppins&display=swap" rel="stylesheet" />
|
||||||
<title>Uecko</title>
|
<title>Uecko</title>
|
||||||
<script type="module" crossorigin src="/assets/index-DmLZGQJJ.js"></script>
|
<script type="module" crossorigin src="/assets/index-C4JGyIFf.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-B5XW7DrB.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-B5XW7DrB.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "uecko-presupuestador",
|
"name": "uecko-presupuestador",
|
||||||
"version": "1.0.9",
|
"version": "1.1.0",
|
||||||
"author": "Rodax Software <dev@rodax-software.com>",
|
"author": "Rodax Software <dev@rodax-software.com>",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user