mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-04-03 13:30:42 -03:00
añadido soporte de seguir usuarios en pagina de perfil y search
This commit is contained in:
@@ -15,7 +15,8 @@
|
||||
import DialogContent from './ui/dialog/dialog-content.svelte';
|
||||
import Dialog from './ui/dialog/dialog.svelte';
|
||||
|
||||
let { post }: { post: Post } = $props();
|
||||
let { post }: { post: Omit<Partial<Post>, 'authorId'> & { authorId: string } } = $props();
|
||||
|
||||
let seguido: Boolean | null = $state(null);
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
@@ -56,10 +57,9 @@
|
||||
<Tooltip>
|
||||
<TooltipTrigger>
|
||||
<Button
|
||||
variant={seguido == true ? 'destructive' : 'default'}
|
||||
variant={seguido == true ? 'destructive' : 'outline'}
|
||||
disabled={seguido == null}
|
||||
size="icon-sm"
|
||||
class="ml-auto rounded-full p-1 text-sm"
|
||||
size="icon-lg"
|
||||
onclick={async () => {
|
||||
if (seguido == null) return;
|
||||
const anteriorEstado = seguido;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { resolve } from '$app/paths';
|
||||
import type { UserResponseDto } from '../../types';
|
||||
import BotonSeguir from './BotonSeguir.svelte';
|
||||
import AvatarFallback from './ui/avatar/avatar-fallback.svelte';
|
||||
import AvatarImage from './ui/avatar/avatar-image.svelte';
|
||||
import Avatar from './ui/avatar/avatar.svelte';
|
||||
@@ -31,7 +32,7 @@
|
||||
<p class="text-sm text-muted-foreground">@{usu.username}</p>
|
||||
</a>
|
||||
<div>
|
||||
<Button variant="outline">Seguir</Button>
|
||||
<BotonSeguir post={{ authorId: usu.id }} />
|
||||
</div>
|
||||
</div>
|
||||
{#if usu.bio}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
import CardError from '@/components/CardError.svelte';
|
||||
import CardPerfil from '@/components/CardPerfil.svelte';
|
||||
import DialogModificarUsuario from '@/components/DialogModificarUsuario.svelte';
|
||||
import BotonSeguir from '@/components/BotonSeguir.svelte';
|
||||
|
||||
let { params } = $props();
|
||||
|
||||
@@ -79,6 +80,7 @@
|
||||
{#if params.perfil == $sesionStore?.username}
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
class="m-1 rounded-full bg-blue-600"
|
||||
onclick={() => {
|
||||
showCrearPost = true;
|
||||
@@ -86,6 +88,8 @@
|
||||
>
|
||||
<PenLine />
|
||||
</Button>
|
||||
{:else if $posts?.length == 0}
|
||||
<BotonSeguir post={{ authorId: data.id }} />
|
||||
{/if}
|
||||
</h1>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user