Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contestの詳細ページの作成 #51

Merged
merged 13 commits into from
Mar 28, 2023
Merged

Contestの詳細ページの作成 #51

merged 13 commits into from
Mar 28, 2023

Conversation

mehm8128
Copy link
Contributor

@mehm8128 mehm8128 commented Dec 30, 2022

close #9

useFetcherが上手く動かなかったのでuseUserDataFetcherに寄せて修正しました

@mehm8128 mehm8128 self-assigned this Dec 30, 2022
@mehm8128 mehm8128 marked this pull request as ready for review December 31, 2022 07:07
Copy link
Member

@tesso57 tesso57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

色々書きました 🙏

レビュー放置してごめん !

Comment on lines 58 to 63
<section :class="$style.section">
<h2 :class="$style.h2">リンク</h2>
<p :class="$style.content">
<a :href="contest.link">{{ contest.link }}</a>
</p>
</section>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.figma.com/file/BVnhB2JyTjKsGKdnAJDksb/traPortfolio?node-id=835%3A1018&t=svHVjSubEOdWX7bz-4

後出しでごめんなんだけど、リンクの部分のデザインを少し調整したのでお願いします。:pray:
image

import { RouterLink } from 'vue-router'
import { getDisplayDuration } from '/@/lib/date'
import useParam from '/@/use/param'
import useFetcher from '/@/use/fetcher'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exportしてる関数名と違って分かりづらいので、useDataFecher のほうがいいかも

import ContestTeamsComponent from '/@/components/Contest/ContestTeams.vue'

const contestId = useParam('id')
const { data: contest } = useFetcher<ContestDetail>(contestId, () =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こんな感じに書いてもいいかも? fetcherState 使ってなさそうなので

const contest = ref<ContestDetail>()
 watchEffect(async () => {
      contest.value = (await apis.getContest(contestId.value)).data
    })

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetcherStateを使うことにしました

@@ -1,39 +1,25 @@
import { ref, Ref } from 'vue'
import { AxiosResponse } from 'axios'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetcher.tsは traPortfolio-UIから移植するときにコピーされたもので、Vuexの状態変化にしか使ってなさそうなので、元々のfetcher.tsなくてもいいかも。
userDataFetcher.tsとほとんど同じだから、userDataFetcher.tsの役割をこいつに寄せて大丈夫な感じがする。

Dashboard では、こいつを fetcher という名前で 運用しても悪くない感じがした。

@mehm8128 mehm8128 requested a review from tesso57 January 17, 2023 06:45
Copy link
Member

@tesso57 tesso57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

たのんだー

Comment on lines 62 to 64
.header {
margin: 4rem 0 2rem;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使ってなさそう

}
.h2 {
font-weight: bold;
font-size: 20px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

font-size : 1.25rem; がいいなー

Comment on lines 74 to 79
<contest-teams-component
v-if="contestTeams !== undefined"
:class="$style.content"
:contest-id="contestId"
:contest-teams="contestTeams"
@input="searchContestTeams($event)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

絞り込んだあとのチームを表示する責任があるのは、ContestTeams.vueだから、ContestTeams.vueに、絞り込む機能を実装したほうがもっとスッキリかけそう。

Contest.vueでは、全チームをpropsを通して ContestTeams.vueに流し込むだけで、 ContestTeams.vueでは、searchQueryを利用していい感じに絞り込むとかかな 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

サーバーで検索機能実装してもらえたら@input時にContest.vuesearchQueryを使ってContestTeamsをfetchしたいので、それを踏まえてContest.vueに書きました
検索機能をどっちで実装するかportfolioのチャンネルで相談してみます

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

そしたら、ContestTeamが検索するたびに表示されるチームが減るので、いい感じに動くようにしてほしい!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ほんとですね...
サーバーで検索機能ができるまでは上で言われたように、ContestTeams.vue側で検索機能を実装することにしました

@@ -6,13 +6,14 @@ import BaseButton from '/@/components/UI/BaseButton.vue'
import AccountItem from '/@/components/UserAccounts/AccountItem.vue'
import { ref } from 'vue'
import apis from '/@/lib/apis'
import useUserDataFetcher from '/@/use/userDataFetcher'
import { RouterLink } from 'vue-router'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:kansya:

Copy link
Member

@tesso57 tesso57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

よさそうです。

@mehm8128 mehm8128 merged commit b05489e into main Mar 28, 2023
@mehm8128 mehm8128 deleted the feat/contest_detail_page branch March 28, 2023 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

/contest/:contestId
2 participants