Skip to content

Commit

Permalink
fix: fix package name color in dark theme (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyo837 authored Dec 9, 2023
1 parent cdc16c9 commit 247480c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/components/PackageCard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@
min-width: 0;
}

.title {
.title,
.darkTitle {
color: #314659;
font-size: 20px;
line-height: 24px;
}

.darkTitle {
color: #fff;
}

.descriptionCon {
color: #333;
font-size: 14px;
Expand Down
5 changes: 4 additions & 1 deletion src/components/PackageCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { SearchPackageResult } from '@/hooks/useSearch';
import { Card, Col, Row, Space, Tag, Tooltip } from 'antd';
import { ThemeMode } from 'antd-style';
import Link from 'next/link';
import styles from './PackageCard.module.css';
import SkeletonText from './SkeletonText';
Expand Down Expand Up @@ -40,9 +41,11 @@ export function PackageTag({ tags, closeIcon, onClose }: { tags: {label: string,
export const PackageCard = ({
package: pkg,
loading = false,
themeMode,
}: {
package: SearchPackageResult;
loading?: boolean;
themeMode: ThemeMode,
}) => {
return (
<Link href={`/package/${pkg.name}`} target="_blank">
Expand All @@ -57,7 +60,7 @@ export const PackageCard = ({
<div className={styles.content}>
<Row style={{ flexWrap: 'nowrap' }}>
<Col flex="auto" style={{ minWidth: 0 }}>
<SkeletonText className={styles.title} loading={loading} title={pkg.name} ellipsis>
<SkeletonText className={themeMode === 'dark' ? styles.darkTitle :styles.title} loading={loading} title={pkg.name} ellipsis>
{pkg.name}@{pkg.version}
</SkeletonText>
</Col>
Expand Down
1 change: 1 addition & 0 deletions src/pages/packages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default function Packages({ page: initPage, q: initQ }: PageType) {
return (
<Col span={24} key={index}>
<PackageCard
themeMode={themeMode as ThemeMode}
loading={isLoading}
package={item.package}
key={item.package?.name || index}
Expand Down

0 comments on commit 247480c

Please sign in to comment.