add 'show_owner' option, no animations option for gists

This commit is contained in:
martin-mfg
2025-11-05 11:47:25 +01:00
parent ef19761d9e
commit ad186a41f9
2 changed files with 23 additions and 6 deletions
+7 -5
View File
@@ -40,17 +40,13 @@ const HomeScreen = () => {
const [selectedLayout, setSelectedLayout] = useState(DEFAULT_LAYOUT);
const [showTitle, setShowTitle] = useState(true);
const [showOwner, setShowOwner] = useState(false);
const [customTitle, setCustomTitle] = useState('');
const [langsCount, setLangsCount] = useState();
const [enableAnimations, setEnableAnimations] = useState(true);
const resetCustomization = () => {
// setUsePercent(false);
if (selectedCard === CardTypes.GIST) {
setEnableAnimations(false);
} else {
setEnableAnimations(true);
}
if (theme === 'default' || theme === 'default_repocard') {
if (selectedCard === CardTypes.PIN || selectedCard === CardTypes.GIST) {
setTheme('default_repocard');
@@ -78,6 +74,10 @@ const HomeScreen = () => {
fullSuffix += '&hide_title=true';
}
if (showOwner) {
fullSuffix += '&show_owner=true';
}
if (customTitle) {
const encodedTitle = encodeURIComponent(customTitle);
fullSuffix += `&custom_title=${encodedTitle}`;
@@ -192,6 +192,8 @@ const HomeScreen = () => {
setSelectedLayout={setSelectedLayout}
showTitle={showTitle}
setShowTitle={setShowTitle}
showOwner={showOwner}
setShowOwner={setShowOwner}
customTitle={customTitle}
setCustomTitle={setCustomTitle}
langsCount={langsCount}
@@ -13,6 +13,8 @@ const CustomizeStage = ({
setSelectedLayout,
showTitle,
setShowTitle,
showOwner,
setShowOwner,
customTitle,
setCustomTitle,
langsCount,
@@ -59,7 +61,9 @@ const CustomizeStage = ({
setSelectedOption={setSelectedLayout}
/>
)}
{cardType !== CardTypes.PIN && (
{(cardType === CardTypes.STATS ||
cardType === CardTypes.TOP_LANGS ||
cardType === CardTypes.WAKATIME) && (
<CheckboxSection
title="Animations"
text="Enable Animations."
@@ -68,6 +72,15 @@ const CustomizeStage = ({
setVariable={setEnableAnimations}
/>
)}
{cardType === CardTypes.PIN && (
<CheckboxSection
title="Show Owner?"
text="Shows the repo owner's name next to the repo name."
question="Show owner?"
variable={showOwner}
setVariable={setShowOwner}
/>
)}
</div>
<div className="w-full lg:w-3/5 md:w-1/2 object-center pt-5 md:pt-0 pl-0 md:pl-5 lg:pl-0">
<div className="w-full lg:w-3/5 mx-auto flex flex-col justify-center">
@@ -84,6 +97,8 @@ CustomizeStage.propTypes = {
setSelectedLayout: PropTypes.func.isRequired,
showTitle: PropTypes.bool.isRequired,
setShowTitle: PropTypes.func.isRequired,
showOwner: PropTypes.bool.isRequired,
setShowOwner: PropTypes.func.isRequired,
customTitle: PropTypes.string.isRequired,
setCustomTitle: PropTypes.func.isRequired,
langsCount: PropTypes.number.isRequired,