make step 1 values defaults, reorder customization options, adapt labels
This commit is contained in:
@@ -20,8 +20,8 @@ const StatsRankSection = ({ selectedOption, setSelectedOption }) => {
|
||||
];
|
||||
|
||||
return (
|
||||
<Section title="Card Layout">
|
||||
<p>Select a card layout.</p>
|
||||
<Section title="Rank Style">
|
||||
<p>Select a rank style.</p>
|
||||
<Input
|
||||
options={options}
|
||||
selectedOption={selectedOption || DEFAULT_OPTION}
|
||||
|
||||
@@ -60,13 +60,20 @@ const HomeScreen = () => {
|
||||
const [usePercent, setUsePercent] = useState(false);
|
||||
|
||||
const resetCustomization = () => {
|
||||
// setUsePercent(false);
|
||||
if (selectedCard === CardTypes.TOP_LANGS) {
|
||||
setLangsCount(4);
|
||||
}
|
||||
if (selectedCard === CardTypes.WAKATIME) {
|
||||
setLangsCount(6);
|
||||
}
|
||||
|
||||
if (selectedCard === CardTypes.TOP_LANGS) {
|
||||
setSelectedWakatimeLayout(WAKATIME_DEFAULT_LAYOUT);
|
||||
}
|
||||
if (selectedCard === CardTypes.WAKATIME) {
|
||||
setSelectedLanguagesLayout(LANGUAGES_DEFAULT_LAYOUT);
|
||||
}
|
||||
|
||||
if (theme === 'default' || theme === 'default_repocard') {
|
||||
if (selectedCard === CardTypes.PIN || selectedCard === CardTypes.GIST) {
|
||||
setTheme('default_repocard');
|
||||
|
||||
@@ -43,6 +43,71 @@ const CustomizeStage = ({
|
||||
return (
|
||||
<div className="w-full flex flex-wrap">
|
||||
<div className="h-auto lg:w-2/5 md:w-1/2 pr-10 p-10 rounded-sm bg-gray-200">
|
||||
{cardType === CardTypes.STATS && (
|
||||
<CheckboxSection
|
||||
title="Show All Stats?"
|
||||
text="Show all available statistics."
|
||||
question="Show all stats?"
|
||||
variable={showAllStats}
|
||||
setVariable={setShowAllStats}
|
||||
/>
|
||||
)}
|
||||
{cardType === CardTypes.STATS && (
|
||||
<StatsRankSection
|
||||
selectedOption={selectedStatsRank}
|
||||
setSelectedOption={setSelectedStatsRank}
|
||||
/>
|
||||
)}
|
||||
{cardType === CardTypes.STATS && (
|
||||
<CheckboxSection
|
||||
title="Show Icons?"
|
||||
text="Show icons next to all stats."
|
||||
question="Show Icons?"
|
||||
variable={showIcons}
|
||||
setVariable={setShowIcons}
|
||||
/>
|
||||
)}
|
||||
{cardType === CardTypes.STATS && (
|
||||
<CheckboxSection
|
||||
title="Include All Commits?"
|
||||
text="Count total commits or just commits of the last 365 days."
|
||||
question="Include all commits?"
|
||||
variable={includeAllCommits}
|
||||
setVariable={setIncludeAllCommits}
|
||||
/>
|
||||
)}
|
||||
{cardType === CardTypes.TOP_LANGS && (
|
||||
<LanguagesLayoutSection
|
||||
selectedOption={selectedLanguagesLayout}
|
||||
setSelectedOption={setSelectedLanguagesLayout}
|
||||
/>
|
||||
)}
|
||||
{cardType === CardTypes.WAKATIME && (
|
||||
<WakatimeLayoutSection
|
||||
selectedOption={selectedWakatimeLayout}
|
||||
setSelectedOption={setSelectedWakatimeLayout}
|
||||
/>
|
||||
)}
|
||||
{(cardType === CardTypes.TOP_LANGS ||
|
||||
cardType === CardTypes.WAKATIME) && (
|
||||
<NumericSection
|
||||
title="Language Count"
|
||||
text="Set the number of languages to be shown.<br>Leave empty for default count."
|
||||
value={langsCount}
|
||||
setValue={setLangsCount}
|
||||
min={1}
|
||||
max={20}
|
||||
/>
|
||||
)}
|
||||
{cardType === CardTypes.WAKATIME && (
|
||||
<CheckboxSection
|
||||
title="Show Percentages?"
|
||||
text="Show time spent in hours or percentages."
|
||||
question="Show percentages?"
|
||||
variable={usePercent}
|
||||
setVariable={setUsePercent}
|
||||
/>
|
||||
)}
|
||||
{(cardType === CardTypes.STATS ||
|
||||
cardType === CardTypes.TOP_LANGS ||
|
||||
cardType === CardTypes.WAKATIME) && (
|
||||
@@ -63,35 +128,6 @@ const CustomizeStage = ({
|
||||
setValue={setCustomTitle}
|
||||
/>
|
||||
)}
|
||||
{(cardType === CardTypes.TOP_LANGS ||
|
||||
cardType === CardTypes.WAKATIME) && (
|
||||
<NumericSection
|
||||
title="Language Count"
|
||||
text="Set the number of languages to be shown.<br>Leave empty for default count."
|
||||
value={langsCount}
|
||||
setValue={setLangsCount}
|
||||
min={1}
|
||||
max={20}
|
||||
/>
|
||||
)}
|
||||
{cardType === CardTypes.STATS && (
|
||||
<StatsRankSection
|
||||
selectedOption={selectedStatsRank}
|
||||
setSelectedOption={setSelectedStatsRank}
|
||||
/>
|
||||
)}
|
||||
{cardType === CardTypes.TOP_LANGS && (
|
||||
<LanguagesLayoutSection
|
||||
selectedOption={selectedLanguagesLayout}
|
||||
setSelectedOption={setSelectedLanguagesLayout}
|
||||
/>
|
||||
)}
|
||||
{cardType === CardTypes.WAKATIME && (
|
||||
<WakatimeLayoutSection
|
||||
selectedOption={selectedWakatimeLayout}
|
||||
setSelectedOption={setSelectedWakatimeLayout}
|
||||
/>
|
||||
)}
|
||||
{(cardType === CardTypes.STATS ||
|
||||
cardType === CardTypes.TOP_LANGS ||
|
||||
cardType === CardTypes.WAKATIME) && (
|
||||
@@ -122,42 +158,6 @@ const CustomizeStage = ({
|
||||
max={3}
|
||||
/>
|
||||
)}
|
||||
{cardType === CardTypes.WAKATIME && (
|
||||
<CheckboxSection
|
||||
title="Show Percentages?"
|
||||
text="Show time spent in hours or percentages."
|
||||
question="Show percentages?"
|
||||
variable={usePercent}
|
||||
setVariable={setUsePercent}
|
||||
/>
|
||||
)}
|
||||
{cardType === CardTypes.STATS && (
|
||||
<CheckboxSection
|
||||
title="Show Icons?"
|
||||
text="Show icons next to all stats."
|
||||
question="Show Icons?"
|
||||
variable={showIcons}
|
||||
setVariable={setShowIcons}
|
||||
/>
|
||||
)}
|
||||
{cardType === CardTypes.STATS && (
|
||||
<CheckboxSection
|
||||
title="Show All Stats?"
|
||||
text="Show all available statistics."
|
||||
question="Show all stats?"
|
||||
variable={showAllStats}
|
||||
setVariable={setShowAllStats}
|
||||
/>
|
||||
)}
|
||||
{cardType === CardTypes.STATS && (
|
||||
<CheckboxSection
|
||||
title="Include All Commits?"
|
||||
text="Count total commits or just commits of the last 365 days."
|
||||
question="Include all commits?"
|
||||
variable={includeAllCommits}
|
||||
setVariable={setIncludeAllCommits}
|
||||
/>
|
||||
)}
|
||||
</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">
|
||||
|
||||
Reference in New Issue
Block a user