mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-08-23 06:42:15 +10:00
chore: lint using react-doctor, update translations, dynamic imports
This commit is contained in:
@@ -19,13 +19,17 @@ export function getNextWeights(fontFamily: string): Weight[] | null {
|
||||
if (uniqueWeights.includes("400")) weights.push("400");
|
||||
if (uniqueWeights.includes("600")) weights.push("600");
|
||||
|
||||
const selectedWeights = new Set(weights);
|
||||
|
||||
// If we didn't find both, fill in with first/last, ensuring uniqueness
|
||||
while (weights.length < 2 && uniqueWeights.length > 0) {
|
||||
// candidateIndex: 0 (first), 1 (last)
|
||||
const lastIndex = uniqueWeights.length - 1;
|
||||
const candidate = weights.length === 0 ? uniqueWeights[0] : uniqueWeights[lastIndex];
|
||||
if (!weights.includes(candidate)) weights.push(candidate);
|
||||
else break;
|
||||
if (!selectedWeights.has(candidate)) {
|
||||
weights.push(candidate);
|
||||
selectedWeights.add(candidate);
|
||||
} else break;
|
||||
}
|
||||
|
||||
return weights.length > 0 ? weights : null;
|
||||
|
||||
Reference in New Issue
Block a user