Whatever ClearWindow needs to be in json
All checks were successful
Build and Deploy Nuxt / build (push) Successful in 42s
All checks were successful
Build and Deploy Nuxt / build (push) Successful in 42s
This commit is contained in:
@@ -4,10 +4,9 @@ import { GetUser, LogoutUser } from '@/services/User'
|
||||
|
||||
import Server from '@/services/Server'
|
||||
|
||||
import { ClearWindows, CreateWindow, CreateChildWindow, ClearWindow } from '../../services/Windows';
|
||||
import { CreateWindow, CreateChildWindow, ClearWindow, GetFirstWindowId } from '../../services/Windows';
|
||||
import { backendUrl } from '../../services/BackendURL';
|
||||
import Spinner from './Spinner.vue';
|
||||
const emitter = useEmitter();
|
||||
const loadedIcon = ref(false);
|
||||
|
||||
const username = ref("");
|
||||
@@ -45,13 +44,12 @@ function retrieveAvatar(){
|
||||
function LogOut(){
|
||||
LogoutUser();
|
||||
|
||||
ClearWindows({type: "main_menu"});
|
||||
ClearWindow({type: "main_menu"});
|
||||
CreateWindow('login');
|
||||
}
|
||||
|
||||
function EditProfile(){
|
||||
console.log("User:"); console.log(GetUser());
|
||||
CreateChildWindow('main_menu', 'edit_profile', {
|
||||
CreateChildWindow(GetFirstWindowId('main_menu'), 'edit_profile', {
|
||||
user: GetUser()
|
||||
});
|
||||
}
|
||||
@@ -104,7 +102,7 @@ onMounted(() => {
|
||||
<Spinner v-show="!loadedIcon" :size="30"></Spinner>
|
||||
</div>
|
||||
<div class="main-user-info">
|
||||
<b>{{ username }}</b><br>Hola
|
||||
<b>{{ username }}</b><br>
|
||||
</div>
|
||||
|
||||
<div class="main-user-actions">
|
||||
|
||||
84
frontend/app/components/partials/IconButton.vue
Normal file
84
frontend/app/components/partials/IconButton.vue
Normal file
@@ -0,0 +1,84 @@
|
||||
<script setup>
|
||||
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { AddTooltip } from '~/services/Tooltip';
|
||||
const props = defineProps(['icon', 'action', 'size', 'toggled', 'tooltip']);
|
||||
let icon = props.icon;
|
||||
let action = props.action;
|
||||
|
||||
let size = props.size;
|
||||
let toggled = props.toggled;
|
||||
let tooltip = props.tooltip;
|
||||
|
||||
const button = ref(null);
|
||||
|
||||
onMounted(() => {
|
||||
if(tooltip){
|
||||
AddTooltip(button.value, tooltip);
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<template>
|
||||
<div class="icon-button sound-click" :class="size + ' ' + toggled" v-on:click.prevent="action" ref="button">
|
||||
<img class="icon" draggable="false" :src="icon" :class="size">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<style scoped lang="scss">
|
||||
.icon-button {
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
|
||||
&.big {
|
||||
height: 42px;
|
||||
width: 42px;
|
||||
}
|
||||
|
||||
&.small {
|
||||
height: 24px;
|
||||
width: 24px;
|
||||
}
|
||||
|
||||
&.toggled {
|
||||
filter: invert(0.9);
|
||||
}
|
||||
|
||||
background-color: var(--color-background-soft);
|
||||
border-radius: 6px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin: 2px;
|
||||
|
||||
transition: .3s background-color;
|
||||
border: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
.icon-button:hover {
|
||||
background-color: var(--color-background-softer);
|
||||
}
|
||||
|
||||
.icon {
|
||||
height: 24px;
|
||||
width: 24px;
|
||||
pointer-events: none;
|
||||
|
||||
&.big {
|
||||
height: 38px;
|
||||
width: 38px;
|
||||
}
|
||||
|
||||
&.small {
|
||||
height: 18px;
|
||||
width: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user