From f25f5bf2d5ed88394ca24adc7470eab32d00f3d6 Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Thu, 8 Sep 2022 21:46:09 +0600 Subject: [PATCH] Control avatar ring visibility --- README.md | 6 ++++++ gitprofile.config.js | 3 +++ src/components/GitProfile.jsx | 7 ++++++- src/components/avatar-card/index.jsx | 11 +++++++++-- src/helpers/utils.jsx | 1 + types/index.d.ts | 5 +++++ 6 files changed, 30 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b7fd88f..98c8dee 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,9 @@ + + + @@ -234,6 +237,9 @@ const config = { // using user system preferences, instead of the hardcoded defaultTheme respectPrefersColorScheme: true, + // Hide the ring in Profile picture + hideAvatarRing: false, + // Available themes. To remove any theme, exclude from here. themes: [ 'light', diff --git a/gitprofile.config.js b/gitprofile.config.js index a6c5c2f..948e926 100644 --- a/gitprofile.config.js +++ b/gitprofile.config.js @@ -98,6 +98,9 @@ const config = { // using user system preferences, instead of the hardcoded defaultTheme respectPrefersColorScheme: false, + // Hide the ring in Profile picture + hideAvatarRing: false, + // Available themes. To remove any theme, exclude from here. themes: [ 'light', diff --git a/src/components/GitProfile.jsx b/src/components/GitProfile.jsx index d22ce48..4310905 100644 --- a/src/components/GitProfile.jsx +++ b/src/components/GitProfile.jsx @@ -156,7 +156,11 @@ const GitProfile = ({ config }) => { themeConfig={sanitizedConfig.themeConfig} /> )} - +
{ +const AvatarCard = ({ profile, loading, avatarRing }) => { return (
@@ -18,7 +18,13 @@ const AvatarCard = ({ profile, loading }) => {
) : (
-
+
{ { AvatarCard.propTypes = { profile: PropTypes.object, loading: PropTypes.bool.isRequired, + avatarRing: PropTypes.bool.isRequired, }; export default AvatarCard; diff --git a/src/helpers/utils.jsx b/src/helpers/utils.jsx index 4a640ee..6f0ee64 100644 --- a/src/helpers/utils.jsx +++ b/src/helpers/utils.jsx @@ -177,6 +177,7 @@ export const sanitizeConfig = (config) => { disableSwitch: config?.themeConfig?.disableSwitch || false, respectPrefersColorScheme: config?.themeConfig?.respectPrefersColorScheme || false, + hideAvatarRing: config?.themeConfig?.hideAvatarRing || false, themes: themes, customTheme: customTheme, }, diff --git a/types/index.d.ts b/types/index.d.ts index 9bb711f..920947a 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -186,6 +186,11 @@ export interface ThemeConfig { */ respectPrefersColorScheme?: boolean; + /** + * Hide the ring in Profile picture + */ + hideAvatarRing?: boolean; + /** * Available themes */