File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ import { getPageMap } from 'nextra/page-map';
11
11
import { getDictionary } from '../_dictionaries/get-dictionary' ;
12
12
13
13
import PlausibleProvider from 'next-plausible' ;
14
- import { DiscordIcon , GitHubIcon } from "nextra/icons" ;
14
+ import { DiscordIcon } from "nextra/icons" ;
15
15
import '../../styles/globals.css' ;
16
16
import { Footer } from "../_components/footer" ;
17
+ import { Stars } from "../_components/stars" ;
17
18
import { GITHUB_REPO_URL , PROJECT_URL } from "../_constants/project" ;
18
19
import { metadataSEO } from "../metadata" ;
19
20
@@ -51,7 +52,9 @@ export default async function RootLayout({ children, params }) {
51
52
</ >
52
53
}
53
54
projectLink = { PROJECT_URL }
54
- projectIcon = { < GitHubIcon className = "w-6 h-6" aria-label = "Github" /> }
55
+ projectIcon = {
56
+ < Stars variant = "small" />
57
+ }
55
58
chatLink = "https://ddias.link/discord"
56
59
chatIcon = { < DiscordIcon className = "w-6 h-6" aria-label = "Discord" /> }
57
60
>
Original file line number Diff line number Diff line change @@ -6,7 +6,11 @@ import { StarIcon } from 'lucide-react';
6
6
import { GitHubIcon } from 'nextra/icons' ;
7
7
import { useEffect , useState } from 'react' ;
8
8
9
- export function Stars ( ) {
9
+ type StarsProps = {
10
+ variant ?: 'default' | 'small'
11
+ }
12
+
13
+ export const Stars = ( { variant = 'default' } : StarsProps ) => {
10
14
const [ stars , setStars ] = useState < number | null > ( null )
11
15
12
16
useEffect ( ( ) => {
@@ -27,11 +31,12 @@ export function Stars() {
27
31
target = "_blank"
28
32
rel = "noopener noreferrer"
29
33
className = "!no-underline plausible-event-name=Star+Github inline-flex items-center gap-2 px-4 py-2 bg-white dark:bg-neutral-900 hover:bg-neutral-100 dark:hover:bg-neutral-800 text-sm font-medium text-neutral-900 dark:text-neutral-100 rounded-lg border border-neutral-400 dark:border-neutral-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-neutral-200 dark:focus:ring-neutral-700"
34
+ aria-label = "Star on GitHub"
30
35
>
31
- < GitHubIcon className = "w-4 h-4" />
32
- < span className = "hidden lg:inline" > Star on GitHub</ span >
36
+ < GitHubIcon className = "w-4 h-4" aria-hidden = "true" />
37
+ { variant === 'default' && < span className = "hidden lg:inline" > Star on GitHub</ span > }
33
38
< span className = "inline-flex items-center px-2 py-0.5 rounded bg-neutral-100 dark:bg-neutral-700 text-neutral-900 dark:text-neutral-100" >
34
- < StarIcon className = "w-4 h-4 mr-1" />
39
+ < StarIcon className = "w-4 h-4 mr-1" aria-hidden = "true" />
35
40
{ stars }
36
41
</ span >
37
42
</ a >
You can’t perform that action at this time.
0 commit comments