add top-langs option 'hide_progress'
This commit is contained in:
@@ -54,6 +54,7 @@ const HomeScreen = () => {
|
||||
const [showTitle, setShowTitle] = useState(true);
|
||||
const [customTitle, setCustomTitle] = useState('');
|
||||
const [langsCount, setLangsCount] = useState();
|
||||
const [hideProgress, setHideProgress] = useState(false);
|
||||
|
||||
const resetCustomization = () => {
|
||||
setSelectedTimeRange(defaultTimeRange);
|
||||
@@ -109,6 +110,10 @@ const HomeScreen = () => {
|
||||
fullSuffix += `&langs_count=${langsCount}`;
|
||||
}
|
||||
|
||||
if (hideProgress) {
|
||||
fullSuffix += `&hide_progress=${hideProgress}`;
|
||||
}
|
||||
|
||||
// for stage three
|
||||
const [theme, setTheme] = useState('default');
|
||||
const themeSuffix = `${fullSuffix}&theme=${theme}`;
|
||||
@@ -227,6 +232,8 @@ const HomeScreen = () => {
|
||||
setCustomTitle={setCustomTitle}
|
||||
langsCount={langsCount}
|
||||
setLangsCount={setLangsCount}
|
||||
hideProgress={hideProgress}
|
||||
setHideProgress={setHideProgress}
|
||||
fullSuffix={fullSuffix}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -29,6 +29,8 @@ const CustomizeStage = ({
|
||||
setCustomTitle,
|
||||
langsCount,
|
||||
setLangsCount,
|
||||
hideProgress,
|
||||
setHideProgress,
|
||||
fullSuffix,
|
||||
}) => {
|
||||
const cardType = selectedCard || CardTypes.STATS;
|
||||
@@ -113,6 +115,15 @@ const CustomizeStage = ({
|
||||
disabled={useCompact}
|
||||
/>
|
||||
)}
|
||||
{cardType === CardTypes.TOP_LANGS && (
|
||||
<CheckboxSection
|
||||
title="Compact View"
|
||||
text="Use default view or compact view."
|
||||
question="Use compact view?"
|
||||
variable={hideProgress}
|
||||
setVariable={setHideProgress}
|
||||
/>
|
||||
)}
|
||||
<CheckboxSection
|
||||
title="LOC Metric"
|
||||
text="By default, LOC are measured as Added: (+) - (-). Alternatively, you can use Changed: (+) + (-)"
|
||||
@@ -144,6 +155,8 @@ CustomizeStage.propTypes = {
|
||||
privateAccess: PropTypes.bool.isRequired,
|
||||
useCompact: PropTypes.bool.isRequired,
|
||||
setUseCompact: PropTypes.func.isRequired,
|
||||
hideProgress: PropTypes.bool.isRequired,
|
||||
setHideProgress: PropTypes.func.isRequired,
|
||||
usePercent: PropTypes.bool.isRequired,
|
||||
setUsePercent: PropTypes.func.isRequired,
|
||||
useLocChanged: PropTypes.bool.isRequired,
|
||||
|
||||
Reference in New Issue
Block a user