Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit d6fff39

Browse files
authored
fix: removed unused code (#4178)
1 parent f3fea9e commit d6fff39

File tree

4 files changed

+2
-148
lines changed

4 files changed

+2
-148
lines changed

components/molecules/CardHorizontalBarChart/card-horizontal-bar-chart.tsx

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import { useEffect, useState } from "react";
2-
import Text from "components/atoms/Typography/text";
3-
import Tooltip from "components/atoms/Tooltip/tooltip";
42
import colors from "../../../lib/utils/color.json";
53

64
export interface AllSimpleColors {
@@ -19,22 +17,15 @@ export interface LanguageObject {
1917

2018
interface CardHorizontalBarChartProps {
2119
languageList: LanguageObject[];
22-
withDescription: boolean;
2320
}
2421

2522
const languageToColor: AllSimpleColors = colors as AllSimpleColors;
2623

27-
const CardHorizontalBarChart = ({ languageList, withDescription }: CardHorizontalBarChartProps): JSX.Element => {
24+
const CardHorizontalBarChart = ({ languageList }: CardHorizontalBarChartProps): JSX.Element => {
2825
const sortedLangArray = languageList.sort((a, b) => b.percentageUsed - a.percentageUsed);
2926
// used this state to calculate thte percentage of each language
3027
const [percentage, setPercentage] = useState<any>(0);
3128

32-
const [descriptText, setDescriptText] = useState(sortedLangArray[0]?.languageName || "javascript");
33-
34-
const handleChangeDescriptText = (descriptText: string) => {
35-
setDescriptText(descriptText);
36-
};
37-
3829
useEffect(() => {
3930
if (sortedLangArray.length === 0) return;
4031

@@ -54,7 +45,6 @@ const CardHorizontalBarChart = ({ languageList, withDescription }: CardHorizonta
5445
index < 5 && (
5546
<div
5647
key={index}
57-
onMouseOver={() => handleChangeDescriptText(languageName)}
5848
className="h-2 transition-all duration-500 ease-in-out"
5949
style={{
6050
width: `${percentageUsed < 20 ? (percentageUsed / percentage) * 100 : percentageUsed}%`,
@@ -67,21 +57,6 @@ const CardHorizontalBarChart = ({ languageList, withDescription }: CardHorizonta
6757
);
6858
})}
6959
</div>
70-
{withDescription && (
71-
<div className="flex gap-2 w-32 items-baseline">
72-
<div
73-
className={"w-2 h-2 rounded-full"}
74-
style={{
75-
backgroundColor: languageToColor[descriptText]
76-
? (languageToColor[descriptText].color as string)
77-
: NOTSUPPORTED,
78-
}}
79-
/>
80-
<Tooltip className="max-w-[100px]" content={descriptText}>
81-
<Text className="!text-xs !truncate !font-semibold !text-light-slate-11">{descriptText}</Text>
82-
</Tooltip>
83-
</div>
84-
)}
8560
</div>
8661
);
8762
};

components/molecules/PullRequestSocialCard/pull-request-social-card.stories.tsx

Lines changed: 0 additions & 41 deletions
This file was deleted.

components/molecules/PullRequestSocialCard/pull-request-social-card.tsx

Lines changed: 0 additions & 80 deletions
This file was deleted.

components/organisms/ContributorCard/contributor-card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const ContributorCard = ({
102102
</div>
103103
</div>
104104
<div className="flex flex-col items-end gap-2">
105-
<CardHorizontalBarChart withDescription={false} languageList={languageList} />
105+
<CardHorizontalBarChart languageList={languageList} />
106106
{!!isMaintainer && <Badge text="maintainer" />}
107107
</div>
108108
</div>

0 commit comments

Comments
 (0)