Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Discord Added for Social links and footer and use react-icons instead #427

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
37 changes: 28 additions & 9 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import * as React from 'react'

import { FaEnvelopeOpenText } from '@react-icons/all-files/fa/FaEnvelopeOpenText'
import { FaGithub } from '@react-icons/all-files/fa/FaGithub'
import { FaLinkedin } from '@react-icons/all-files/fa/FaLinkedin'
import { FaMastodon } from '@react-icons/all-files/fa/FaMastodon'
import { FaTwitter } from '@react-icons/all-files/fa/FaTwitter'
import { FaYoutube } from '@react-icons/all-files/fa/FaYoutube'
import { FaZhihu } from '@react-icons/all-files/fa/FaZhihu'
import { IoMoonSharp } from '@react-icons/all-files/io5/IoMoonSharp'
import { IoSunnyOutline } from '@react-icons/all-files/io5/IoSunnyOutline'
import /* Ionicons 5 */
{
IoMoonSharp,
IoSunnyOutline
} from 'react-icons/io5'

import /* Font Awesome */
{
FaDiscord,
FaYoutube,
FaTwitter,
FaMastodon,
FaGithub,
FaLinkedin,
FaZhihu,
FaEnvelopeOpenText
} from "react-icons/fa";

import * as config from '@/lib/config'
import { useDarkMode } from '@/lib/use-dark-mode'
Expand Down Expand Up @@ -53,6 +61,17 @@ export const FooterImpl: React.FC = () => {
</div>

<div className={styles.social}>
{config.discord_invite && (
<a
className={styles.discord}
href={`${config.discord_invite}`}
title={`${config.discord} on Discord`}
target='_blank'
rel='noopener noreferrer'
>
<FaDiscord />
</a>
)}
{config.twitter && (
<a
className={styles.twitter}
Expand Down
7 changes: 5 additions & 2 deletions components/NotionPageHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import * as React from 'react'

import * as types from 'notion-types'
import { IoMoonSharp } from '@react-icons/all-files/io5/IoMoonSharp'
import { IoSunnyOutline } from '@react-icons/all-files/io5/IoSunnyOutline'
import /* Ionicons 5 */
{
IoMoonSharp,
IoSunnyOutline
} from 'react-icons/io5'
import cs from 'classnames'
import { Breadcrumbs, Header, Search, useNotionContext } from 'react-notion-x'

Expand Down
10 changes: 8 additions & 2 deletions components/PageActions.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import * as React from 'react'

import { AiOutlineRetweet } from '@react-icons/all-files/ai/AiOutlineRetweet'
import { IoHeartOutline } from '@react-icons/all-files/io5/IoHeartOutline'
import /* Ant Design Icons */
{
AiOutlineRetweet
} from 'react-icons/ai'
import /* Ionicons 5 */
{
IoHeartOutline
} from 'react-icons/io5'

import styles from './styles.module.css'

Expand Down
7 changes: 7 additions & 0 deletions components/PageSocial.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@
border-color: #3b5998;
}

.discord .actionBgPane {
background: #5865f2;
}
.discord:hover {
border-color: #5865f2;
}

.twitter .actionBgPane {
background: #2795e9;
}
Expand Down
50 changes: 30 additions & 20 deletions components/PageSocial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ import cs from 'classnames'
import * as config from '@/lib/config'

import styles from './PageSocial.module.css'

import
{ /* Font Awesome Icons */
FaDiscord,
FaYoutube,
FaTwitter,
//FaMastodon,
FaGithub,
FaLinkedin,
} from "react-icons/fa";
interface SocialLink {
name: string
title: string
Expand All @@ -14,14 +22,30 @@ interface SocialLink {
}

const socialLinks: SocialLink[] = [
config.discord && {
name: 'discord',
href: `${config.discord_invite}`, // Invite URL of the Discord server
title: `${config.discord} on Discord`, // Name of the Discord server
icon: (
<FaDiscord />
)
},

config.youtube && {
name: 'youtube',
href: `https://www.youtube.com/${config.youtube}`,
title: `YouTube ${config.youtube}`,
icon: (
<FaYoutube />
)
},

config.twitter && {
name: 'twitter',
href: `https://twitter.com/${config.twitter}`,
title: `Twitter @${config.twitter}`,
icon: (
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'>
<path d='M23.44 4.83c-.8.37-1.5.38-2.22.02.93-.56.98-.96 1.32-2.02-.88.52-1.86.9-2.9 1.1-.82-.88-2-1.43-3.3-1.43-2.5 0-4.55 2.04-4.55 4.54 0 .36.03.7.1 1.04-3.77-.2-7.12-2-9.36-4.75-.4.67-.6 1.45-.6 2.3 0 1.56.8 2.95 2 3.77-.74-.03-1.44-.23-2.05-.57v.06c0 2.2 1.56 4.03 3.64 4.44-.67.2-1.37.2-2.06.08.58 1.8 2.26 3.12 4.25 3.16C5.78 18.1 3.37 18.74 1 18.46c2 1.3 4.4 2.04 6.97 2.04 8.35 0 12.92-6.92 12.92-12.93 0-.2 0-.4-.02-.6.9-.63 1.96-1.22 2.56-2.14z' />
</svg>
<FaTwitter />
)
},

Expand All @@ -30,9 +54,7 @@ const socialLinks: SocialLink[] = [
href: `https://github.com/${config.github}`,
title: `GitHub @${config.github}`,
icon: (
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'>
<path d='M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22'></path>
</svg>
<FaGithub />
)
},

Expand All @@ -41,9 +63,7 @@ const socialLinks: SocialLink[] = [
href: `https://www.linkedin.com/in/${config.linkedin}`,
title: `LinkedIn ${config.author}`,
icon: (
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'>
<path d='M6.5 21.5h-5v-13h5v13zM4 6.5C2.5 6.5 1.5 5.3 1.5 4s1-2.4 2.5-2.4c1.6 0 2.5 1 2.6 2.5 0 1.4-1 2.5-2.6 2.5zm11.5 6c-1 0-2 1-2 2v7h-5v-13h5V10s1.6-1.5 4-1.5c3 0 5 2.2 5 6.3v6.7h-5v-7c0-1-1-2-2-2z' />
</svg>
<FaLinkedin />
)
},

Expand All @@ -58,16 +78,6 @@ const socialLinks: SocialLink[] = [
)
},

config.youtube && {
name: 'youtube',
href: `https://www.youtube.com/${config.youtube}`,
title: `YouTube ${config.youtube}`,
icon: (
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'>
<path d='M10,15L15.19,12L10,9V15M21.56,7.17C21.69,7.64 21.78,8.27 21.84,9.07C21.91,9.87 21.94,10.56 21.94,11.16L22,12C22,14.19 21.84,15.8 21.56,16.83C21.31,17.73 20.73,18.31 19.83,18.56C19.36,18.69 18.5,18.78 17.18,18.84C15.88,18.91 14.69,18.94 13.59,18.94L12,19C7.81,19 5.2,18.84 4.17,18.56C3.27,18.31 2.69,17.73 2.44,16.83C2.31,16.36 2.22,15.73 2.16,14.93C2.09,14.13 2.06,13.44 2.06,12.84L2,12C2,9.81 2.16,8.2 2.44,7.17C2.69,6.27 3.27,5.69 4.17,5.44C4.64,5.31 5.5,5.22 6.82,5.16C8.12,5.09 9.31,5.06 10.41,5.06L12,5C16.19,5 18.8,5.16 19.83,5.44C20.73,5.69 21.31,6.27 21.56,7.17Z' />
</svg>
)
}
].filter(Boolean)

export const PageSocial: React.FC = () => {
Expand Down
4 changes: 4 additions & 0 deletions components/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@
color: #2795e9;
}

.discord:hover {
color: #5865f2;
}

.twitter:hover {
color: #2795e9;
}
Expand Down
2 changes: 2 additions & 0 deletions lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export const description: string = getSiteConfig('description', 'Notion Blog')
export const language: string = getSiteConfig('language', 'en')

// social accounts
export const discord: string | null = getSiteConfig('discord', null)
export const discord_invite: string | null = getSiteConfig('discord_invite', null)
export const twitter: string | null = getSiteConfig('twitter', null)
export const mastodon: string | null = getSiteConfig('mastodon', null)
export const github: string | null = getSiteConfig('github', null)
Expand Down
2 changes: 2 additions & 0 deletions lib/site-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export interface SiteConfig {
description?: string
language?: string

discord?: string
discord_invite?: string
twitter?: string
github?: string
linkedin?: string
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"@fisch0920/use-dark-mode": "^2.4.0",
"@keyvhq/core": "^1.6.9",
"@keyvhq/redis": "^1.6.10",
"@react-icons/all-files": "^4.1.0",
"@vercel/og": "^0.0.19",
"classnames": "^2.3.1",
"date-fns": "^2.28.0",
Expand All @@ -47,6 +46,7 @@
"react": "^18.2.0",
"react-body-classname": "^1.3.1",
"react-dom": "^18.2.0",
"react-icons": "^4.7.1",
"react-notion-x": "^6.15.6",
"react-tweet-embed": "^2.0.0",
"react-use": "^17.4.2",
Expand Down
2 changes: 1 addition & 1 deletion pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import Document, { Head, Html, Main, NextScript } from 'next/document'

import { IconContext } from '@react-icons/all-files'
import { IconContext } from 'react-icons'

export default class MyDocument extends Document {
render() {
Expand Down
67 changes: 45 additions & 22 deletions site.config.ts
Original file line number Diff line number Diff line change
@@ -1,55 +1,78 @@
import { siteConfig } from './lib/site-config'

export default siteConfig({
// the site's root Notion page (required)
/* (required)
The site's root Notion page
*/
rootNotionPageId: '7875426197cf461698809def95960ebf',

// if you want to restrict pages to a single notion workspace (optional)
// (this should be a Notion ID; see the docs for how to extract this)
/* (optional)
if you want to restrict pages to a single notion workspace
(this should be a Notion ID; see the docs for how to extract this)
*/
rootNotionSpaceId: null,

// basic site info (required)
/* (required)
Basic site info
*/
name: 'Next.js Notion Starter Kit',
domain: 'nextjs-notion-starter-kit.transitivebullsh.it',
author: 'Travis Fischer',

// open graph metadata (optional)
/* (optional)
Open graph metadata
*/
description: 'Example Next.js Notion Starter Kit Site',

// social usernames (optional)
/* (optional)
Social usernames
*/
twitter: 'transitive_bs',
github: 'transitive-bullshit',
linkedin: 'fisch2',
// mastodon: '#', // optional mastodon profile URL, provides link verification
// newsletter: '#', // optional newsletter URL
// youtube: '#', // optional youtube channel name or `channel/UCGbXXXXXXXXXXXXXXXXXXXXXX`
// discord: 'My Server', /* Server Name */
// discord_invite: 'https://discord.gg/zf6g5KQ6H4', /* Discord invite link */
// mastodon: '#', /* Optional mastodon profile URL, provides link verification */
// newsletter: '#', /* Optional newsletter URL */
// youtube: '#', /* Optional youtube channel name or `channel/UCGbXXXXXXXXXXXXXXXXXXXXXX` */

// default notion icon and cover images for site-wide consistency (optional)
// page-specific values will override these site-wide defaults
/* (optional)
Default notion icon and cover images for site-wide consistency.
Page-specific values will override these site-wide defaults.
*/
defaultPageIcon: null,
defaultPageCover: null,
defaultPageCoverPosition: 0.5,

// whether or not to enable support for LQIP preview images (optional)
/* (optional)
Whether or not to enable support for LQIP preview images.
*/
isPreviewImageSupportEnabled: true,

// whether or not redis is enabled for caching generated preview images (optional)
// NOTE: if you enable redis, you need to set the `REDIS_HOST` and `REDIS_PASSWORD`
// environment variables. see the readme for more info
/* (optional)
Whether or not redis is enabled for caching generated preview images.
NOTE: if you enable redis, you need to set the `REDIS_HOST`
and `REDIS_PASSWORD` environment variables.
See the readme for more info.
*/
isRedisEnabled: false,

// map of notion page IDs to URL paths (optional)
// any pages defined here will override their default URL paths
// example:
//
/* (optional)
Map of notion page IDs to URL paths.
Any pages defined here will override their default URL paths.
Example:
*/
// pageUrlOverrides: {
// '/foo': '067dd719a912471ea9a3ac10710e7fdf',
// '/bar': '0be6efce9daf42688f65c76b89f8eb27'
// }
pageUrlOverrides: null,

// whether to use the default notion navigation style or a custom one with links to
// important pages. To use `navigationLinks`, set `navigationStyle` to `custom`.
/*
Whether to use the default notion navigation style
or a custom one with links to important pages.
To use `navigationLinks`, set `navigationStyle` to `custom`.
*/
navigationStyle: 'default'
// navigationStyle: 'custom',
// navigationLinks: [
Expand All @@ -59,7 +82,7 @@ export default siteConfig({
// },
// {
// title: 'Contact',
// pageId: '6a29ebcb935a4f0689fe661ab5f3b8d1'
// url: 'https://twitter.com/transitive_bs'
// }
// ]
})
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,6 @@
resolved "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.21.tgz"
integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==

"@react-icons/all-files@^4.1.0":
version "4.1.0"
resolved "https://registry.npmjs.org/@react-icons/all-files/-/all-files-4.1.0.tgz"
integrity sha512-hxBI2UOuVaI3O/BhQfhtb4kcGn9ft12RWAFVMUeNjqqhLsHvFtzIkFaptBJpFDANTKoDfdVoHTKZDlwKCACbMQ==

"@resvg/resvg-wasm@2.0.0-alpha.4":
version "2.0.0-alpha.4"
resolved "https://registry.yarnpkg.com/@resvg/resvg-wasm/-/resvg-wasm-2.0.0-alpha.4.tgz#fc2f86186a9641df030d8f9f3f9d995899cd1ecb"
Expand Down Expand Up @@ -2940,6 +2935,11 @@ react-hotkeys-hook@^3.0.3:
dependencies:
hotkeys-js "3.8.7"

react-icons@^4.7.1:
version "4.7.1"
resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.7.1.tgz#0f4b25a5694e6972677cb189d2a72eabea7a8345"
integrity sha512-yHd3oKGMgm7zxo3EA7H2n7vxSoiGmHk5t6Ou4bXsfcgWyhfDKMpyKfhHR6Bjnn63c+YXBLBPUql9H4wPJM6sXw==

react-image@^4.0.3:
version "4.0.3"
resolved "https://registry.npmjs.org/react-image/-/react-image-4.0.3.tgz"
Expand Down