File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed
components/dashboard/src/components Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { useEffect } from "react";
8
8
import { useLocation } from "react-router" ;
9
9
import { Separator } from "./Separator" ;
10
10
import TabMenuItem from "./TabMenuItem" ;
11
+ import { Heading1 , Subheading } from "./typography/headings" ;
11
12
12
13
export interface HeaderProps {
13
14
title : string | React . ReactElement ;
@@ -33,8 +34,12 @@ export default function Header(p: HeaderProps) {
33
34
< div className = "app-container border-gray-200 dark:border-gray-800" >
34
35
< div className = "flex pb-8 pt-6" >
35
36
< div className = "" >
36
- { typeof p . title === "string" ? < h1 className = "tracking-tight" > { p . title } </ h1 > : p . title }
37
- { typeof p . subtitle === "string" ? < h2 className = "tracking-wide" > { p . subtitle } </ h2 > : p . subtitle }
37
+ { typeof p . title === "string" ? < Heading1 > { p . title } </ Heading1 > : p . title }
38
+ { typeof p . subtitle === "string" ? (
39
+ < Subheading className = "tracking-wide" > { p . subtitle } </ Subheading >
40
+ ) : (
41
+ p . subtitle
42
+ ) }
38
43
</ div >
39
44
</ div >
40
45
< nav className = "flex" >
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright (c) 2023 Gitpod GmbH. All rights reserved.
3
+ * Licensed under the GNU Affero General Public License (AGPL).
4
+ * See License.AGPL.txt in the project root for license information.
5
+ */
6
+
7
+ import classNames from "classnames" ;
8
+ import { FC } from "react" ;
9
+
10
+ type HeadingProps = {
11
+ className ?: string ;
12
+ } ;
13
+
14
+ export const Heading1 : FC < HeadingProps > = ( { className, children } ) => {
15
+ return < h1 className = { classNames ( "text-gray-900 dark:text-gray-100 font-bold text-4xl" , className ) } > { children } </ h1 > ;
16
+ } ;
17
+
18
+ // Intended to be placed beneath a heading to provide more context
19
+ export const Subheading : FC < HeadingProps > = ( { className, children } ) => {
20
+ return < p className = { classNames ( "text-base text-gray-500 dark:text-gray-600" , className ) } > { children } </ p > ;
21
+ } ;
You can’t perform that action at this time.
0 commit comments