From 8498ad8adaf4e33e868148f731be7e072db74505 Mon Sep 17 00:00:00 2001 From: Daniel Knittl-Frank Date: Wed, 26 Oct 2022 18:59:37 +0200 Subject: [PATCH 1/2] Allow linking Stack Overflow account/profile #226 --- gitprofile.config.js | 1 + src/components/GitProfile.jsx | 1 + src/components/details/index.jsx | 9 +++++++++ src/helpers/utils.jsx | 1 + types/index.d.ts | 5 +++++ 5 files changed, 17 insertions(+) diff --git a/gitprofile.config.js b/gitprofile.config.js index 8652a68..f9e9542 100644 --- a/gitprofile.config.js +++ b/gitprofile.config.js @@ -19,6 +19,7 @@ const config = { behance: '', medium: 'arifszn', dev: 'arifszn', + stackoverflow: '', // format: userid/username website: 'https://arifszn.github.io', phone: '', email: 'arifulalamszn@gmail.com', diff --git a/src/components/GitProfile.jsx b/src/components/GitProfile.jsx index c781e85..4aaef5f 100644 --- a/src/components/GitProfile.jsx +++ b/src/components/GitProfile.jsx @@ -258,6 +258,7 @@ GitProfile.propTypes = { behance: PropTypes.string, medium: PropTypes.string, dev: PropTypes.string, + stackoverflow: PropTypes.string, website: PropTypes.string, phone: PropTypes.string, email: PropTypes.string, diff --git a/src/components/details/index.jsx b/src/components/details/index.jsx index 47d2d13..d84144a 100644 --- a/src/components/details/index.jsx +++ b/src/components/details/index.jsx @@ -15,6 +15,7 @@ import { FaDev, FaFacebook, FaGlobe, + FaStackOverflow, } from 'react-icons/fa'; import PropTypes from 'prop-types'; import { skeleton } from '../../helpers/utils'; @@ -169,6 +170,14 @@ const Details = ({ profile, loading, social, github }) => { link={`https://dev.to/${social.dev}`} /> )} + {social?.stackoverflow && ( + } + title="Stack Overflow:" + value={social.stackoverflow.split('/').slice(-1)} + link={`https://stackoverflow.com/users/${social.stackoverflow}`} + /> + )} {social?.website && ( } diff --git a/src/helpers/utils.jsx b/src/helpers/utils.jsx index 86e81e8..8476645 100644 --- a/src/helpers/utils.jsx +++ b/src/helpers/utils.jsx @@ -153,6 +153,7 @@ export const sanitizeConfig = (config) => { behance: config?.social?.behance, medium: config?.social?.medium, dev: config?.social?.dev, + stackoverflow: config?.social?.stackoverflow, website: config?.social?.website, phone: config?.social?.phone, email: config?.social?.email, diff --git a/types/index.d.ts b/types/index.d.ts index de04515..e66253a 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -79,6 +79,11 @@ export interface Social { */ dev?: string; + /** + * Stack Overflow + */ + stackoverflow?: string; + /** * Website */ From 939ecb61127454ce64a860d3ef38a85cf96ee47c Mon Sep 17 00:00:00 2001 From: Daniel Knittl-Frank Date: Wed, 26 Oct 2022 20:47:51 +0200 Subject: [PATCH 2/2] Document Stack Overflow social link #226 --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 124c32e..e37da04 100644 --- a/README.md +++ b/README.md @@ -218,6 +218,7 @@ const config = { behance: '', medium: '', dev: '', + stackoverflow: '', website: '', phone: '', email: '', @@ -415,7 +416,7 @@ Your avatar and bio will be fetched from GitHub automatically. ### Social Links -You can link your social media services you're using, including LinkedIn, Twitter, Facebook, Instagram, Dribbble, Behance, Medium, dev, personal website, phone and email. +You can link your social media services you're using, including LinkedIn, Twitter, Facebook, Instagram, Dribbble, Behance, Medium, dev, Stack Overflow, personal website, phone and email. ```js // gitprofile.config.js @@ -430,6 +431,7 @@ module.exports = { behance: '', medium: '', dev: '', + stackoverflow: '', website: '', phone: '', email: '',