Skip to content

Commit

Permalink
Merge pull request #154 from traPtitech/fix/move_use_to_lib
Browse files Browse the repository at this point in the history
use内のものをlibへ移動
  • Loading branch information
mehm8128 authored Jan 8, 2024
2 parents 9b1eed2 + 21b5b89 commit 488c49a
Show file tree
Hide file tree
Showing 20 changed files with 38 additions and 78 deletions.
36 changes: 13 additions & 23 deletions src/components/Index/PageInfoPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,20 @@
</router-link>
</li>
</template>
<script lang="ts">
import { defineComponent, toRef } from 'vue'

<script lang="ts" setup>
import { toRef } from 'vue'
import Icon from '/@/components/UI/Icon.vue'
import useRouteInfo from '/@/use/routeInfo'
export default defineComponent({
name: 'PageInfoPanel',
components: {
Icon
},
props: {
name: {
type: String,
required: true
},
path: {
type: String,
required: true
}
},
setup(props) {
const routeInfo = useRouteInfo(toRef(props, 'name'))
return { routeInfo }
}
})
import useRouteInfo from '/@/lib/routeInfo'
interface Props {
name: string
path: string
}
const props = defineProps<Props>()
const routeInfo = useRouteInfo(toRef(props.name))
</script>

<style lang="scss" module>
Expand Down
22 changes: 7 additions & 15 deletions src/components/Index/PageInfoPanels.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<script lang="ts" setup>
import PageInfoPanel from '/@/components/Index/PageInfoPanel.vue'
import { routes } from '/@/lib/routeInfo'
const pages = routes.filter(route => route.name != 'Top')
</script>

<template>
<ul :class="$style.list">
<page-info-panel
Expand All @@ -9,21 +16,6 @@
</ul>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import PageInfoPanel from '/@/components/Index/PageInfoPanel.vue'
import { routes } from '/@/use/routeInfo'
export default defineComponent({
name: 'PageInfoPanels',
components: { PageInfoPanel },
setup() {
const pages = routes.filter(route => route.name != 'Top')
return { pages }
}
})
</script>

<style lang="scss" module>
.list {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion src/components/NavigationBar/NavigationLinks.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts" setup>
import NavigationLinksItem from './NavigationLinksItem.vue'
import { routes } from '/@/use/routeInfo'
import { routes } from '/@/lib/routeInfo'
</script>

<template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/NavigationBar/NavigationLinksItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { computed, toRef } from 'vue'
import { useRoute } from 'vue-router'
import Icon from '/@/components/UI/Icon.vue'
import useRouteInfo from '/@/use/routeInfo'
import useRouteInfo from '/@/lib/routeInfo'
interface Props {
name: string
Expand Down
2 changes: 1 addition & 1 deletion src/components/UI/FormInput.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import { computed } from 'vue'
import Icon from '/@/components/UI/Icon.vue'
import { isValidUrl } from '/@/use/validate'
import { isValidUrl } from '/@/lib/validate'
interface Props {
modelValue: string
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/pages/Contest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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 '/@/use/param'
import useParam from '/@/lib/param'
import ContestTeamsComponent from '/@/components/Contest/ContestTeams.vue'
const contestId = useParam('contestId')
Expand Down
4 changes: 2 additions & 2 deletions src/pages/ContestEdit.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 apis, { EditContestRequest } from '/@/lib/apis'
import type { ContestDetail } from '/@/lib/apis'
import { RouterLink, useRouter } from 'vue-router'
import useParam from '/@/use/param'
import useParam from '/@/lib/param'
import FormTextArea from '/@/components/UI/FormTextArea.vue'
import FormInput from '/@/components/UI/FormInput.vue'
import { computed, ref } from 'vue'
Expand All @@ -16,7 +16,7 @@ import {
isValidDuration,
isValidLength,
isValidOptionalUrl
} from '/@/use/validate'
} from '/@/lib/validate'
import useModal from '/@/components/UI/composables/useModal'
import ConfirmModal from '/@/components/UI/ConfirmModal.vue'
import { useContestStore } from '/@/store/contest'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ContestNew.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import LabeledForm from '/@/components/Form/LabeledForm.vue'
import FormInput from '/@/components/UI/FormInput.vue'
import FormTextArea from '/@/components/UI/FormTextArea.vue'
import FormDuration from '/@/components/UI/FormDuration.vue'
import { isValidDuration, isValidLength, isValidOptionalUrl} from '/@/use/validate'
import { isValidDuration, isValidLength, isValidOptionalUrl} from '/@/lib/validate'
import { useToast } from 'vue-toastification'
import { useContestStore } from '/@/store/contest'
Expand Down
4 changes: 2 additions & 2 deletions src/pages/ContestTeamEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ 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 useParam from '/@/use/param'
import useParam from '/@/lib/param'
import MemberInput from '/@/components/UI/MemberInput.vue'
import FormTextArea from '/@/components/UI/FormTextArea.vue'
import FormInput from '/@/components/UI/FormInput.vue'
import { computed, ref } from 'vue'
import LabeledForm from '/@/components/Form/LabeledForm.vue'
import DeleteForm from '/@/components/Form/DeleteForm.vue'
import { isValidLength, isValidOptionalUrl } from '/@/use/validate'
import { isValidLength, isValidOptionalUrl } from '/@/lib/validate'
import useModal from '/@/components/UI/composables/useModal'
import ConfirmModal from '/@/components/UI/ConfirmModal.vue'
import { useToast } from 'vue-toastification'
Expand Down
4 changes: 2 additions & 2 deletions src/pages/ContestTeamNew.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ 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 useParam from '/@/use/param'
import useParam from '/@/lib/param'
import MemberInput from '/@/components/UI/MemberInput.vue'
import FormTextArea from '/@/components/UI/FormTextArea.vue'
import FormInput from '/@/components/UI/FormInput.vue'
import { computed, ref } from 'vue'
import LabeledForm from '/@/components/Form/LabeledForm.vue'
import { isValidLength, isValidOptionalUrl } from '/@/use/validate'
import { isValidLength, isValidOptionalUrl } from '/@/lib/validate'
import { useToast } from 'vue-toastification'
import { useUserStore } from '/@/store/user'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Event.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import EventHostItem from '/@/components/Event/EventHostItem.vue'
import apis, { EditEventRequest, EventDetail } from '/@/lib/apis'
import { RouterLink, useRouter } from 'vue-router'
import { getDisplayDuration } from '/@/lib/date'
import useParam from '/@/use/param'
import useParam from '/@/lib/param'
import { ref } from 'vue'
import { useToast } from 'vue-toastification'
import RadioButton from '/@/components/UI/RadioButton.vue'
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Project.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 apis, { ProjectMember as ProjectMemberType } from '/@/lib/apis'
import type { EditProjectRequest, ProjectDetail } from '/@/lib/apis'
import { RouterLink, useRouter } from 'vue-router'
import useParam from '/@/use/param'
import useParam from '/@/lib/param'
import FormTextArea from '/@/components/UI/FormTextArea.vue'
import FormInput from '/@/components/UI/FormInput.vue'
import { computed, ref } from 'vue'
Expand All @@ -15,7 +15,7 @@ import {
isValidLength,
isValidOptionalUrl,
isValidYearWithSemesterDuration
} from '/@/use/validate'
} from '/@/lib/validate'
import { useToast } from 'vue-toastification'
import FormProjectDuration from '/@/components/UI/FormProjectDuration.vue'
import { useProjectStore } from '/@/store/project'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ProjectNew.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
isValidLength,
isValidOptionalUrl,
isValidYearWithSemesterDuration
} from '/@/use/validate'
} from '/@/lib/validate'
import { useProjectStore } from '/@/store/project'
const toast = useToast()
Expand Down
4 changes: 2 additions & 2 deletions src/pages/UserAccountEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { computed, ref } from 'vue'
import LabeledForm from '/@/components/Form/LabeledForm.vue'
import FormInput from '/@/components/UI/FormInput.vue'
import ToggleSwitch from '/@/components/UI/ToggleSwitch.vue'
import useParam from '/@/use/param'
import useParam from '/@/lib/param'
import ServiceAccordion from '/@/components/UI/ServiceAccordion.vue'
import DeleteForm from '/@/components/Form/DeleteForm.vue'
import { hasIdService, hasAtmarkService } from '/@/consts/services'
import { isValidLength, isValidUrl } from '/@/use/validate'
import { isValidLength, isValidUrl } from '/@/lib/validate'
import useModal from '/@/components/UI/composables/useModal'
import ConfirmModal from '/@/components/UI/ConfirmModal.vue'
import { useToast } from 'vue-toastification'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/UserAccountNew.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import FormInput from '/@/components/UI/FormInput.vue'
import ToggleSwitch from '/@/components/UI/ToggleSwitch.vue'
import ServiceAccordion from '/@/components/UI/ServiceAccordion.vue'
import { hasAtmarkService, hasIdService } from '/@/consts/services'
import { isValidLength, isValidUrl } from '/@/use/validate'
import { isValidLength, isValidUrl } from '/@/lib/validate'
import { useToast } from 'vue-toastification'
const router = useRouter()
Expand Down
22 changes: 0 additions & 22 deletions src/use/fetcher.ts

This file was deleted.

0 comments on commit 488c49a

Please sign in to comment.