Instantly share code, notes, and snippets.
Created
April 2, 2022 23:48
-
Star
0
(0)
You must be signed in to star a gist -
Fork
0
(0)
You must be signed in to fork a gist
-
Save apraditya/6e99b5a6d61233c31f051ee360e25524 to your computer and use it in GitHub Desktop.
Social links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Date: Sat, 2 Apr 2022 22:15:39 +0700 | |
Subject: [PATCH] Add youtube in socials, reordered & update social URLs | |
--- | |
.tina/__generated__/_graphql.json | 41 ++++++++++++++++++++++++++----- | |
.tina/__generated__/_schema.json | 29 +++++++++++++++------- | |
.tina/__generated__/frags.gql | 3 ++- | |
.tina/__generated__/schema.gql | 6 +++-- | |
.tina/__generated__/types.ts | 15 ++++++----- | |
.tina/schema.ts | 15 +++++++---- | |
components/footer.tsx | 17 ++++++++++++- | |
content/global/index.json | 7 +++--- | |
8 files changed, 100 insertions(+), 33 deletions(-) | |
diff --git a/.tina/__generated__/_graphql.json b/.tina/__generated__/_graphql.json | |
index 63aa355..cd8e3ab 100644 | |
--- a/.tina/__generated__/_graphql.json | |
+++ b/.tina/__generated__/_graphql.json | |
@@ -2024,7 +2024,7 @@ | |
"kind": "FieldDefinition", | |
"name": { | |
"kind": "Name", | |
- "value": "twitter" | |
+ "value": "instagram" | |
}, | |
"arguments": [], | |
"type": { | |
@@ -2039,7 +2039,7 @@ | |
"kind": "FieldDefinition", | |
"name": { | |
"kind": "Name", | |
- "value": "instagram" | |
+ "value": "github" | |
}, | |
"arguments": [], | |
"type": { | |
@@ -2054,7 +2054,22 @@ | |
"kind": "FieldDefinition", | |
"name": { | |
"kind": "Name", | |
- "value": "github" | |
+ "value": "twitter" | |
+ }, | |
+ "arguments": [], | |
+ "type": { | |
+ "kind": "NamedType", | |
+ "name": { | |
+ "kind": "Name", | |
+ "value": "String" | |
+ } | |
+ } | |
+ }, | |
+ { | |
+ "kind": "FieldDefinition", | |
+ "name": { | |
+ "kind": "Name", | |
+ "value": "youtube" | |
}, | |
"arguments": [], | |
"type": { | |
@@ -4508,7 +4523,7 @@ | |
"kind": "InputValueDefinition", | |
"name": { | |
"kind": "Name", | |
- "value": "twitter" | |
+ "value": "instagram" | |
}, | |
"type": { | |
"kind": "NamedType", | |
@@ -4522,7 +4537,7 @@ | |
"kind": "InputValueDefinition", | |
"name": { | |
"kind": "Name", | |
- "value": "instagram" | |
+ "value": "github" | |
}, | |
"type": { | |
"kind": "NamedType", | |
@@ -4536,7 +4551,21 @@ | |
"kind": "InputValueDefinition", | |
"name": { | |
"kind": "Name", | |
- "value": "github" | |
+ "value": "twitter" | |
+ }, | |
+ "type": { | |
+ "kind": "NamedType", | |
+ "name": { | |
+ "kind": "Name", | |
+ "value": "String" | |
+ } | |
+ } | |
+ }, | |
+ { | |
+ "kind": "InputValueDefinition", | |
+ "name": { | |
+ "kind": "Name", | |
+ "value": "youtube" | |
}, | |
"type": { | |
"kind": "NamedType", | |
diff --git a/.tina/__generated__/_schema.json b/.tina/__generated__/_schema.json | |
index d5a2db9..9a6e5bd 100644 | |
--- a/.tina/__generated__/_schema.json | |
+++ b/.tina/__generated__/_schema.json | |
@@ -504,35 +504,46 @@ | |
}, | |
{ | |
"type": "string", | |
- "label": "Twitter", | |
- "name": "twitter", | |
+ "label": "Instagram", | |
+ "name": "instagram", | |
"namespace": [ | |
"global", | |
"footer", | |
"social", | |
- "twitter" | |
+ "instagram" | |
] | |
}, | |
{ | |
"type": "string", | |
- "label": "Instagram", | |
- "name": "instagram", | |
+ "label": "Github", | |
+ "name": "github", | |
"namespace": [ | |
"global", | |
"footer", | |
"social", | |
- "instagram" | |
+ "github" | |
] | |
}, | |
{ | |
"type": "string", | |
- "label": "Github", | |
- "name": "github", | |
+ "label": "Twitter", | |
+ "name": "twitter", | |
"namespace": [ | |
"global", | |
"footer", | |
"social", | |
- "github" | |
+ "twitter" | |
+ ] | |
+ }, | |
+ { | |
+ "type": "string", | |
+ "label": "YouTube", | |
+ "name": "youtube", | |
+ "namespace": [ | |
+ "global", | |
+ "footer", | |
+ "social", | |
+ "youtube" | |
] | |
} | |
], | |
diff --git a/.tina/__generated__/frags.gql b/.tina/__generated__/frags.gql | |
index f5375f6..d9d3fd3 100644 | |
--- a/.tina/__generated__/frags.gql | |
+++ b/.tina/__generated__/frags.gql | |
@@ -33,9 +33,10 @@ fragment GlobalParts on Global { | |
social { | |
__typename | |
github | |
+ youtube | |
} | |
} | |
theme { | |
diff --git a/.tina/__generated__/schema.gql b/.tina/__generated__/schema.gql | |
index 4435b14..d143ebc 100644 | |
--- a/.tina/__generated__/schema.gql | |
+++ b/.tina/__generated__/schema.gql | |
@@ -133,9 +133,10 @@ type GlobalHeader { | |
type GlobalFooterSocial { | |
facebook: String | |
- twitter: String | |
instagram: String | |
github: String | |
+ twitter: String | |
+ youtube: String | |
} | |
type GlobalFooter { | |
@@ -325,9 +326,10 @@ input GlobalHeaderMutation { | |
input GlobalFooterSocialMutation { | |
facebook: String | |
- twitter: String | |
instagram: String | |
github: String | |
+ twitter: String | |
+ youtube: String | |
} | |
input GlobalFooterMutation { | |
diff --git a/.tina/__generated__/types.ts b/.tina/__generated__/types.ts | |
index dbc339f..8238a54 100644 | |
--- a/.tina/__generated__/types.ts | |
+++ b/.tina/__generated__/types.ts | |
@@ -247,9 +247,10 @@ export type GlobalHeader = { | |
export type GlobalFooterSocial = { | |
__typename?: 'GlobalFooterSocial'; | |
facebook?: Maybe<Scalars['String']>; | |
- twitter?: Maybe<Scalars['String']>; | |
instagram?: Maybe<Scalars['String']>; | |
github?: Maybe<Scalars['String']>; | |
+ twitter?: Maybe<Scalars['String']>; | |
+ youtube?: Maybe<Scalars['String']>; | |
}; | |
export type GlobalFooter = { | |
@@ -531,9 +532,10 @@ export type GlobalHeaderMutation = { | |
export type GlobalFooterSocialMutation = { | |
facebook?: InputMaybe<Scalars['String']>; | |
- twitter?: InputMaybe<Scalars['String']>; | |
instagram?: InputMaybe<Scalars['String']>; | |
github?: InputMaybe<Scalars['String']>; | |
+ twitter?: InputMaybe<Scalars['String']>; | |
+ youtube?: InputMaybe<Scalars['String']>; | |
}; | |
export type GlobalFooterMutation = { | |
@@ -642,7 +644,7 @@ export type BlogPostQueryQuery = { __typename?: 'Query', getPostsDocument: { __t | |
export type PostsPartsFragment = { __typename?: 'Posts', title?: string | null | undefined, heroImg?: string | null | undefined, excerpt?: any | null | undefined, date?: string | null | undefined, _body?: any | null | undefined, author?: { __typename?: 'AuthorsDocument', id: string } | null | undefined }; | |
-export type GlobalPartsFragment = { __typename?: 'Global', header?: { __typename: 'GlobalHeader', color?: string | null | undefined, icon?: { __typename: 'GlobalHeaderIcon', color?: string | null | undefined, style?: string | null | undefined, name?: string | null | undefined } | null | undefined, nav?: Array<{ __typename: 'GlobalHeaderNav', href?: string | null | undefined, label?: string | null | undefined } | null | undefined> | null | undefined } | null | undefined, footer?: { __typename: 'GlobalFooter', color?: string | null | undefined, social?: { __typename: 'GlobalFooterSocial', facebook?: string | null | undefined, twitter?: string | null | undefined, instagram?: string | null | undefined, github?: string | null | undefined } | null | undefined } | null | undefined, theme?: { __typename: 'GlobalTheme', color?: string | null | undefined, font?: string | null | undefined, icon?: string | null | undefined, darkMode?: string | null | undefined } | null | undefined }; | |
+export type GlobalPartsFragment = { __typename?: 'Global', header?: { __typename: 'GlobalHeader', color?: string | null | undefined, icon?: { __typename: 'GlobalHeaderIcon', color?: string | null | undefined, style?: string | null | undefined, name?: string | null | undefined } | null | undefined, nav?: Array<{ __typename: 'GlobalHeaderNav', href?: string | null | undefined, label?: string | null | undefined } | null | undefined> | null | undefined } | null | undefined, footer?: { __typename: 'GlobalFooter', color?: string | null | undefined, social?: { __typename: 'GlobalFooterSocial', facebook?: string | null | undefined, instagram?: string | null | undefined, github?: string | null | undefined, twitter?: string | null | undefined, youtube?: string | null | undefined } | null | undefined } | null | undefined, theme?: { __typename: 'GlobalTheme', color?: string | null | undefined, font?: string | null | undefined, icon?: string | null | undefined, darkMode?: string | null | undefined } | null | undefined }; | |
export type AuthorsPartsFragment = { __typename?: 'Authors', name?: string | null | undefined, avatar?: string | null | undefined }; | |
@@ -665,12 +667,12 @@ export type GetGlobalDocumentQueryVariables = Exact<{ | |
}>; | |
-export type GetGlobalDocumentQuery = { __typename?: 'Query', getGlobalDocument: { __typename?: 'GlobalDocument', id: string, sys: { __typename?: 'SystemInfo', filename: string, basename: string, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string }, data: { __typename?: 'Global', header?: { __typename: 'GlobalHeader', color?: string | null | undefined, icon?: { __typename: 'GlobalHeaderIcon', color?: string | null | undefined, style?: string | null | undefined, name?: string | null | undefined } | null | undefined, nav?: Array<{ __typename: 'GlobalHeaderNav', href?: string | null | undefined, label?: string | null | undefined } | null | undefined> | null | undefined } | null | undefined, footer?: { __typename: 'GlobalFooter', color?: string | null | undefined, social?: { __typename: 'GlobalFooterSocial', facebook?: string | null | undefined, twitter?: string | null | undefined, instagram?: string | null | undefined, github?: string | null | undefined } | null | undefined } | null | undefined, theme?: { __typename: 'GlobalTheme', color?: string | null | undefined, font?: string | null | undefined, icon?: string | null | undefined, darkMode?: string | null | undefined } | null | undefined } } }; | |
+export type GetGlobalDocumentQuery = { __typename?: 'Query', getGlobalDocument: { __typename?: 'GlobalDocument', id: string, sys: { __typename?: 'SystemInfo', filename: string, basename: string, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string }, data: { __typename?: 'Global', header?: { __typename: 'GlobalHeader', color?: string | null | undefined, icon?: { __typename: 'GlobalHeaderIcon', color?: string | null | undefined, style?: string | null | undefined, name?: string | null | undefined } | null | undefined, nav?: Array<{ __typename: 'GlobalHeaderNav', href?: string | null | undefined, label?: string | null | undefined } | null | undefined> | null | undefined } | null | undefined, footer?: { __typename: 'GlobalFooter', color?: string | null | undefined, social?: { __typename: 'GlobalFooterSocial', facebook?: string | null | undefined, instagram?: string | null | undefined, github?: string | null | undefined, twitter?: string | null | undefined, youtube?: string | null | undefined } | null | undefined } | null | undefined, theme?: { __typename: 'GlobalTheme', color?: string | null | undefined, font?: string | null | undefined, icon?: string | null | undefined, darkMode?: string | null | undefined } | null | undefined } } }; | |
export type GetGlobalListQueryVariables = Exact<{ [key: string]: never; }>; | |
-export type GetGlobalListQuery = { __typename?: 'Query', getGlobalList: { __typename?: 'GlobalConnection', totalCount: number, edges?: Array<{ __typename?: 'GlobalConnectionEdges', node?: { __typename?: 'GlobalDocument', id: string, sys: { __typename?: 'SystemInfo', filename: string, basename: string, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string }, data: { __typename?: 'Global', header?: { __typename: 'GlobalHeader', color?: string | null | undefined, icon?: { __typename: 'GlobalHeaderIcon', color?: string | null | undefined, style?: string | null | undefined, name?: string | null | undefined } | null | undefined, nav?: Array<{ __typename: 'GlobalHeaderNav', href?: string | null | undefined, label?: string | null | undefined } | null | undefined> | null | undefined } | null | undefined, footer?: { __typename: 'GlobalFooter', color?: string | null | undefined, social?: { __typename: 'GlobalFooterSocial', facebook?: string | null | undefined, twitter?: string | null | undefined, instagram?: string | null | undefined, github?: string | null | undefined } | null | undefined } | null | undefined, theme?: { __typename: 'GlobalTheme', color?: string | null | undefined, font?: string | null | undefined, icon?: string | null | undefined, darkMode?: string | null | undefined } | null | undefined } } | null | undefined } | null | undefined> | null | undefined } }; | |
+export type GetGlobalListQuery = { __typename?: 'Query', getGlobalList: { __typename?: 'GlobalConnection', totalCount: number, edges?: Array<{ __typename?: 'GlobalConnectionEdges', node?: { __typename?: 'GlobalDocument', id: string, sys: { __typename?: 'SystemInfo', filename: string, basename: string, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string }, data: { __typename?: 'Global', header?: { __typename: 'GlobalHeader', color?: string | null | undefined, icon?: { __typename: 'GlobalHeaderIcon', color?: string | null | undefined, style?: string | null | undefined, name?: string | null | undefined } | null | undefined, nav?: Array<{ __typename: 'GlobalHeaderNav', href?: string | null | undefined, label?: string | null | undefined } | null | undefined> | null | undefined } | null | undefined, footer?: { __typename: 'GlobalFooter', color?: string | null | undefined, social?: { __typename: 'GlobalFooterSocial', facebook?: string | null | undefined, instagram?: string | null | undefined, github?: string | null | undefined, twitter?: string | null | undefined, youtube?: string | null | undefined } | null | undefined } | null | undefined, theme?: { __typename: 'GlobalTheme', color?: string | null | undefined, font?: string | null | undefined, icon?: string | null | undefined, darkMode?: string | null | undefined } | null | undefined } } | null | undefined } | null | undefined> | null | undefined } }; | |
export type GetAuthorsDocumentQueryVariables = Exact<{ | |
relativePath: Scalars['String']; | |
@@ -768,9 +770,10 @@ export const GlobalPartsFragmentDoc = gql` | |
social { | |
__typename | |
github | |
+ youtube | |
} | |
} | |
theme { | |
diff --git a/.tina/schema.ts b/.tina/schema.ts | |
index 037cfd0..9698297 100644 | |
--- a/.tina/schema.ts | |
+++ b/.tina/schema.ts | |
@@ -558,11 +558,6 @@ export default defineSchema({ | |
label: "Facebook", | |
name: "facebook", | |
}, | |
- { | |
- type: "string", | |
- label: "Twitter", | |
- name: "twitter", | |
- }, | |
{ | |
type: "string", | |
label: "Instagram", | |
@@ -573,6 +568,16 @@ export default defineSchema({ | |
label: "Github", | |
name: "github", | |
}, | |
+ { | |
+ type: "string", | |
+ label: "Twitter", | |
+ name: "twitter", | |
+ }, | |
+ { | |
+ type: "string", | |
+ label: "YouTube", | |
+ name: "youtube", | |
+ }, | |
], | |
}, | |
], | |
diff --git a/components/footer.tsx b/components/footer.tsx | |
index c690304..9493cdf 100644 | |
--- a/components/footer.tsx | |
+++ b/components/footer.tsx | |
@@ -2,7 +2,7 @@ import React from "react"; | |
import Link from "next/link"; | |
// @ts-ignore | |
import TinaIconSvg from "../public/tina.svg"; | |
-import { FaFacebookF, FaGithub, FaTwitter } from "react-icons/fa"; | |
+import { FaFacebookF, FaGithub, FaTwitter, FaYoutube } from "react-icons/fa"; | |
import { AiFillInstagram } from "react-icons/ai"; | |
import { Container } from "./container"; | |
import { ThemeContext } from "./theme"; | |
@@ -121,6 +121,21 @@ export const Footer = ({ data, icon, rawData }) => { | |
/> | |
</a> | |
)} | |
+ {data.social && data.social.youtube && ( | |
+ <a | |
+ className="inline-block opacity-80 hover:opacity-100 transition ease-out duration-150" | |
+ href={data.social.youtube} | |
+ target="_blank" | |
+ > | |
+ <FaYoutube | |
+ className={`${socialIconClasses} ${ | |
+ socialIconColorClasses[ | |
+ data.color === "primary" ? "primary" : theme.color | |
+ ] | |
+ }`} | |
+ /> | |
+ </a> | |
+ )} | |
</div> | |
</div> | |
<div | |
diff --git a/content/global/index.json b/content/global/index.json | |
index a528aed..739d47e 100644 | |
--- a/content/global/index.json | |
+++ b/content/global/index.json | |
@@ -24,9 +24,10 @@ | |
"footer": { | |
"color": "default", | |
"social": { | |
- "facebook": "/", | |
- "twitter": "/", | |
- "instagram": "/" | |
+ "facebook": "", | |
+ "instagram": "/nuruliman.masjid", | |
+ "twitter": "", | |
+ "youtube": "/channel/UChoEzpOsSUGuhIEa32oUViw" | |
} | |
}, | |
"theme": { | |
-- | |
2.32.0 (Apple Git-132)+GitX |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment