Skip to content

Commit af33bd3

Browse files
chore: wip
1 parent 602beca commit af33bd3

File tree

17 files changed

+261
-31
lines changed

17 files changed

+261
-31
lines changed

resources/components/Bench/Article.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ useHead({
2020
</script>
2121

2222
<template>
23-
<div class="mx-auto max-w-5xl px-4 sm:px-6 lg:px-8">
23+
<div class="mx-auto max-w-5xl px-4 sm:px-6 lg:px-8 pb-32">
2424
<div class="mx-auto mt-6 text-gray-500">
2525
<div class="flex items-center mb-8">
2626
<div class="flex items-center">

resources/components/Bench/ArticleHeader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const review = props.review
3838
</span>
3939
<h2 class="text-lg font-semibold text-gray-900">Reviewing</h2>
4040
<div class="mt-1 flex items-center justify-end">
41-
<img class="h-10 w-10 rounded-full" :src="review.judge.imageUrl" :alt="review.judge.name">
41+
<img class="h-10 w-10 rounded-full" :src="review.judge.photo" :alt="review.judge.name">
4242
<div class="ml-3">
4343
<p class="text-sm font-medium text-gray-900">{{ review.judge.name }}</p>
4444
<p class="text-sm text-gray-500">{{ review.judge.court }}</p>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<script setup lang="ts">
2+
import type { BlogPost } from '@/types/bench';
3+
import { computed } from 'vue';
4+
5+
const props = defineProps<{
6+
post: BlogPost
7+
}>()
8+
9+
const post = props.post
10+
11+
defineOptions({
12+
name: 'BlogDetailPage',
13+
})
14+
15+
useHead({
16+
title: `${post.title} - The Chamber of Secrets`,
17+
meta: [
18+
{ name: 'description', content: post.content.substring(0, 160) },
19+
],
20+
})
21+
22+
const shareUrl = computed(() => {
23+
return window.location.href
24+
})
25+
26+
const sharePost = () => {
27+
if (navigator.share) {
28+
navigator.share({
29+
title: post.title,
30+
text: post.content.substring(0, 160),
31+
url: shareUrl.value,
32+
})
33+
} else {
34+
// Fallback: Copy to clipboard
35+
navigator.clipboard.writeText(shareUrl.value)
36+
// You might want to add a toast notification here
37+
}
38+
}
39+
</script>
40+
41+
<template>
42+
<div class="mx-auto max-w-5xl px-4 sm:px-6 lg:px-8 pb-32">
43+
<div class="mx-auto mt-6 text-gray-500">
44+
<div class="blog-content relative">
45+
<div class="text-lg text-gray-700 space-y-6 whitespace-pre-line" v-html="post.content"></div>
46+
</div>
47+
48+
<!-- Article footer -->
49+
<div class="mt-16 border-t border-gray-200 pt-8">
50+
<div class="flex items-center justify-end">
51+
<button
52+
@click="sharePost"
53+
class="inline-flex items-center space-x-2 text-gray-600 hover:text-gray-900 transition-colors duration-200"
54+
>
55+
<svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
56+
<path d="M15 8a3 3 0 10-2.977-2.63l-4.94 2.47a3 3 0 100 4.319l4.94 2.47a3 3 0 10.895-1.789l-4.94-2.47a3.027 3.027 0 000-.74l4.94-2.47C13.456 7.68 14.19 8 15 8z" />
57+
</svg>
58+
<span>Share</span>
59+
</button>
60+
</div>
61+
</div>
62+
</div>
63+
</div>
64+
</template>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<script setup lang="ts">
2+
import type { BlogPost } from '@/types/bench';
3+
import { computed } from 'vue';
4+
5+
const props = defineProps<{
6+
post: BlogPost
7+
}>()
8+
9+
const post = props.post
10+
11+
// Calculate reading time (assuming average reading speed of 200 words per minute)
12+
const readingTime = computed(() => {
13+
const words = post.content.trim().split(/\s+/).length
14+
const minutes = Math.ceil(words / 200)
15+
return `${minutes} min read`
16+
})
17+
</script>
18+
19+
<template>
20+
<header class="relative">
21+
<div class="mx-auto max-w-5xl px-4 sm:px-6 lg:px-8 pt-16 pb-8">
22+
<div class="text-center">
23+
<h1 class="text-4xl font-bold tracking-tight text-gray-900 sm:text-5xl">
24+
{{ post.title }}
25+
</h1>
26+
</div>
27+
28+
<!-- Author and meta info -->
29+
<div class="mt-8 flex items-center justify-between border-t border-gray-200 pt-8">
30+
<!-- Author info -->
31+
<div class="flex items-center">
32+
<img class="h-12 w-12 rounded-full" :src="post.author.imageUrl" :alt="post.author.name">
33+
<div class="ml-3">
34+
<p class="text-sm font-medium text-gray-900">
35+
<a href="#" class="hover:underline">{{ post.author.name }}</a>
36+
</p>
37+
</div>
38+
</div>
39+
40+
<!-- Reading time and date -->
41+
<div class="flex items-center space-x-4 text-sm text-gray-500">
42+
<span>{{ readingTime }}</span>
43+
<span aria-hidden="true">&middot;</span>
44+
<time :datetime="post.dateTime">{{ post.date }}</time>
45+
</div>
46+
</div>
47+
</div>
48+
</header>
49+
</template>

resources/components/Bench/Judge/JudgeDirectory.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
<div class="relative z-10 p-6">
8989
<div class="relative">
9090
<div class="mx-auto h-40 w-40 overflow-hidden rounded-full ring-4 ring-gray-50 group-hover:ring-softBrown transition-all duration-300">
91-
<img class="h-full w-full object-cover filter grayscale group-hover:grayscale-0 transition-all duration-300" :src="judge.image" :alt="judge.name">
91+
<img class="h-full w-full object-cover filter grayscale group-hover:grayscale-0 transition-all duration-300" :src="judge.photo" :alt="judge.name">
9292
</div>
9393
<div class="absolute -bottom-2 left-1/2 transform -translate-x-1/2">
9494
<span class="inline-flex items-center rounded-full bg-warm-gray px-3 py-1 text-sm font-medium text-gray-700 ring-1 ring-inset ring-gray-700/10">

resources/components/Bench/Judge/ProfileHeader.vue

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,36 @@
11
<script setup lang="ts">
2+
import type { Judge } from '@/types/bench';
3+
4+
const props = defineProps<{
5+
judge: Judge
6+
}>()
7+
8+
const judge = props.judge
9+
210
const showCopiedFeedback = ref(false)
311
4-
const copyProfileLink = () => {
12+
const shareProfile = async () => {
513
const url = window.location.href
6-
navigator.clipboard.writeText(url)
7-
showCopiedFeedback.value = true
8-
setTimeout(() => {
9-
showCopiedFeedback.value = false
10-
}, 2000)
14+
const title = 'Judge Profile'
15+
16+
if (navigator.share) {
17+
try {
18+
await navigator.share({
19+
title,
20+
url,
21+
})
22+
} catch (err) {
23+
// User cancelled or share failed
24+
console.error('Error sharing:', err)
25+
}
26+
} else {
27+
// Fallback to copy
28+
navigator.clipboard.writeText(url)
29+
showCopiedFeedback.value = true
30+
setTimeout(() => {
31+
showCopiedFeedback.value = false
32+
}, 2000)
33+
}
1134
}
1235
</script>
1336

@@ -30,11 +53,11 @@ const copyProfileLink = () => {
3053
<button
3154
type="button"
3255
class="hidden text-sm/6 font-semibold text-gray-900 sm:block"
33-
@click="copyProfileLink"
56+
@click="shareProfile"
3457
>
35-
{{ showCopiedFeedback ? 'Copied!' : 'Copy Profile Link' }}
58+
{{ showCopiedFeedback ? 'Copied!' : 'Share Profile' }}
3659
</button>
37-
<router-link to="/review" class="hidden text-sm/6 font-semibold text-gray-900 sm:block">Write Review</router-link>
60+
<router-link :to="`/review/judge/${judge.id}`" class="hidden text-sm/6 font-semibold text-gray-900 sm:block">Write Review</router-link>
3861
<a href="#" class="rounded-md bg-gray-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-gray-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-600">Follow</a>
3962

4063
<div class="relative sm:hidden">
@@ -46,7 +69,7 @@ const copyProfileLink = () => {
4669
</button>
4770

4871
<div class="absolute right-0 z-10 mt-0.5 w-32 origin-top-right rounded-md bg-white py-2 shadow-lg ring-1 ring-gray-900/5 focus:outline-none" role="menu" aria-orientation="vertical" aria-labelledby="more-menu-button" tabindex="-1">
49-
<button type="button" class="block w-full px-3 py-1 text-left text-sm/6 text-gray-900" role="menuitem" tabindex="-1" id="more-menu-item-0">Share Profile</button>
72+
<button type="button" class="block w-full px-3 py-1 text-left text-sm/6 text-gray-900" role="menuitem" tabindex="-1" id="more-menu-item-0" @click="shareProfile">Share Profile</button>
5073
<router-link to="/review" class="block px-3 py-1 text-sm/6 text-gray-900" role="menuitem" tabindex="-1" id="more-menu-item-1">Write Review</router-link>
5174
</div>
5275
</div>

resources/components/Bench/LeftSidebar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<h2 class="text-base font-semibold text-gray-900">Trending Judges</h2>
77
<div class="mt-4 space-y-4">
88
<div v-for="judge in trendingJudges" :key="judge.id" class="flex items-center space-x-3">
9-
<img class="h-8 w-8 rounded-full filter grayscale" :src="judge.imageUrl" :alt="judge.name" />
9+
<img class="h-8 w-8 rounded-full filter grayscale" :src="judge.photo" :alt="judge.name" />
1010
<div class="min-w-0 flex-1">
1111
<p class="text-sm font-medium text-gray-900">{{ judge.name }}</p>
1212
<p class="text-sm text-gray-500">{{ judge.court }}</p>

resources/components/Bench/ReviewForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function handleCancel() {
9494
<div class="pb-12">
9595
<div>
9696
<div class="text-center mb-8">
97-
<img class="inline-block h-24 w-24 rounded-full ring-2 ring-white mb-4 filter grayscale" :src="judge.imageUrl" :alt="judge.name" />
97+
<img class="inline-block h-24 w-24 rounded-full ring-2 ring-white mb-4 filter grayscale" :src="judge.photo" :alt="judge.name" />
9898
<h3 class="text-lg font-semibold text-gray-800">{{ judge.name }}</h3>
9999
<p class="text-sm text-gray-600">{{ judge.court }}</p>
100100
<p class="text-sm text-gray-600">{{ judge.department }}</p>

0 commit comments

Comments
 (0)