Skip to content

Commit 5346174

Browse files
authored
correct package commit link, types improvements, deps bump (#1873)
1 parent 2ef81ef commit 5346174

44 files changed

Lines changed: 239 additions & 212 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bun.lock

Lines changed: 47 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/styleguide.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ const getLinkHoverStyles = (isDark: boolean) => ({
188188
textDecorationColor: isDark ? darkColors.powder : colors.gray4,
189189
});
190190

191-
export const HoverEffect = ({ children }) => {
191+
export function HoverEffect({ children }: PropsWithChildren) {
192192
const [isHovered, setIsHovered] = useState(false);
193193
const [isActive, setIsActive] = useState(false);
194194

@@ -203,4 +203,4 @@ export const HoverEffect = ({ children }) => {
203203
{children}
204204
</View>
205205
);
206-
};
206+
}

components/CompatibilityTags.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import { StyleSheet, View } from 'react-native';
33

44
import { colors, darkColors } from '~/common/styleguide';
55
import CustomAppearanceContext from '~/context/CustomAppearanceContext';
6-
import { Library } from '~/types';
6+
import { LibraryType } from '~/types';
77

88
import { Info } from './Icons';
99
import { NewArchitectureTag } from './Library/NewArchitectureTag';
1010
import { Tag } from './Tag';
1111
import Tooltip from './Tooltip';
1212

1313
type Props = {
14-
library: Library;
14+
library: LibraryType;
1515
};
1616

1717
export function CompatibilityTags({ library }: Props) {

components/ErrorState.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ import { H2, A, P } from '~/common/styleguide';
55
import Navigation from './Navigation';
66
import PageMeta from './PageMeta';
77

8-
const ErrorState = ({ statusCode }) => {
8+
type Props = {
9+
statusCode: number;
10+
};
11+
12+
function ErrorState({ statusCode }: Props) {
913
return (
1014
<>
1115
<PageMeta title="Error" description="Uh oh, something went wrong" />
@@ -20,7 +24,7 @@ const ErrorState = ({ statusCode }) => {
2024
</View>
2125
</>
2226
);
23-
};
27+
}
2428

2529
const styles = StyleSheet.create({
2630
container: {

components/Explore/ExploreSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { A, colors, darkColors, H3, P } from '~/common/styleguide';
66
import { IconProps } from '~/components/Icons';
77
import LoadingContent from '~/components/Library/LoadingContent';
88
import CustomAppearanceContext from '~/context/CustomAppearanceContext';
9-
import { Library as LibraryType, Query } from '~/types';
9+
import { LibraryType, Query } from '~/types';
1010
import urlWithQuery from '~/util/urlWithQuery';
1111

1212
const LibraryWithLoading = dynamic(() => import('~/components/Library'), {

components/Filters/ToggleLink.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,19 @@ import Link from 'next/link';
22
import { Platform, StyleSheet, View } from 'react-native';
33

44
import { P, colors } from '~/common/styleguide';
5+
import { type Query } from '~/types';
56
import urlWithQuery from '~/util/urlWithQuery';
67

78
import { CheckBox } from '../CheckBox';
89

9-
export const ToggleLink = ({ query, paramName, title, basePath = '/' }) => {
10+
type Props = {
11+
query: Query;
12+
paramName: string;
13+
title: string;
14+
basePath?: string;
15+
};
16+
17+
export function ToggleLink({ query, paramName, title, basePath = '/' }: Props) {
1018
const isSelected = !!query[paramName];
1119

1220
return (
@@ -23,7 +31,7 @@ export const ToggleLink = ({ query, paramName, title, basePath = '/' }) => {
2331
</View>
2432
</Link>
2533
);
26-
};
34+
}
2735

2836
const styles = StyleSheet.create({
2937
link: {

components/Footer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type PlatformProps = {
2525
style?: ViewStyle;
2626
};
2727

28-
const Platform = ({ name, pkgName, url, Icon, style }: PlatformProps) => {
28+
function Platform({ name, pkgName, url, Icon, style }: PlatformProps) {
2929
const { isDark } = useContext(CustomAppearanceContext);
3030

3131
const packageHoverStyle = {
@@ -46,7 +46,7 @@ const Platform = ({ name, pkgName, url, Icon, style }: PlatformProps) => {
4646
</View>
4747
</A>
4848
);
49-
};
49+
}
5050

5151
const Footer = () => {
5252
const { isDark } = useContext(CustomAppearanceContext);

components/GoogleAnalytics.tsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
const getAnalyticsScript = (id: string) => {
1+
function getAnalyticsScript(id: string) {
22
return `
33
window.dataLayer = window.dataLayer || [];
44
function gtag(){dataLayer.push(arguments);}
55
gtag('js', new Date());
66
gtag('config', '${id}');
77
`.replace(/\n/g, '');
8-
};
8+
}
99

10-
const GoogleAnalytics = ({ id }) => (
11-
<>
12-
<script async src={`https://www.googletagmanager.com/gtag/js?id=${id}`} />
13-
<script dangerouslySetInnerHTML={{ __html: getAnalyticsScript(id) }} />
14-
</>
15-
);
10+
type Props = {
11+
id: string;
12+
};
1613

17-
export default GoogleAnalytics;
14+
export default function GoogleAnalytics({ id }: Props) {
15+
return (
16+
<>
17+
<script async src={`https://www.googletagmanager.com/gtag/js?id=${id}`} />
18+
<script dangerouslySetInnerHTML={{ __html: getAnalyticsScript(id) }} />
19+
</>
20+
);
21+
}

components/Libraries.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Image, StyleSheet, View } from 'react-native';
33

44
import { H3, A, P } from '~/common/styleguide';
55
import LoadingContent from '~/components/Library/LoadingContent';
6-
import { type Library as LibraryType } from '~/types';
6+
import { type LibraryType } from '~/types';
77

88
type Props = {
99
libraries: LibraryType[];

components/Library/MetaData.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Platform, StyleSheet, View } from 'react-native';
33

44
import { colors, A, P, Caption, darkColors } from '~/common/styleguide';
55
import CustomAppearanceContext from '~/context/CustomAppearanceContext';
6-
import { Library as LibraryType } from '~/types';
6+
import { type LibraryType } from '~/types';
77

88
import { DirectoryScore } from './DirectoryScore';
99
import {
@@ -40,7 +40,7 @@ function generateData({ github, score, npm, npmPkg }: LibraryType, isDark: boole
4040
</A>
4141
),
4242
},
43-
npm.downloads
43+
npm?.downloads
4444
? {
4545
id: 'downloads',
4646
icon: <Download fill={iconColor} width={16} height={18} />,

0 commit comments

Comments
 (0)