Skip to content

Commit

Permalink
該当箇所をto属性つきBaseButtonに変更
Browse files Browse the repository at this point in the history
  • Loading branch information
ogu-kazemiya committed Aug 23, 2024
1 parent ae4fc8c commit 9c50790
Show file tree
Hide file tree
Showing 16 changed files with 113 additions and 203 deletions.
19 changes: 6 additions & 13 deletions src/components/Contest/ContestTeams.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import BaseButton from '/@/components/UI/BaseButton.vue'
import FormInput from '/@/components/UI/FormInput.vue'
import ContestTeamItem from '/@/components/Contest/ContestTeamItem.vue'
import { RouterLink } from 'vue-router'
import { ContestTeam } from '/@/lib/apis'
import { computed, ref } from 'vue'
import { searchListCaseInsensitive } from '/@/lib/search'
Expand All @@ -30,14 +29,12 @@ const filteredContestTeams = computed(() =>
icon="magnify"
/>
</div>
<div>
<router-link
:to="{ name: 'ContestTeamNew', params: { contestId: contestId } }"
:class="$style.link"
>
<base-button type="primary" icon="mdi:plus">New</base-button>
</router-link>
</div>
<base-button
:to="{ name: 'ContestTeamNew', params: { contestId: contestId } }"
type="primary"
icon="mdi:plus"
>New</base-button
>
</div>
<ul :class="$style.teamList">
<li v-for="contestTeam in filteredContestTeams" :key="contestTeam.id">
Expand All @@ -60,10 +57,6 @@ const filteredContestTeams = computed(() =>
.searchForm {
flex-grow: 1;
}
.link {
text-decoration: none;
color: inherit;
}
.teamList {
list-style: none;
padding: 0.5rem 0;
Expand Down
11 changes: 3 additions & 8 deletions src/components/User/UserProfileDesktop.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup lang="ts">
import { RouterLink } from 'vue-router'
import BaseButton from '/@/components/UI/BaseButton.vue'
import UserIcon from '/@/components/UI/UserIcon.vue'
import UserAccounts from '/@/components/User/UserAccounts.vue'
Expand All @@ -22,9 +21,9 @@ defineProps<Props>()
</div>
<div :class="$style.accounts">
<user-accounts :accounts="user.accounts" />
<router-link :to="{ name: 'UserAccounts' }" :class="$style.link">
<base-button icon="mdi:account">Edit</base-button>
</router-link>
<base-button :to="{ name: 'UserAccounts' }" icon="mdi:account"
>Edit</base-button
>
</div>
</div>
</div>
Expand Down Expand Up @@ -56,8 +55,4 @@ defineProps<Props>()
gap: 2rem;
margin-top: 1rem;
}
.link {
text-decoration: none;
color: inherit;
}
</style>
11 changes: 3 additions & 8 deletions src/components/User/UserProfileMobile.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup lang="ts">
import { RouterLink } from 'vue-router'
import BaseButton from '/@/components/UI/BaseButton.vue'
import UserIcon from '/@/components/UI/UserIcon.vue'
import UserAccounts from '/@/components/User/UserAccounts.vue'
Expand All @@ -23,9 +22,9 @@ defineProps<Props>()
</div>
<div :class="$style.accounts">
<user-accounts :accounts="user.accounts" />
<router-link :to="{ name: 'UserAccounts' }" :class="$style.link">
<base-button icon="mdi:account">Edit</base-button>
</router-link>
<base-button :to="{ name: 'UserAccounts' }" icon="mdi:account"
>Edit</base-button
>
</div>
</div>
</template>
Expand Down Expand Up @@ -57,8 +56,4 @@ defineProps<Props>()
gap: 2rem;
margin-top: 1rem;
}
.link {
text-decoration: none;
color: inherit;
}
</style>
30 changes: 12 additions & 18 deletions src/pages/Contest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import PageContainer from '/@/components/Layout/PageContainer.vue'
import BaseButton from '/@/components/UI/BaseButton.vue'
import apis, { ContestDetail, ContestTeam } from '/@/lib/apis'
import { RouterLink } from 'vue-router'
import { getDisplayDuration } from '/@/lib/date'
import Icon from '/@/components/UI/Icon.vue'
import useParam from '/@/lib/param'
Expand All @@ -31,12 +30,12 @@ const contestTeams: ContestTeam[] = (
detail="コンテストの詳細です。"
:class="$style.header"
/>
<router-link
<base-button
:to="{ name: 'ContestEdit', params: { contestId: contestId } }"
:class="$style.link"
type="primary"
icon="mdi:pencil"
>Edit</base-button
>
<base-button type="primary" icon="mdi:pencil">Edit</base-button>
</router-link>
</div>
<div>
<section :class="$style.section">
Expand Down Expand Up @@ -73,15 +72,14 @@ const contestTeams: ContestTeam[] = (
</section>
</div>

<router-link :to="{ name: 'Contests' }" :class="$style.link">
<base-button
:class="$style.backButton"
type="secondary"
icon="mdi:arrow-left"
>
Back
</base-button>
</router-link>
<base-button
:to="{ name: 'Contests' }"
:class="$style.backButton"
type="secondary"
icon="mdi:arrow-left"
>
Back
</base-button>
</page-container>
</template>

Expand All @@ -94,10 +92,6 @@ const contestTeams: ContestTeam[] = (
.header {
margin-bottom: 2rem;
}
.link {
text-decoration: none;
color: inherit;
}
.section {
margin-bottom: 2rem;
}
Expand Down
21 changes: 6 additions & 15 deletions src/pages/ContestEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PageContainer from '/@/components/Layout/PageContainer.vue'
import BaseButton from '/@/components/UI/BaseButton.vue'
import apis, { EditContestRequest } from '/@/lib/apis'
import type { ContestDetail } from '/@/lib/apis'
import { RouterLink, useRouter } from 'vue-router'
import { useRouter } from 'vue-router'
import useParam from '/@/lib/param'
import FormTextArea from '/@/components/UI/FormTextArea.vue'
import FormInput from '/@/components/UI/FormInput.vue'
Expand Down Expand Up @@ -131,18 +131,13 @@ const deleteContest = async () => {
<delete-form target="コンテスト" @delete="open" />

<div :class="$style.buttonContainer">
<router-link
<base-button
:to="{ name: 'Contest', params: { contestId: contestId } }"
:class="$style.link"
:class="$style.backButton"
type="secondary"
icon="mdi:arrow-left"
>Back</base-button
>
<base-button
:class="$style.backButton"
type="secondary"
icon="mdi:arrow-left"
>
Back
</base-button>
</router-link>
<base-button
:is-disabled="!canSubmit"
type="primary"
Expand Down Expand Up @@ -176,10 +171,6 @@ const deleteContest = async () => {
.labeledForm {
margin-bottom: 2rem;
}
.link {
text-decoration: none;
color: inherit;
}
.buttonContainer {
display: flex;
justify-content: space-between;
Expand Down
22 changes: 8 additions & 14 deletions src/pages/ContestNew.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ContentHeader from '/@/components/Layout/ContentHeader.vue'
import PageContainer from '/@/components/Layout/PageContainer.vue'
import BaseButton from '/@/components/UI/BaseButton.vue'
import apis, { CreateContestRequest } from '/@/lib/apis'
import { RouterLink, useRouter } from 'vue-router'
import { useRouter } from 'vue-router'
import { computed, reactive, ref } from 'vue'
import LabeledForm from '/@/components/Form/LabeledForm.vue'
import FormInput from '/@/components/UI/FormInput.vue'
Expand Down Expand Up @@ -114,15 +114,13 @@ const createContest = async () => {
</labeled-form>
</form>
<div :class="$style.buttonContainer">
<router-link :to="{ name: 'Contests' }" :class="$style.link">
<base-button
:class="$style.backButton"
type="secondary"
icon="mdi:arrow-left"
>
Back
</base-button>
</router-link>
<base-button
:to="{ name: 'Contests' }"
:class="$style.backButton"
type="secondary"
icon="mdi:arrow-left"
>Back</base-button
>
<base-button
:is-disabled="!canSubmit"
type="primary"
Expand All @@ -147,10 +145,6 @@ const createContest = async () => {
.labeledForm {
margin-bottom: 2rem;
}
.link {
text-decoration: none;
color: inherit;
}
.buttonContainer {
display: flex;
justify-content: space-between;
Expand Down
14 changes: 5 additions & 9 deletions src/pages/ContestTeamEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PageContainer from '/@/components/Layout/PageContainer.vue'
import BaseButton from '/@/components/UI/BaseButton.vue'
import apis, { ContestTeamDetail, EditContestTeamRequest } from '/@/lib/apis'
import type { ContestDetail, User } from '/@/lib/apis'
import { RouterLink, useRouter } from 'vue-router'
import { useRouter } from 'vue-router'
import useParam from '/@/lib/param'
import MemberInput from '/@/components/UI/MemberInput.vue'
import FormTextArea from '/@/components/UI/FormTextArea.vue'
Expand Down Expand Up @@ -136,12 +136,12 @@ const deleteContestTeam = async () => {
<delete-form target="コンテストチーム" @delete="open" />

<div :class="$style.buttonContainer">
<router-link
<base-button
:to="{ name: 'Contest', params: { contestId: contestId } }"
:class="$style.link"
type="secondary"
icon="mdi:arrow-left"
>Back</base-button
>
<base-button type="secondary" icon="mdi:arrow-left">Back</base-button>
</router-link>
<base-button
:is-disabled="!canSubmit"
type="primary"
Expand Down Expand Up @@ -175,10 +175,6 @@ const deleteContestTeam = async () => {
.labeledForm {
margin-bottom: 2rem;
}
.link {
text-decoration: none;
color: inherit;
}
.buttonContainer {
display: flex;
justify-content: space-between;
Expand Down
14 changes: 5 additions & 9 deletions src/pages/ContestTeamNew.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PageContainer from '/@/components/Layout/PageContainer.vue'
import BaseButton from '/@/components/UI/BaseButton.vue'
import apis from '/@/lib/apis'
import type { AddContestTeamRequest, ContestDetail, User } from '/@/lib/apis'
import { RouterLink, useRouter } from 'vue-router'
import { useRouter } from 'vue-router'
import useParam from '/@/lib/param'
import MemberInput from '/@/components/UI/MemberInput.vue'
import FormTextArea from '/@/components/UI/FormTextArea.vue'
Expand Down Expand Up @@ -109,12 +109,12 @@ const createContestTeam = async () => {
</form>

<div :class="$style.buttonContainer">
<router-link
<base-button
:to="{ name: 'Contest', params: { contestId: contestId } }"
:class="$style.link"
type="secondary"
icon="mdi:arrow-left"
>Back</base-button
>
<base-button type="secondary" icon="mdi:arrow-left">Back</base-button>
</router-link>
<base-button
:is-disabled="!canSubmit"
type="primary"
Expand All @@ -139,10 +139,6 @@ const createContestTeam = async () => {
.labeledForm {
margin-bottom: 2rem;
}
.link {
text-decoration: none;
color: inherit;
}
.buttonContainer {
display: flex;
justify-content: space-between;
Expand Down
15 changes: 6 additions & 9 deletions src/pages/Contests.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts" setup>
import { computed, ref } from 'vue'
import { RouterLink } from 'vue-router'
import { useContestStore } from '/@/store/contest'
Expand Down Expand Up @@ -37,9 +36,12 @@ const filteredContests = computed(() =>
/>
</div>
<div>
<router-link :to="{ name: 'ContestNew' }" :class="$style.link">
<base-button type="primary" icon="mdi:trophy">New</base-button>
</router-link>
<base-button
:to="{ name: 'ContestNew' }"
type="primary"
icon="mdi:trophy"
>New</base-button
>
</div>
</div>
<ul :class="$style.contestList">
Expand All @@ -66,11 +68,6 @@ const filteredContests = computed(() =>
flex-grow: 1;
}
.link {
text-decoration: none;
color: inherit;
}
.contestList {
list-style: none;
li {
Expand Down
22 changes: 8 additions & 14 deletions src/pages/Event.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import BaseButton from '/@/components/UI/BaseButton.vue'
import EventHostItem from '/@/components/Event/EventHostItem.vue'
import apis, { EditEventRequest, EventDetail } from '/@/lib/apis'
import { RouterLink, useRouter } from 'vue-router'
import { useRouter } from 'vue-router'
import { getDisplayDuration } from '/@/lib/date'
import useParam from '/@/lib/param'
import { ref } from 'vue'
Expand Down Expand Up @@ -115,15 +115,13 @@ const updateEvent = async () => {
</div>

<div :class="$style.buttonContainer">
<router-link :to="{ name: 'Events' }" :class="$style.link">
<base-button
:class="$style.backButton"
type="secondary"
icon="mdi:arrow-left"
>
Back
</base-button>
</router-link>
<base-button
:to="{ name: 'Events' }"
:class="$style.backButton"
type="secondary"
icon="mdi:arrow-left"
>Back</base-button
>
<base-button
:is-disabled="isSending"
type="primary"
Expand All @@ -145,10 +143,6 @@ const updateEvent = async () => {
.header {
margin-bottom: 2rem;
}
.link {
text-decoration: none;
color: inherit;
}
.section {
margin-bottom: 2rem;
}
Expand Down
Loading

0 comments on commit 9c50790

Please sign in to comment.