Fix: dejaba crear posts desde la pagina de perfil de otros usuarios

This commit is contained in:
2025-11-27 18:41:14 -03:00
parent 11dfe83aaa
commit 24c1c401cb

View File

@@ -21,6 +21,7 @@
import DialogContent from '@/components/ui/dialog/dialog-content.svelte'; import DialogContent from '@/components/ui/dialog/dialog-content.svelte';
import DialogHeader from '@/components/ui/dialog/dialog-header.svelte'; import DialogHeader from '@/components/ui/dialog/dialog-header.svelte';
import DialogTitle from '@/components/ui/dialog/dialog-title.svelte'; import DialogTitle from '@/components/ui/dialog/dialog-title.svelte';
import { sesionStore } from '@/stores/usuario.js';
let { params } = $props(); let { params } = $props();
@@ -98,15 +99,17 @@
class="mt-10 flex scroll-m-20 justify-between text-3xl font-extrabold tracking-tight lg:text-3xl" class="mt-10 flex scroll-m-20 justify-between text-3xl font-extrabold tracking-tight lg:text-3xl"
> >
Posts: Posts:
<Button {#if params.perfil == $sesionStore?.username}
variant="ghost" <Button
class="m-1 rounded-full bg-blue-600" variant="ghost"
onclick={() => { class="m-1 rounded-full bg-blue-600"
showCrearPost = true; onclick={() => {
}} showCrearPost = true;
> }}
<PenLine /> >
</Button> <PenLine />
</Button>
{/if}
</h1> </h1>
<hr class="mb-8" /> <hr class="mb-8" />
@@ -148,10 +151,7 @@
{/if} {/if}
<div transition:fade> <div transition:fade>
<Dialog open={showCrearPost}> <Dialog open={showCrearPost} onOpenChange={() => (showCrearPost = false)}>
<DialogHeader>
<DialogTitle>Crear Publicacion</DialogTitle>
</DialogHeader>
<DialogContent <DialogContent
onkeydown={(e: KeyboardEvent) => { onkeydown={(e: KeyboardEvent) => {
if (e.ctrlKey && e.key === 'Enter') { if (e.ctrlKey && e.key === 'Enter') {
@@ -159,6 +159,7 @@
} }
}} }}
> >
<DialogTitle>Crear Publicacion</DialogTitle>
<CrearPost /> <CrearPost />
</DialogContent> </DialogContent>
</Dialog> </Dialog>