mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-04-01 13:10:44 -03:00
refactors a imports innesesarios y archivos mal formateados
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<script lang="ts">
|
||||
import Card from '@/components/ui/card/card.svelte';
|
||||
import { Content } from '@/components/ui/card';
|
||||
import { apiBase } from '@/stores/url';
|
||||
import { sesionStore } from '@/stores/usuario';
|
||||
import CrearPost from '@/components/crear-post.svelte';
|
||||
import { posts, setPosts, updatePostStore } from '@/stores/posts';
|
||||
|
||||
@@ -3,12 +3,8 @@
|
||||
import Ban from '@lucide/svelte/icons/ban';
|
||||
import PenLine from '@lucide/svelte/icons/pen-line';
|
||||
import Card from '@/components/ui/card/card.svelte';
|
||||
import Avatar from '@/components/ui/avatar/avatar.svelte';
|
||||
import AvatarImage from '@/components/ui/avatar/avatar-image.svelte';
|
||||
import AvatarFallback from '@/components/ui/avatar/avatar-fallback.svelte';
|
||||
import { CardContent } from '@/components/ui/card';
|
||||
import type { Post } from '../../types.js';
|
||||
import Spinner from '@/components/ui/spinner/spinner.svelte';
|
||||
import { fade, slide } from 'svelte/transition';
|
||||
import PostCard from '@/components/PostCard.svelte';
|
||||
import { posts, setPosts, updatePostStore } from '@/stores/posts.js';
|
||||
@@ -19,7 +15,6 @@
|
||||
import { Dialog } from '@/components/ui/dialog/index.js';
|
||||
import CrearPost from '@/components/crear-post.svelte';
|
||||
import DialogContent from '@/components/ui/dialog/dialog-content.svelte';
|
||||
import DialogHeader from '@/components/ui/dialog/dialog-header.svelte';
|
||||
import DialogTitle from '@/components/ui/dialog/dialog-title.svelte';
|
||||
import { sesionStore } from '@/stores/usuario.js';
|
||||
import CardHeader from '@/components/ui/card/card-header.svelte';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export function load({ url }) {
|
||||
return {
|
||||
message: url.searchParams.get('msg')
|
||||
};
|
||||
return {
|
||||
message: url.searchParams.get('msg')
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,60 +1,54 @@
|
||||
<script lang="ts">
|
||||
import * as Alert from '@/components/ui/alert';
|
||||
import LoginForm from '@/components/ui/login-form/login-form.svelte';
|
||||
import AlertCircleIcon from "@lucide/svelte/icons/alert-circle";
|
||||
import * as Alert from '@/components/ui/alert';
|
||||
import LoginForm from '@/components/ui/login-form/login-form.svelte';
|
||||
import AlertCircleIcon from '@lucide/svelte/icons/alert-circle';
|
||||
import { fade, fly } from 'svelte/transition';
|
||||
import Info from '@lucide/svelte/icons/info';
|
||||
import Info from '@lucide/svelte/icons/info';
|
||||
|
||||
let {data} = $props();
|
||||
let { data } = $props();
|
||||
|
||||
let showAlert: boolean = $state(false);
|
||||
let showAlert: boolean = $state(false);
|
||||
|
||||
let message = $state(data.message);
|
||||
let message = $state(data.message);
|
||||
|
||||
$effect(()=>{
|
||||
resetAlert();
|
||||
if (data.message) {
|
||||
history.replaceState(history.state, "", "/login");
|
||||
setTimeout(() => {
|
||||
message = "";
|
||||
}, 7000);
|
||||
}
|
||||
});
|
||||
|
||||
async function resetAlert (){
|
||||
if (showAlert == true){
|
||||
await new Promise(res => setTimeout(res, 2000));
|
||||
showAlert=false;
|
||||
}
|
||||
}
|
||||
|
||||
$effect(() => {
|
||||
resetAlert();
|
||||
if (data.message) {
|
||||
history.replaceState(history.state, '', '/login');
|
||||
setTimeout(() => {
|
||||
message = '';
|
||||
}, 7000);
|
||||
}
|
||||
});
|
||||
|
||||
async function resetAlert() {
|
||||
if (showAlert == true) {
|
||||
await new Promise((res) => setTimeout(res, 2000));
|
||||
showAlert = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="flex min-h-fit w-full items-center justify-center p-6 md:p-10">
|
||||
<div class="w-full max-w-sm">
|
||||
<div class="w-full max-w-sm">
|
||||
{#if message}
|
||||
<div class="mb-2" transition:fly>
|
||||
<Alert.Root>
|
||||
<Info />
|
||||
<Alert.Title>Info</Alert.Title>
|
||||
<Alert.Description>
|
||||
Ingrese las credenciales de la cuenta recien creada
|
||||
</Alert.Description>
|
||||
</Alert.Root>
|
||||
</div>
|
||||
|
||||
{/if}
|
||||
<LoginForm bind:showAlert={showAlert} id="1" />
|
||||
{#if showAlert}
|
||||
<div class="mt-2" transition:fade>
|
||||
<Alert.Root variant="destructive">
|
||||
<AlertCircleIcon />
|
||||
<Alert.Title>No se pudo iniciar sesion</Alert.Title>
|
||||
<Alert.Description>
|
||||
Revise su usuario o contraseña
|
||||
</Alert.Description>
|
||||
</Alert.Root>
|
||||
</div>
|
||||
{#if message}
|
||||
<div class="mb-2" transition:fly>
|
||||
<Alert.Root>
|
||||
<Info />
|
||||
<Alert.Title>Info</Alert.Title>
|
||||
<Alert.Description>Ingrese las credenciales de la cuenta recien creada</Alert.Description>
|
||||
</Alert.Root>
|
||||
</div>
|
||||
{/if}
|
||||
<LoginForm bind:showAlert id="1" />
|
||||
{#if showAlert}
|
||||
<div class="mt-2" transition:fade>
|
||||
<Alert.Root variant="destructive">
|
||||
<AlertCircleIcon />
|
||||
<Alert.Title>No se pudo iniciar sesion</Alert.Title>
|
||||
<Alert.Description>Revise su usuario o contraseña</Alert.Description>
|
||||
</Alert.Root>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,38 +1,34 @@
|
||||
<script lang="ts">
|
||||
import SignupForm from '@/components/signup-form.svelte';
|
||||
|
||||
import AlertCircleIcon from "@lucide/svelte/icons/alert-circle";
|
||||
import * as Alert from '@/components/ui/alert';
|
||||
import AlertCircleIcon from '@lucide/svelte/icons/alert-circle';
|
||||
import * as Alert from '@/components/ui/alert';
|
||||
import { fade } from 'svelte/transition';
|
||||
|
||||
let showAlert: boolean = $state(false);
|
||||
let showAlert: boolean = $state(false);
|
||||
|
||||
$effect(()=>{
|
||||
resetAlert();
|
||||
});
|
||||
|
||||
async function resetAlert (){
|
||||
if (showAlert == true){
|
||||
await new Promise(res => setTimeout(res, 2000));
|
||||
showAlert=false;
|
||||
}
|
||||
}
|
||||
$effect(() => {
|
||||
resetAlert();
|
||||
});
|
||||
|
||||
async function resetAlert() {
|
||||
if (showAlert == true) {
|
||||
await new Promise((res) => setTimeout(res, 2000));
|
||||
showAlert = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="flex min-h-fit w-full items-center justify-center p-6 md:p-10">
|
||||
<div class="w-full max-w-sm">
|
||||
<SignupForm bind:showAlert={showAlert} />
|
||||
{#if showAlert}
|
||||
<div class="mt-2" transition:fade>
|
||||
<Alert.Root variant="destructive">
|
||||
<AlertCircleIcon />
|
||||
<Alert.Title>No se pudo crear la cuenta</Alert.Title>
|
||||
<Alert.Description>
|
||||
Intente nuevamente.
|
||||
</Alert.Description>
|
||||
</Alert.Root>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="w-full max-w-sm">
|
||||
<SignupForm bind:showAlert />
|
||||
{#if showAlert}
|
||||
<div class="mt-2" transition:fade>
|
||||
<Alert.Root variant="destructive">
|
||||
<AlertCircleIcon />
|
||||
<Alert.Title>No se pudo crear la cuenta</Alert.Title>
|
||||
<Alert.Description>Intente nuevamente.</Alert.Description>
|
||||
</Alert.Root>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import UserCard from '@/components/UserCard.svelte';
|
||||
|
||||
let { data } = $props();
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user