diff --git a/components/molecules/CardHorizontalBarChart/card-horizontal-bar-chart.tsx b/components/molecules/CardHorizontalBarChart/card-horizontal-bar-chart.tsx index 6db0d97dcc..7f30f24bb7 100644 --- a/components/molecules/CardHorizontalBarChart/card-horizontal-bar-chart.tsx +++ b/components/molecules/CardHorizontalBarChart/card-horizontal-bar-chart.tsx @@ -1,6 +1,4 @@ import { useEffect, useState } from "react"; -import Text from "components/atoms/Typography/text"; -import Tooltip from "components/atoms/Tooltip/tooltip"; import colors from "../../../lib/utils/color.json"; export interface AllSimpleColors { @@ -19,22 +17,15 @@ export interface LanguageObject { interface CardHorizontalBarChartProps { languageList: LanguageObject[]; - withDescription: boolean; } const languageToColor: AllSimpleColors = colors as AllSimpleColors; -const CardHorizontalBarChart = ({ languageList, withDescription }: CardHorizontalBarChartProps): JSX.Element => { +const CardHorizontalBarChart = ({ languageList }: CardHorizontalBarChartProps): JSX.Element => { const sortedLangArray = languageList.sort((a, b) => b.percentageUsed - a.percentageUsed); // used this state to calculate thte percentage of each language const [percentage, setPercentage] = useState(0); - const [descriptText, setDescriptText] = useState(sortedLangArray[0]?.languageName || "javascript"); - - const handleChangeDescriptText = (descriptText: string) => { - setDescriptText(descriptText); - }; - useEffect(() => { if (sortedLangArray.length === 0) return; @@ -54,7 +45,6 @@ const CardHorizontalBarChart = ({ languageList, withDescription }: CardHorizonta index < 5 && (
handleChangeDescriptText(languageName)} className="h-2 transition-all duration-500 ease-in-out" style={{ width: `${percentageUsed < 20 ? (percentageUsed / percentage) * 100 : percentageUsed}%`, @@ -67,21 +57,6 @@ const CardHorizontalBarChart = ({ languageList, withDescription }: CardHorizonta ); })}
- {withDescription && ( -
-
- - {descriptText} - -
- )}
); }; diff --git a/components/molecules/PullRequestSocialCard/pull-request-social-card.stories.tsx b/components/molecules/PullRequestSocialCard/pull-request-social-card.stories.tsx deleted file mode 100644 index e45f34743c..0000000000 --- a/components/molecules/PullRequestSocialCard/pull-request-social-card.stories.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import { Meta, StoryObj } from "@storybook/react"; -import PullRequestSocialCard from "components/molecules/PullRequestSocialCard/pull-request-social-card"; - -const StoryConfig: Meta = { - title: "Design System/Molecules/PullRequestSocialCard", - component: PullRequestSocialCard, -}; - -type Story = StoryObj; - -export default StoryConfig; - -export const PullRequestSocialCardStory: Story = { - args: { - prTitle: "Add support for Swift Package Manager", - orgName: "open-sauced", - repoName: "insights", - avatar: - "https://images.unsplash.com/photo-1534528741775-53994a69daeb?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1064&q=80", - - languageList: [ - { - languageName: "TypeScript", - percentageUsed: 50, - }, - { - languageName: "JavaScript", - percentageUsed: 20, - }, - { - languageName: "Rust", - percentageUsed: 15, - }, - { languageName: "React", percentageUsed: 15 }, - ], - prTicketId: "#223", - commentsCount: 5, - linesAdded: 12, - linesRemoved: 4, - }, -}; diff --git a/components/molecules/PullRequestSocialCard/pull-request-social-card.tsx b/components/molecules/PullRequestSocialCard/pull-request-social-card.tsx deleted file mode 100644 index 7cb19486ec..0000000000 --- a/components/molecules/PullRequestSocialCard/pull-request-social-card.tsx +++ /dev/null @@ -1,80 +0,0 @@ -import { IconContext } from "react-icons"; -import { VscGitPullRequest } from "react-icons/vsc"; -import { FaRegCommentAlt } from "react-icons/fa"; - -import Text from "components/atoms/Typography/text"; -import Avatar from "components/atoms/Avatar/avatar"; -import CardHorizontalBarChart, { LanguageObject } from "../CardHorizontalBarChart/card-horizontal-bar-chart"; - -interface PullRequestSocialCardProps { - orgName: string; - repoName: string; - languageList: LanguageObject[]; - prTicketId: string; - prTitle: string; - commentsCount?: number; - avatar?: string; - linesAdded?: number; - linesRemoved?: number; -} -const PullRequestSocialCard = ({ - orgName, - repoName, - prTitle, - avatar, - languageList, - prTicketId, - commentsCount, - linesAdded, - linesRemoved, -}: PullRequestSocialCardProps) => { - return ( -
-
- - - {orgName}/{repoName} - -
-
- - - - - {prTicketId} {prTitle} - -
- - {/* Language list section */} -
- -
- -
-
- - +{linesAdded || 0} - - - - -{linesRemoved || 0} - -
-
-
-
-
-
-
-
- {commentsCount && ( -
- {`${commentsCount} comment${commentsCount > 1 ? "s" : ""}`} -
- )} -
-
- ); -}; - -export default PullRequestSocialCard; diff --git a/components/organisms/ContributorCard/contributor-card.tsx b/components/organisms/ContributorCard/contributor-card.tsx index 8c00823e30..a14d9ceda2 100644 --- a/components/organisms/ContributorCard/contributor-card.tsx +++ b/components/organisms/ContributorCard/contributor-card.tsx @@ -102,7 +102,7 @@ const ContributorCard = ({
- + {!!isMaintainer && }