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

feat/申請詳細ページのファイル周り #296

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 79 additions & 3 deletions src/components/requestDetail/RequestContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,41 @@ const handleUpdateContent = async () => {
}
isEditMode.value = false
}

const files = [
{
name: 'oisu-.png',
url: 'https://images.unsplash.com/photo-1554629947-334ff61d85dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1024&h=1280&q=80',
alt: 'tailwind sample'
},
{
name: 'oisu-.png',
url: 'https://images.unsplash.com/photo-1554629947-334ff61d85dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1024&h=1280&q=80',
alt: 'tailwind sample'
},
{
name: 'oisu-.png',
url: 'https://images.unsplash.com/photo-1554629947-334ff61d85dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1024&h=1280&q=80',
alt: 'tailwind sample'
},
{
name: 'oisu-.png',
url: 'https://images.unsplash.com/photo-1554629947-334ff61d85dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1024&h=1280&q=80',
alt: 'tailwind sample'
},
{
name: 'oisu-.png',
url: 'https://images.unsplash.com/photo-1554629947-334ff61d85dc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1024&h=1280&q=80',
alt: 'tailwind sample'
}
]
const handleFileUpload = async () => {
try {
toast.success('ファイルを追加しました')
} catch {
toast.error('ファイルの追加に失敗しました')
}
}
</script>

<template>
Expand All @@ -69,10 +104,51 @@ const handleUpdateContent = async () => {
</time>
</div>
<div class="ml-16 flex items-start gap-2">
<MarkdownIt
<div
v-if="!isEditMode"
class="border border-surface-secondary px-4 py-3 rounded-lg flex-1"
:text="request.content" />
class="border border-surface-secondary px-4 py-3 rounded-lg flex-1 w-full">
<MarkdownIt :text="request.content" />
<div class="m-3 overflow-auto">
<div class="flex gap-3">
<div v-for="file in files" :key="file.name">
<div
class="bg-surface-secondary w-32 overflow-hidden rounded"
:model-value="file.name">
<img
:alt="file.alt"
class="object-cover h-36 w-full"
:src="file.url" />
</div>
<p class="mt-2 text-center">{{ file.name }}</p>
</div>
</div>
<div class="flex gap-3 mt-3">
<div v-for="file in files" :key="file.name">
<div
class="bg-surface-secondary w-96 overflow-hidden rounded"
:model-value="file.name">
<img
:alt="file.alt"
class="object-cover h-60 w-full"
:src="file.url" />
</div>
<p class="mt-2">{{ file.name }}</p>
</div>
</div>
</div>
<div class="flex justify-end">
<label
class="flex items-center rounded-md border py-2 px-4 hover:bg-hover-primary border-surface-secondary cursor-pointer"
for="file_upload">
添付ファイルを追加
<input
id="file_upload"
class="hidden"
type="file"
@change="handleFileUpload" />
</label>
</div>
</div>
<MarkdownTextarea
v-else
v-model="editedContent"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/RequestDetailPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if (!isTagFetched.value) {
<RequestHeader :request="request" />
<div class="h-px bg-[#e5e7eb]" />
<div class="flex justify-between gap-20">
<RequestLogs class="basis-2/3" :request="request" />
<RequestLogs class="basis-2/3 max-w-[75%]" :request="request" />
<RequestSidebar class="basis-1/3" :request="request" />
</div>
</div>
Expand Down
Loading