File tree 4 files changed +29
-6
lines changed
4 files changed +29
-6
lines changed Original file line number Diff line number Diff line change 1
1
import type { FC } from 'hono/jsx' ;
2
2
import { raw } from 'hono/html' ;
3
+ import { Blog } from '@phoenix/core/entities' ;
3
4
4
- export const Base : FC = ( props ) => {
5
- const base = ( props : any ) => (
5
+ type Props = {
6
+ blog ?: Blog ,
7
+ children ?: any ,
8
+ title ?: string ;
9
+ } ;
10
+
11
+ export const Base : FC = ( props : Props ) => {
12
+ const base = ( props : Props ) => (
6
13
< html >
7
14
< head >
8
15
< meta http-equiv = "X-UA-Compatible" content = "IE=edge" />
@@ -14,6 +21,8 @@ export const Base: FC = (props) => {
14
21
< meta name = "robots" content = "noindex" />
15
22
< link href = "/theme/index.css" rel = "stylesheet" />
16
23
< link rel = "icon" type = "image/x-icon" href = "/favicon.ico" />
24
+
25
+ < title > { props . blog ?. name } { props . title ? `- ${ props . title } ` : '' } </ title >
17
26
</ head >
18
27
< body >
19
28
< div class = "bg-white py-12" >
Original file line number Diff line number Diff line change 1
1
import type { FC } from 'hono/jsx' ;
2
2
import { Base } from './base' ;
3
3
4
- export const ErrorTemplate : FC < { error : string } > = ( props : { error : string } ) => {
4
+ type Props = {
5
+ error : string ,
6
+ }
7
+
8
+ export const ErrorTemplate : FC < Props > = ( props : Props ) => {
5
9
return (
6
10
< Base >
7
11
< div class = "flex flex-col space-y-6" >
Original file line number Diff line number Diff line change @@ -2,9 +2,14 @@ import { Blog, Page } from '@phoenix/core/entities';
2
2
import type { FC } from 'hono/jsx' ;
3
3
import { Base } from './base' ;
4
4
5
- export const PageTemplate : FC < { page : Page , blog : Blog } > = ( props : { page : Page , blog : Blog } ) => {
5
+ type Props = {
6
+ blog : Blog ,
7
+ page : Page ,
8
+ }
9
+
10
+ export const PageTemplate : FC < Props > = ( props : Props ) => {
6
11
return (
7
- < Base blog = { props . blog } >
12
+ < Base blog = { props . blog } title = { props . page . title } >
8
13
< div class = "flex flex-col" >
9
14
< div class = "flex" >
10
15
< h2 class = "text-3xl font-bold" >
Original file line number Diff line number Diff line change @@ -3,7 +3,12 @@ import type { FC } from 'hono/jsx';
3
3
import { Base } from './base' ;
4
4
import { date } from '../utils' ;
5
5
6
- export const PostsTemplate : FC < { posts : Page [ ] , blog : Blog } > = ( props : { posts : Page [ ] , blog : Blog } ) => {
6
+ type Props = {
7
+ posts : Page [ ] ,
8
+ blog : Blog ,
9
+ }
10
+
11
+ export const PostsTemplate : FC < Props > = ( props : Props ) => {
7
12
return (
8
13
< Base blog = { props . blog } >
9
14
{ props . posts . map ( ( post ) => (
You can’t perform that action at this time.
0 commit comments