Skip to content

Commit

Permalink
refactor in PTitle
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadiducho committed Mar 7, 2024
1 parent 6936203 commit 6abfe29
Show file tree
Hide file tree
Showing 39 changed files with 122 additions and 122 deletions.
27 changes: 27 additions & 0 deletions src/components/lib/PTitle.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<component :is="tag" :class="computedClass">
<slot>
{{ name }}
</slot>
</component>
</template>

<script setup lang="ts">
import {computed} from "vue";
interface Props {
name?: string;
tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p';
type?: 'title' | 'subtitle';
}
const props = withDefaults(defineProps<Props>(), {
type: 'title',
tag: 'h1'
});
const computedClass = computed(() => ({
'font-semibold dark:text-gray-200 mb-3': true,
'text-2xl md:text-4xl': props.type === 'title',
'text-xl md:text-2xl': props.type === 'subtitle'
}));
</script>
27 changes: 0 additions & 27 deletions src/components/lib/PrognoPageTitle.vue

This file was deleted.

4 changes: 2 additions & 2 deletions src/pages/admin/AdminDashboard.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div id="adminPage" class="box">
<PrognoPageTitle class="mb-5" name="Administración de PrognoSports" />
<PTitle class="mb-5" name="Administración de PrognoSports" />

<div class="flex flex-wrap justify-between -mx-2 mb-8">
<article class="w-full md:w-1/2 p-4">
Expand Down Expand Up @@ -96,5 +96,5 @@
</template>

<script setup lang="ts">
import PrognoPageTitle from "@/components/lib/PrognoPageTitle.vue";
import PTitle from "@/components/lib/PTitle.vue";
</script>
6 changes: 3 additions & 3 deletions src/pages/admin/circuits/CircuitsDashboard.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div id="adminDrivers" class="box">
<PrognoPageTitle class="mb-5" name="Administración de circuitos"/>
<PTitle class="mb-5" name="Administración de circuitos"/>

<p-button class="mb-4" label="Nuevo circuito" color="info" to="/admin/circuits/create" />

Expand Down Expand Up @@ -31,7 +31,7 @@
</template>

<script lang="ts">
import PrognoPageTitle from "@/components/lib/PrognoPageTitle.vue";
import PTitle from "@/components/lib/PTitle.vue";
import AlertNoPermission from "@/components/lib/AlertNoPermission.vue";
import {circuitService, notificationService} from "@/_services";
Expand All @@ -49,7 +49,7 @@ export default defineComponent({
PrognoModal,
PTable,
AlertNoPermission,
PrognoPageTitle,
PTitle,
},
setup() {
const authStore = useAuthStore();
Expand Down
4 changes: 2 additions & 2 deletions src/pages/admin/circuits/CreateCircuit.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div id="createCircuit" class="box">
<PrognoPageTitle class="mb-5" name="Crear circuito" />
<PTitle class="mb-5" name="Crear circuito" />

<p-input label="Nombre del circuito" name="name" v-model="rawCircuit.name"/>
<p-input label="Localidad del circuito" name="locality" v-model="rawCircuit.locality"/>
Expand All @@ -15,7 +15,7 @@
</template>

<script setup lang="ts">
import PrognoPageTitle from "@/components/lib/PrognoPageTitle.vue";
import PTitle from "@/components/lib/PTitle.vue";
import {circuitService, notificationService} from "@/_services";
import {reactive} from "vue";
Expand Down
4 changes: 2 additions & 2 deletions src/pages/admin/circuits/EditCircuit.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div id="adminDrivers" class="box">
<PrognoPageTitle class="mb-5" name="Administración de circuitos"/>
<PTitle class="mb-5" name="Administración de circuitos"/>

<loading v-if="isLoading"/>
<template v-else>
Expand Down Expand Up @@ -53,7 +53,7 @@
</template>

<script setup lang="ts">
import PrognoPageTitle from "@/components/lib/PrognoPageTitle.vue";
import PTitle from "@/components/lib/PTitle.vue";
import {circuitService, notificationService} from "@/_services";
import {onMounted, ref} from "vue";
Expand Down
6 changes: 3 additions & 3 deletions src/pages/admin/competitions/CompetitionsDashboard.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div id="adminDrivers" class="box">
<PrognoPageTitle class="mb-5" name="Administración de competiciones"/>
<PTitle class="mb-5" name="Administración de competiciones"/>

<div class="block">
<o-button variant="link" :to="{name: 'competitionCreate'}" tag="router-link">Nueva competición</o-button>
Expand Down Expand Up @@ -71,7 +71,7 @@
</template>

<script lang="ts">
import PrognoPageTitle from "@/components/lib/PrognoPageTitle.vue";
import PTitle from "@/components/lib/PTitle.vue";
import AlertNoPermission from "@/components/lib/AlertNoPermission.vue";
import {competitionService, notificationService} from "@/_services";
import {Competition} from "@/types/Competition";
Expand All @@ -85,7 +85,7 @@ export default defineComponent({
components: {
PrognoModal,
AlertNoPermission,
PrognoPageTitle,
PTitle,
},
setup() {
const authStore = useAuthStore();
Expand Down
6 changes: 3 additions & 3 deletions src/pages/admin/competitions/CreateCompetition.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div id="createCompetition" class="box">
<PrognoPageTitle class="mb-5" name="Crear competición"/>
<PTitle class="mb-5" name="Crear competición"/>

<o-steps v-model="activeStep">
<o-step-item step="1" label="Datos de la competición">
Expand Down Expand Up @@ -59,7 +59,7 @@
</template>

<script lang="ts">
import PrognoPageTitle from "@/components/lib/PrognoPageTitle.vue";
import PTitle from "@/components/lib/PTitle.vue";
import {competitionService, notificationService} from "@/_services";
import AlertInvalidData from "@/components/lib/AlertInvalidData.vue";
import AlertNoPermission from "@/components/lib/AlertNoPermission.vue";
Expand All @@ -75,7 +75,7 @@ export default defineComponent({
components: {
AlertNoPermission,
AlertInvalidData,
PrognoPageTitle,
PTitle,
},
setup() {
const authStore = useAuthStore();
Expand Down
6 changes: 3 additions & 3 deletions src/pages/admin/competitions/EditCompetition.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div id="adminDrivers" class="box">
<PrognoPageTitle class="mb-5" name="Administración de competiciones"/>
<PTitle class="mb-5" name="Administración de competiciones"/>

<loading v-if="isLoading"/>
<template v-else>
Expand Down Expand Up @@ -62,7 +62,7 @@
</template>

<script lang="ts">
import PrognoPageTitle from "@/components/lib/PrognoPageTitle.vue";
import PTitle from "@/components/lib/PTitle.vue";
import AlertNoPermission from "@/components/lib/AlertNoPermission.vue";
import {competitionService, notificationService} from "@/_services";
import {Competition} from "@/types/Competition";
Expand All @@ -76,7 +76,7 @@ export default defineComponent({
name: "EditCompetition",
components: {
AlertNoPermission,
PrognoPageTitle,
PTitle,
},
setup() {
const authStore = useAuthStore();
Expand Down
4 changes: 2 additions & 2 deletions src/pages/admin/constructors/ConstructorsDashboard.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div id="adminConstructor" class="box">
<PrognoPageTitle class="mb-5" name="Administración de Constructores"/>
<PTitle class="mb-5" name="Administración de Constructores"/>


<p-button class="mb-4" label="Nuevo constructor" color="info" to="/admin/constructors/create" />
Expand Down Expand Up @@ -31,7 +31,7 @@
</template>

<script setup lang="ts">
import PrognoPageTitle from "@/components/lib/PrognoPageTitle.vue";
import PTitle from "@/components/lib/PTitle.vue";
import {constructorService, notificationService} from "@/_services";
import {Constructor} from "@/types/Constructor";
import PButton from "@/components/lib/forms/PButton.vue";
Expand Down
4 changes: 2 additions & 2 deletions src/pages/admin/constructors/CreateConstructor.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div id="createConstructor" class="box">
<PrognoPageTitle class="mb-5" name="Crear constructor"/>
<PTitle class="mb-5" name="Crear constructor"/>

<PInput label="Nombre del constructor" name="name" v-model="name" />

Expand All @@ -11,7 +11,7 @@

<script setup lang="ts">
import PrognoPageTitle from "@/components/lib/PrognoPageTitle.vue";
import PTitle from "@/components/lib/PTitle.vue";
import PInput from "@/components/lib/forms/PInput.vue";
import PButton from "@/components/lib/forms/PButton.vue";
import {ref} from "vue";
Expand Down
4 changes: 2 additions & 2 deletions src/pages/admin/constructors/EditConstructor.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<loading v-if="isLoading"/>
<div v-if="constructor.id" id="editConstrcutor" class="box">
<PrognoPageTitle class="mb-5" name="Editar constructor"/>
<PTitle class="mb-5" name="Editar constructor"/>

<PInput label="Nombre del constructor" name="name" v-model="constructor.name" />

Expand All @@ -14,7 +14,7 @@

<script setup lang="ts">
import PrognoPageTitle from "@/components/lib/PrognoPageTitle.vue";
import PTitle from "@/components/lib/PTitle.vue";
import PInput from "@/components/lib/forms/PInput.vue";
import PButton from "@/components/lib/forms/PButton.vue";
import {onMounted, ref} from "vue";
Expand Down
6 changes: 3 additions & 3 deletions src/pages/admin/drivers/CreateDriver.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div id="createDriver" class="box">
<PrognoPageTitle class="mb-5" name="Crear piloto" />
<PTitle class="mb-5" name="Crear piloto" />

<o-steps v-model="activeStep">
<o-step-item step="1" label="Datos del piloto">
Expand Down Expand Up @@ -72,7 +72,7 @@
</template>

<script lang="ts">
import PrognoPageTitle from "@/components/lib/PrognoPageTitle.vue";
import PTitle from "@/components/lib/PTitle.vue";
import {driversService, notificationService} from "@/_services";
import AlertInvalidData from "@/components/lib/AlertInvalidData.vue";
import AlertNoPermission from "@/components/lib/AlertNoPermission.vue";
Expand All @@ -88,7 +88,7 @@ export default defineComponent({
components: {
AlertNoPermission,
AlertInvalidData,
PrognoPageTitle,
PTitle,
},
setup() {
const dayjs = useDayjs();
Expand Down
6 changes: 3 additions & 3 deletions src/pages/admin/drivers/DriversDashboard.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div id="adminDrivers" class="box">
<PrognoPageTitle class="mb-5" name="Administración de pilotos"/>
<PTitle class="mb-5" name="Administración de pilotos"/>

<div class="block">
<o-button variant="link" :to="{name: 'driverCreate'}" tag="router-link">Nuevo piloto</o-button>
Expand Down Expand Up @@ -69,7 +69,7 @@
</template>

<script lang="ts">
import PrognoPageTitle from "@/components/lib/PrognoPageTitle.vue";
import PTitle from "@/components/lib/PTitle.vue";
import AlertNoPermission from "@/components/lib/AlertNoPermission.vue";
import {Driver} from "@/types/Driver";
import {driversService} from "@/_services";
Expand All @@ -82,7 +82,7 @@ export default defineComponent({
name: "DriversDashboard",
components: {
AlertNoPermission,
PrognoPageTitle,
PTitle,
},
setup() {
const dayjs = useDayjs();
Expand Down
6 changes: 3 additions & 3 deletions src/pages/admin/gps/CreateGrandPrix.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div id="createGrandPrix" class="box">
<PrognoPageTitle class="mb-5" name="Crear gran premio"/>
<PTitle class="mb-5" name="Crear gran premio"/>

<o-button variant="primary" :to="{name: 'adminGps'}" tag="router-link" class="mr-2">Volver a lista de Grandes Premios</o-button>

Expand Down Expand Up @@ -45,7 +45,7 @@
</template>

<script lang="ts">
import PrognoPageTitle from "@/components/lib/PrognoPageTitle.vue"
import PTitle from "@/components/lib/PTitle.vue"
import {circuitService, grandPrixService, notificationService, seasonService} from "@/_services";
import AlertInvalidData from "@/components/lib/AlertInvalidData.vue";
import AlertNoPermission from "@/components/lib/AlertNoPermission.vue";
Expand All @@ -61,7 +61,7 @@ export default defineComponent({
components: {
AlertNoPermission,
AlertInvalidData,
PrognoPageTitle,
PTitle,
},
setup() {
const authStore = useAuthStore();
Expand Down
6 changes: 3 additions & 3 deletions src/pages/admin/gps/EditGrandPrix.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<loading v-if="isLoadingGrandPrix"/>
<template v-else>

<PrognoPageTitle :name="'Administración de ' + grandPrix.name"/>
<PTitle :name="'Administración de ' + grandPrix.name"/>

<div class="block">
<o-button variant="link" to="/admin/gps" tag="router-link">Lista de grandes premios</o-button>
Expand Down Expand Up @@ -40,7 +40,7 @@
</template>

<script lang="ts">
import PrognoPageTitle from "@/components/lib/PrognoPageTitle.vue";
import PTitle from "@/components/lib/PTitle.vue";
import {grandPrixService, notificationService} from "@/_services";
import {GrandPrix} from "@/types/GrandPrix";
Expand All @@ -52,7 +52,7 @@ export default defineComponent({
name: "EditGrandPrix",
components: {
DriversInGrandPrix,
PrognoPageTitle,
PTitle,
},
setup() {
const authStore = useAuthStore();
Expand Down
6 changes: 3 additions & 3 deletions src/pages/admin/gps/GrandPrixDashboard.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div id="adminGps" class="box">
<PrognoPageTitle class="mb-5" name="Administración de Grandes Premios" />
<PTitle class="mb-5" name="Administración de Grandes Premios" />

<nav class="block is-flex is-justify-content-space-between">
<p class="control">
Expand Down Expand Up @@ -69,7 +69,7 @@
</template>

<script lang="ts">
import PrognoPageTitle from "@/components/lib/PrognoPageTitle.vue";
import PTitle from "@/components/lib/PTitle.vue";
import AlertNoPermission from "@/components/lib/AlertNoPermission.vue";
import PrognoModal from "@/components/lib/PrognoModal.vue";
import {grandPrixService, notificationService, seasonService} from "@/_services";
Expand All @@ -85,7 +85,7 @@ export default defineComponent({
components: {
PrognoModal,
AlertNoPermission,
PrognoPageTitle,
PTitle,
},
setup() {
const authStore = useAuthStore();
Expand Down
Loading

0 comments on commit 6abfe29

Please sign in to comment.