add animations toggle for langs card, adjust label

This commit is contained in:
martin-mfg
2025-11-04 13:40:05 +01:00
parent d91a192ed6
commit 1b373c05b3
3 changed files with 21 additions and 1 deletions
@@ -26,7 +26,7 @@ const LanguagesLayoutSection = ({ selectedOption, setSelectedOption }) => {
];
return (
<Section title="Date Range">
<Section title="Card Layout">
<p>Select a card layout.</p>
<Input
options={options}
+7
View File
@@ -53,6 +53,7 @@ const HomeScreen = () => {
const [customTitle, setCustomTitle] = useState('');
const [langsCount, setLangsCount] = useState();
const [hideProgress, setHideProgress] = useState(false);
const [enableAnimations, setEnableAnimations] = useState(true);
const resetCustomization = () => {
setSelectedTimeRange(DEFAULT_TIME_RANGE);
@@ -111,6 +112,10 @@ const HomeScreen = () => {
fullSuffix += `&langs_count=${langsCount}`;
}
if (!enableAnimations) {
fullSuffix += `&disable_animations=${!enableAnimations}`;
}
if (hideProgress) {
fullSuffix += `&hide_progress=${hideProgress}`;
}
@@ -235,6 +240,8 @@ const HomeScreen = () => {
setCustomTitle={setCustomTitle}
langsCount={langsCount}
setLangsCount={setLangsCount}
enableAnimations={enableAnimations}
setEnableAnimations={setEnableAnimations}
hideProgress={hideProgress}
setHideProgress={setHideProgress}
fullSuffix={fullSuffix}
@@ -32,6 +32,8 @@ const CustomizeStage = ({
setCustomTitle,
langsCount,
setLangsCount,
enableAnimations,
setEnableAnimations,
hideProgress,
setHideProgress,
fullSuffix,
@@ -132,6 +134,15 @@ const CustomizeStage = ({
setVariable={setHideProgress}
/>
)}
{cardType === CardTypes.TOP_LANGS && (
<CheckboxSection
title="Animations"
text="Enable Animations."
question="enable animations?"
variable={enableAnimations}
setVariable={setEnableAnimations}
/>
)}
<CheckboxSection
title="LOC Metric"
text="By default, LOC are measured as Added: (+) - (-). Alternatively, you can use Changed: (+) + (-)"
@@ -177,6 +188,8 @@ CustomizeStage.propTypes = {
setCustomTitle: PropTypes.func.isRequired,
langsCount: PropTypes.number.isRequired,
setLangsCount: PropTypes.func.isRequired,
enableAnimations: PropTypes.bool.isRequired,
setEnableAnimations: PropTypes.func.isRequired,
fullSuffix: PropTypes.string.isRequired,
};