1
1
import { BlogPost } from "../../types/blogPost" ;
2
2
import Section from "./section" ;
3
3
import { toAgoTime } from "../../utils/timeUtils" ;
4
+ import Link from "next/link" ;
5
+ import Capsule from "../uiLibrary/capsule" ;
6
+ import Dict = NodeJS . Dict ;
7
+
8
+ const colourByType : Dict < string > = {
9
+ 'announcement' : 'blue' ,
10
+ 'weekly' : 'indigo' ,
11
+ 'community' : 'green' ,
12
+ }
13
+
14
+ const textByType : Dict < string > = {
15
+ 'announcement' : 'Announcement' ,
16
+ 'weekly' : 'Weekly Update' ,
17
+ 'community' : 'Community Highlight' ,
18
+ }
19
+
4
20
5
21
const Post = ( props : BlogPost ) => {
6
- const { title, author, date_created, sections} = props ;
22
+ const { title, author, date_created, slug , type , sections} = props ;
7
23
8
24
return (
9
25
< >
@@ -13,9 +29,11 @@ const Post = (props: BlogPost) => {
13
29
< address className = { 'flex items-center mb-6 not-italic' } >
14
30
< div className = "inline-flex items-center mr-3 text-sm text-white" >
15
31
< div >
16
- < h1 className = "mb-4 text-4xl text-center font-extrabold leading-tight lg:mb-6 text-white" >
17
- { title }
18
- </ h1 >
32
+ < Link href = { `/blog/${ slug } ` } >
33
+ < h1 className = "mb-4 text-4xl text-center font-extrabold leading-tight lg:mb-6 text-white hover:underline hover:cursor-pointer" >
34
+ { title }
35
+ </ h1 >
36
+ </ Link >
19
37
< p className = "text-xl font-bold text-white" > by { author } </ p >
20
38
< p className = "text-base font-light text-gray-500 dark:text-gray-400" >
21
39
< time dateTime = { date_created ?. toString ( ) } title = { date_created ?. toString ( ) } >
0 commit comments