Skip to content

Commit 37f9141

Browse files
introduce the new logo #74
1 parent 6ecfccb commit 37f9141

File tree

5 files changed

+43
-25
lines changed

5 files changed

+43
-25
lines changed

examples/demo-section-blog/theme.config.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const themeConfig = {
22
settings: {
33
title: "My title",
44
description: "my descript is here ",
5-
SiteURL:"https://officialrajdeepsingh.dev",
5+
SiteURL: "https://officialrajdeepsingh.dev",
66
defaultSEO: {
77
title: "default SEO title is here",
88
titleTemplate: '%s | Section Blog Theme',
@@ -13,7 +13,7 @@ const themeConfig = {
1313
}
1414
}
1515
},
16-
bannerMessage: "Start your markdown portfolio blog with nextjs, nextra, tailwind CSS, and Shadcn UI using <a style='margin: 0px 4px;' target='_blank' href='https://www.npmjs.com/package/section-blog-theme'> the section blog theme. </a>",
16+
bannerMessage: "Start your markdown portfolio blog with nextjs, nextra, tailwind CSS, and Shadcn UI using <a style='margin: 0px 4px;text-decoration:underline;' target='_blank' href='https://www.npmjs.com/package/section-blog-theme'> the section blog theme. </a>",
1717
SocialLinks: [
1818
{
1919
name: "twitter",
@@ -29,7 +29,15 @@ const themeConfig = {
2929
},
3030
],
3131
Logo: {
32-
TextLogo: "Section"
32+
logo: (
33+
<>
34+
<svg width="36" height="36" viewBox="0 0 434 420" xmlns="http://www.w3.org/2000/svg">
35+
<path fillRule="evenodd" clipRule="evenodd" fill="currentColor" d="M226.569 66.5458C222.348 59.1514 211.686 59.1514 207.464 66.5458L63.4636 318.753C59.2767 326.086 64.5719 335.207 73.0163 335.207H361.018C369.462 335.207 374.757 326.086 370.57 318.753L226.569 66.5458ZM217.017 270.333C235.355 270.333 250.221 256.557 250.221 239.563C250.221 222.57 235.355 208.793 217.017 208.793C198.679 208.793 183.813 222.57 183.813 239.563C183.813 256.557 198.679 270.333 217.017 270.333Z" />
36+
</svg>
37+
</>
38+
),
39+
link: "/",
40+
target: "_blank"
3341
},
3442
PrimaryNavigation: [
3543
{

packages/section-blog-theme/components/Footer/Footer.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ import type { Logo, Navigation, SocialLinks } from "@/src/types";
33
import Link from "next/link";
44
import NavigationItem from "@/components/Navigation/NavgationItem";
55
import { SocialLink } from "@/components/SocialLink/SocialLink";
6+
import { renderComponent } from "@/utility/render";
67

78
export function Footer({ Logo, SecondaryNavigation, socialLinks }: { Logo: Logo; SecondaryNavigation: Navigation[]; socialLinks: SocialLinks[] }) {
89

910
return (
1011
<footer className="print:hidden container flex flex-wrap flex-row item-center justify-center my-5 p-5 mx-auto lg:flex-row divide-gray-400">
1112

12-
{ Logo.TextLogo && <Link href="/" className="ml-2 self-center text-xl font-semibold whitespace-nowrap !text-foreground dark:text-white">
13-
{Logo.TextLogo}
14-
</Link>}
13+
<Link target={Logo.target ? Logo.target : "_blank"} href={Logo.link ? Logo.link : "/"} className="flex flex-row items-center justify-between text-black dark:text-white">
14+
{renderComponent(Logo.logo)}
15+
</Link>
16+
1517

1618
<NavigationMenu className="my-3 flex flex-wrap justify-between items-center mx-auto md:my-0">
1719
<NavigationMenuList>

packages/section-blog-theme/components/Header/Header.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ import NavigationItems from "@/components/Navigation/NavigationItems";
66
import NavigationItem from "@/components/Navigation/NavgationItem";
77
import { SocialLink } from "@/components/SocialLink/SocialLink";
88
import { SearchCommandDialog } from "@/components/Command/Command";
9+
import { renderComponent } from "@/utility/render";
910

1011
export function Header({ Logo, PrimaryNavigation, socialLinks }: { Logo: Logo; PrimaryNavigation: Navigation[]; socialLinks: SocialLinks[]; }) {
1112

1213
return (
1314

1415
<header className="container print:hidden mt-3 px-4 lg:px-6 py-8 flex gap-y-5 justify-center flex-col sm:flex-row md:justify-between items-center mx-auto">
1516

16-
17-
{Logo.TextLogo && <Link href="/" className="ml-2 self-center text-xl font-semibold whitespace-nowrap !text-foreground dark:text-white">
18-
{Logo.TextLogo}
19-
</Link>}
17+
<Link target={Logo.target ? Logo.target : "_blank"} href={Logo.link ? Logo.link : "/"} className="flex flex-row items-center justify-between text-black dark:text-white">
18+
{renderComponent(Logo.logo)}
19+
</Link>
2020

2121
<NavigationMenu className="my-3 flex flex-wrap justify-between items-center mx-auto md:my-0">
2222

packages/section-blog-theme/src/types.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
import type { ReactNode } from "react";
21
import dynamicIconImports from 'lucide-react/dynamicIconImports';
32
import { DefaultSeoProps } from "next-seo";
43
import { LucideProps } from 'lucide-react';
4+
import type { ReactNode, FC } from 'react';
55

6-
6+
// SubNavigation
77
export interface SubNavigation {
88
title: string;
99
href: string;
1010
target: string;
1111
description: string;
1212
}
13+
// Navigation
1314
export interface Navigation {
1415
href?: string;
1516
title: string;
@@ -18,19 +19,22 @@ export interface Navigation {
1819
target: string;
1920
subNavigation?: SubNavigation[];
2021
}
21-
22+
// Social link
2223
export interface SocialLinks extends IconProps {
2324
url: string;
2425
}
2526

27+
// Lucide icon
2628
export interface IconProps extends LucideProps {
2729
name: keyof typeof dynamicIconImports;
2830
}
2931

32+
// logo
3033
export interface Logo {
31-
TextLogo: string;
34+
logo: React.ReactNode | FC;
35+
link?: string;
36+
target?: string;
3237
}
33-
3438
export interface settingsTypes {
3539
SiteURL?: string;
3640
title?: string;
@@ -58,6 +62,7 @@ export type MdxFileCard<FrontMatterType = BlogFrontMatter> = {
5862
frontMatter: FrontMatterType;
5963
};
6064

65+
// layout type
6166
export type LayoutTypes =
6267
| "home"
6368
| "post"
@@ -67,20 +72,13 @@ export type LayoutTypes =
6772
| 404
6873
| 500;
6974

70-
// export interface MetaImage {
71-
// src: string;
72-
// width?: number;
73-
// height?: number;
74-
// alt?: string;
75-
// type?: string;
76-
// caption?: string
77-
// }
78-
75+
// author
7976
export interface authorType {
8077
name: string;
8178
url: string;
8279
}
8380

81+
// blog front matter
8482
export type BlogFrontMatter = {
8583
author?: authorType | string;
8684
date?: string;
@@ -90,6 +88,8 @@ export type BlogFrontMatter = {
9088
title: string;
9189
type: "post";
9290
};
91+
92+
// icon type
9393
export type iconsType =
9494
| "facebook"
9595
| "twitter"
@@ -100,5 +100,5 @@ export type iconsType =
100100

101101
export type GetMetaData = MdxFileCard
102102

103-
// space the type
103+
// type for space component
104104
export type spaceType = "xs"| "sm"| "md" | "lg" | "xl" | "2xl"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import type { FC, ReactNode } from 'react'
2+
3+
export function renderComponent<T>( ComponentOrNode: FC<T> | ReactNode, props?: T) {
4+
if (!ComponentOrNode) return null
5+
if (typeof ComponentOrNode !== 'function') return ComponentOrNode
6+
// @ts-expect-error TS2322: Type '{}' is not assignable to type 'T'
7+
return <ComponentOrNode {...props} />
8+
};

0 commit comments

Comments
 (0)