Skip to content

Commit 0d01182

Browse files
chore: use single quote
1 parent a2aac1f commit 0d01182

Some content is hidden

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

50 files changed

+219
-223
lines changed

.eslintrc.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
module.exports = {
33
extends: [
44
// https://github.com/sozonome/eslint-config-sznm#readme
5-
"sznm/react",
5+
'sznm/react',
66
// https://github.com/sozonome/eslint-config-sznm#-nextjs-projects
7-
"plugin:react/jsx-runtime",
8-
"plugin:@next/next/recommended",
7+
'plugin:react/jsx-runtime',
8+
'plugin:@next/next/recommended',
99
],
1010
};

.prettierrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"endOfLine": "lf",
33
"semi": true,
4-
"singleQuote": false,
4+
"singleQuote": true,
55
"tabWidth": 2,
66
"trailingComma": "es5"
77
}

CHANGELOG.md

+11-15
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,33 @@ All notable changes to this project will be documented in this file. See [standa
66

77
### [1.1.2](https://github.com/sozonome/pub-apis/compare/v1.1.1...v1.1.2) (2022-06-22)
88

9-
109
### Bug Fixes
1110

12-
* update category response type ([#63](https://github.com/sozonome/pub-apis/issues/63)) ([adf4249](https://github.com/sozonome/pub-apis/commit/adf4249cedc93f68cff1399c6d22d62f953b1d82))
11+
- update category response type ([#63](https://github.com/sozonome/pub-apis/issues/63)) ([adf4249](https://github.com/sozonome/pub-apis/commit/adf4249cedc93f68cff1399c6d22d62f953b1d82))
1312

1413
### [1.1.1](https://github.com/sozonome/pub-apis/compare/v1.1.0...v1.1.1) (2022-06-13)
1514

16-
1715
### Bug Fixes
1816

19-
* improve item rendering to use more unique key ([6b1fbd0](https://github.com/sozonome/pub-apis/commit/6b1fbd0273c68d0c771b526e2cddc10204eb29cd))
20-
* **layout:** switch next/image with chakra img ([#58](https://github.com/sozonome/pub-apis/issues/58)) ([e77570d](https://github.com/sozonome/pub-apis/commit/e77570d86f65d5e0a17cfec2d8ae80f662de3927))
17+
- improve item rendering to use more unique key ([6b1fbd0](https://github.com/sozonome/pub-apis/commit/6b1fbd0273c68d0c771b526e2cddc10204eb29cd))
18+
- **layout:** switch next/image with chakra img ([#58](https://github.com/sozonome/pub-apis/issues/58)) ([e77570d](https://github.com/sozonome/pub-apis/commit/e77570d86f65d5e0a17cfec2d8ae80f662de3927))
2119

2220
## [1.1.0](https://github.com/sozonome/pub-apis/compare/v1.0.1...v1.1.0) (2021-12-18)
2321

24-
2522
### Features
2623

27-
* **analytics:** switch from google analytics to umami ([#31](https://github.com/sozonome/pub-apis/issues/31)) ([91a498d](https://github.com/sozonome/pub-apis/commit/91a498d8b265274a6fffab76a6b8663d8a6121a4))
28-
* **layout:** add close button for menu drawer ([be57f4f](https://github.com/sozonome/pub-apis/commit/be57f4fff98a510f7807bfd69b8bb282fb360e81))
24+
- **analytics:** switch from google analytics to umami ([#31](https://github.com/sozonome/pub-apis/issues/31)) ([91a498d](https://github.com/sozonome/pub-apis/commit/91a498d8b265274a6fffab76a6b8663d8a6121a4))
25+
- **layout:** add close button for menu drawer ([be57f4f](https://github.com/sozonome/pub-apis/commit/be57f4fff98a510f7807bfd69b8bb282fb360e81))
2926

3027
### [1.0.1](https://github.com/sozonome/pub-apis/compare/v1.0.0...v1.0.1) (2021-05-03)
3128

3229
## 1.0.0 (2021-03-28)
3330

34-
3531
### Features
3632

37-
* add AppMenu ([3b5ff0c](https://github.com/sozonome/pub-apis/commit/3b5ff0c84c3030fc4b22eb739f12dacb73e55550))
38-
* add link and copy button ([78112a2](https://github.com/sozonome/pub-apis/commit/78112a2b71063c39f24c0c2c385d118454a11106))
39-
* add quick search in /all ([#1](https://github.com/sozonome/pub-apis/issues/1)) ([58b1f36](https://github.com/sozonome/pub-apis/commit/58b1f36bebe6616a07f79ac22a7061fdc4412163))
40-
* add SearchContainer ([95913f1](https://github.com/sozonome/pub-apis/commit/95913f1b4afc20fa2dae957a475d5df9f55549c2))
41-
* add useAccordion props ([a0db791](https://github.com/sozonome/pub-apis/commit/a0db7911270e1d9a31f45e914e5b73eb25329a3e))
42-
* handle search ([4076cab](https://github.com/sozonome/pub-apis/commit/4076cabf0d1c1c0af60cef4ae0b5d63eccee32a1))
33+
- add AppMenu ([3b5ff0c](https://github.com/sozonome/pub-apis/commit/3b5ff0c84c3030fc4b22eb739f12dacb73e55550))
34+
- add link and copy button ([78112a2](https://github.com/sozonome/pub-apis/commit/78112a2b71063c39f24c0c2c385d118454a11106))
35+
- add quick search in /all ([#1](https://github.com/sozonome/pub-apis/issues/1)) ([58b1f36](https://github.com/sozonome/pub-apis/commit/58b1f36bebe6616a07f79ac22a7061fdc4412163))
36+
- add SearchContainer ([95913f1](https://github.com/sozonome/pub-apis/commit/95913f1b4afc20fa2dae957a475d5df9f55549c2))
37+
- add useAccordion props ([a0db791](https://github.com/sozonome/pub-apis/commit/a0db7911270e1d9a31f45e914e5b73eb25329a3e))
38+
- handle search ([4076cab](https://github.com/sozonome/pub-apis/commit/4076cabf0d1c1c0af60cef4ae0b5d63eccee32a1))

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ You can start editing the page by modifying `src/pages/index.js`. The page auto-
3535
## TODO
3636

3737
- [ ] setup lint
38-
- [ ] setup pre-commit hooks (husky, lint-staged)
38+
- [ ] setup pre-commit hooks (husky, lint-staged)

commitlint.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @type {import('@commitlint/types').UserConfig} */
22
const CommitlintConfigurations = {
3-
extends: ["@commitlint/config-conventional"],
4-
}
3+
extends: ['@commitlint/config-conventional'],
4+
};
55

66
module.exports = CommitlintConfigurations;

next-seo.config.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
/** @type {import('next-seo').DefaultSeoProps} */
22
const defaultSEOConfig = {
3-
title: "Public APIs",
4-
titleTemplate: "%s | Public APIs",
5-
defaultTitle: "Public APIs",
6-
description: "Find public APIs for your next projects.",
7-
canonical: "https://publicapis.sznm.dev",
3+
title: 'Public APIs',
4+
titleTemplate: '%s | Public APIs',
5+
defaultTitle: 'Public APIs',
6+
description: 'Find public APIs for your next projects.',
7+
canonical: 'https://publicapis.sznm.dev',
88
openGraph: {
9-
url: "https://publicapis.sznm.dev",
10-
title: "pub-apis",
11-
description: "Find public APIs for your next projects.",
9+
url: 'https://publicapis.sznm.dev',
10+
title: 'pub-apis',
11+
description: 'Find public APIs for your next projects.',
1212
images: [
1313
{
14-
url: "https://og-image.sznm.dev/**publicapis**.sznm.dev.png?theme=dark&md=1&fontSize=125px&images=https%3A%2F%2Fsznm.dev%2Favataaars.svg&widths=250",
15-
alt: "publicapis.sznm.dev og-image",
14+
url: 'https://og-image.sznm.dev/**publicapis**.sznm.dev.png?theme=dark&md=1&fontSize=125px&images=https%3A%2F%2Fsznm.dev%2Favataaars.svg&widths=250',
15+
alt: 'publicapis.sznm.dev og-image',
1616
},
1717
],
18-
site_name: "publicapis",
18+
site_name: 'publicapis',
1919
},
2020
twitter: {
21-
handle: "@sozonome",
22-
cardType: "summary_large_image",
21+
handle: '@sozonome',
22+
cardType: 'summary_large_image',
2323
},
2424
};
2525

next-sitemap.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @type {import('next-sitemap').IConfig} */
22
const NextSitemapConfig = {
3-
siteUrl: "https://publicapis.sznm.dev",
3+
siteUrl: 'https://publicapis.sznm.dev',
44
generateRobotsTxt: true,
55
};
66

next.config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
const withPWA = require("next-pwa")({
2-
disable: process.env.NODE_ENV === "development",
1+
const withPWA = require('next-pwa')({
2+
disable: process.env.NODE_ENV === 'development',
33
// to re-generate manifest.json, visit https://tomitm.github.io/appmanifest/
4-
dest: "public",
4+
dest: 'public',
55
register: true,
66
});
77

88
/** @type {import('next').NextConfig} */
99
module.exports = withPWA({
1010
reactStrictMode: true,
1111
eslint: {
12-
dirs: ["src"],
12+
dirs: ['src'],
1313
},
1414
});

src/lib/components/item/ItemCard.tsx

+10-10
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import {
99
Text,
1010
useColorMode,
1111
useToast,
12-
} from "@chakra-ui/react";
13-
import { AiFillCheckCircle, AiFillCloseCircle } from "react-icons/ai";
14-
import { ImCopy } from "react-icons/im";
12+
} from '@chakra-ui/react';
13+
import { AiFillCheckCircle, AiFillCloseCircle } from 'react-icons/ai';
14+
import { ImCopy } from 'react-icons/im';
1515

16-
import type { APIEntry } from "lib/services/publicapis/list/types";
16+
import type { APIEntry } from 'lib/services/publicapis/list/types';
1717

18-
type APIDetailsProps = Omit<APIEntry, "API" | "Description" | "Link">;
18+
type APIDetailsProps = Omit<APIEntry, 'API' | 'Description' | 'Link'>;
1919

2020
const APIDetails = ({ Category, HTTPS, Cors, Auth }: APIDetailsProps) => {
2121
return (
@@ -66,29 +66,29 @@ const ItemCard = ({ value }: ItemCardProps) => {
6666
navigator.clipboard.writeText(APILink);
6767
toast({
6868
description: `"${APILink}" copied to clipboard!`,
69-
status: "success",
69+
status: 'success',
7070
isClosable: true,
7171
duration: 9000,
72-
position: "top-right",
72+
position: 'top-right',
7373
});
7474
};
7575

7676
return (
7777
<Grid
7878
padding={{ base: 4, md: 8 }}
7979
border="1px solid"
80-
borderColor={colorMode === "light" ? "gray.200" : "gray.400"}
80+
borderColor={colorMode === 'light' ? 'gray.200' : 'gray.400'}
8181
borderRadius={24}
8282
transition="ease-out 0.3s"
8383
_hover={{
84-
transform: "scale(1.02)",
84+
transform: 'scale(1.02)',
8585
}}
8686
gap={4}
8787
role="group"
8888
as={Link}
8989
href={APILink}
9090
style={{
91-
textDecoration: "none",
91+
textDecoration: 'none',
9292
}}
9393
position="relative"
9494
>

src/lib/components/item/ItemContainer.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Grid } from "@chakra-ui/react";
1+
import { Grid } from '@chakra-ui/react';
22

3-
import type { APIEntry } from "lib/services/publicapis/list/types";
3+
import type { APIEntry } from 'lib/services/publicapis/list/types';
44

5-
import ItemCard from "./ItemCard";
5+
import ItemCard from './ItemCard';
66

77
type ItemContainerProps = {
88
entries: Array<APIEntry>;
@@ -12,7 +12,7 @@ const ItemContainer = ({ entries }: ItemContainerProps) => {
1212
return (
1313
<Grid
1414
marginY={4}
15-
templateColumns={["repeat(1)", "repeat(1fr)", "repeat(2, 1fr)"]}
15+
templateColumns={['repeat(1)', 'repeat(1fr)', 'repeat(2, 1fr)']}
1616
gap={8}
1717
>
1818
{entries.map((entry) => (

src/lib/components/list/PageNavigationButtons.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Grid, Button } from "@chakra-ui/react";
2-
import { AiOutlineArrowLeft, AiOutlineArrowRight } from "react-icons/ai";
1+
import { Grid, Button } from '@chakra-ui/react';
2+
import { AiOutlineArrowLeft, AiOutlineArrowRight } from 'react-icons/ai';
33

44
export type PageNavigationButtonsProps = {
55
currentPage: number;
6-
handleChangePage: (type: "next" | "prev") => () => void;
6+
handleChangePage: (type: 'next' | 'prev') => () => void;
77
lastPage: number;
88
};
99

@@ -23,15 +23,15 @@ const PageNavigationButtons = ({
2323
disabled={currentPage === 0}
2424
leftIcon={<AiOutlineArrowLeft />}
2525
colorScheme="cyan"
26-
onClick={handleChangePage("prev")}
26+
onClick={handleChangePage('prev')}
2727
>
2828
Prev
2929
</Button>
3030
<Button
3131
disabled={currentPage === lastPage}
3232
rightIcon={<AiOutlineArrowRight />}
3333
colorScheme="yellow"
34-
onClick={handleChangePage("next")}
34+
onClick={handleChangePage('next')}
3535
>
3636
Next
3737
</Button>

src/lib/components/search/SearchContainer.tsx

+23-23
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ import {
1818
Stack,
1919
Text,
2020
useToast,
21-
} from "@chakra-ui/react";
22-
import type { FormikErrors } from "formik";
23-
import { useFormik } from "formik";
24-
import type { ChangeEvent, ReactText } from "react";
25-
import { useState } from "react";
21+
} from '@chakra-ui/react';
22+
import type { FormikErrors } from 'formik';
23+
import { useFormik } from 'formik';
24+
import type { ChangeEvent, ReactText } from 'react';
25+
import { useState } from 'react';
2626

27-
import ItemContainer from "lib/components/item/ItemContainer";
28-
import { useApiList } from "lib/services/publicapis/list";
29-
import type { APIListParams } from "lib/services/publicapis/list/types";
30-
import { formikSubmitButtonDisabled } from "lib/utils/formikSubmitButtonDisabled";
27+
import ItemContainer from 'lib/components/item/ItemContainer';
28+
import { useApiList } from 'lib/services/publicapis/list';
29+
import type { APIListParams } from 'lib/services/publicapis/list/types';
30+
import { formikSubmitButtonDisabled } from 'lib/utils/formikSubmitButtonDisabled';
3131

32-
import type { SearchContainerProps } from "./types";
32+
import type { SearchContainerProps } from './types';
3333

3434
type SearchFormValueType = {
3535
queryParams: APIListParams;
@@ -41,7 +41,7 @@ type SearchFormValueType = {
4141

4242
const INITIAL_VALUES: SearchFormValueType = {
4343
queryParams: {
44-
title: "",
44+
title: '',
4545
},
4646
searchDescription: false,
4747
selectCategory: false,
@@ -85,17 +85,17 @@ const SearchContainer = ({ categories }: SearchContainerProps) => {
8585

8686
if (formValues.queryParams.https !== undefined && emptyQueries) {
8787
formErrors.queryParams = { ...formErrors.queryParams };
88-
formErrors.queryParams.title = "Title must not be empty";
88+
formErrors.queryParams.title = 'Title must not be empty';
8989
}
9090

9191
if (formValues.selectCategory && !formValues.queryParams.category) {
9292
formErrors.queryParams = { ...formErrors.queryParams };
93-
formErrors.queryParams.category = "Category must be selected";
93+
formErrors.queryParams.category = 'Category must be selected';
9494
}
9595

9696
if (formValues.searchDescription && !formValues.queryParams.description) {
9797
formErrors.queryParams = { ...formErrors.queryParams };
98-
formErrors.queryParams.description = "Description must be selected";
98+
formErrors.queryParams.description = 'Description must be selected';
9999
}
100100

101101
return formErrors;
@@ -113,11 +113,11 @@ const SearchContainer = ({ categories }: SearchContainerProps) => {
113113
if (shouldFetch && isError) {
114114
toast.closeAll();
115115
toast({
116-
position: "top",
117-
title: "Error",
116+
position: 'top',
117+
title: 'Error',
118118
description:
119-
"Error fetching data. Check your internet connection and try to refresh the page.",
120-
status: "error",
119+
'Error fetching data. Check your internet connection and try to refresh the page.',
120+
status: 'error',
121121
isClosable: true,
122122
duration: 10000,
123123
});
@@ -153,7 +153,7 @@ const SearchContainer = ({ categories }: SearchContainerProps) => {
153153
<AccordionPanel>
154154
<Stack spacing={2}>
155155
<Grid
156-
templateColumns={{ sm: "1fr", md: "repeat(2,1fr)" }}
156+
templateColumns={{ sm: '1fr', md: 'repeat(2,1fr)' }}
157157
gap={{ sm: 0, md: 4 }}
158158
>
159159
<Box>
@@ -163,7 +163,7 @@ const SearchContainer = ({ categories }: SearchContainerProps) => {
163163
name="searchDescription"
164164
onChange={(e: ChangeEvent<HTMLInputElement>) => {
165165
setFieldValue(
166-
"searchDescription",
166+
'searchDescription',
167167
e.target.checked
168168
);
169169
}}
@@ -193,7 +193,7 @@ const SearchContainer = ({ categories }: SearchContainerProps) => {
193193
isChecked={selectCategory}
194194
name="selectCategory"
195195
onChange={(e: ChangeEvent<HTMLInputElement>) => {
196-
setFieldValue("selectCategory", e.target.checked);
196+
setFieldValue('selectCategory', e.target.checked);
197197
}}
198198
>
199199
Select Category
@@ -227,8 +227,8 @@ const SearchContainer = ({ categories }: SearchContainerProps) => {
227227
name="queryParams.https"
228228
onChange={(e: ReactText) => {
229229
setFieldValue(
230-
"queryParams.https",
231-
e === "undefined"
230+
'queryParams.https',
231+
e === 'undefined'
232232
? undefined
233233
: JSON.parse(e.toString())
234234
);

src/lib/components/search/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { CategoriesData } from "lib/services/publicapis/category/types";
1+
import type { CategoriesData } from 'lib/services/publicapis/category/types';
22

33
export type SearchContainerProps = {
44
categories?: CategoriesData;

src/lib/constants/events.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// event types
2-
export const EVENT_TYPE_LINK = "link";
3-
export const EVENT_TYPE_CTA = "cta";
4-
export const EVENT_TYPE_NAVIGATE = "navigate";
2+
export const EVENT_TYPE_LINK = 'link';
3+
export const EVENT_TYPE_CTA = 'cta';
4+
export const EVENT_TYPE_NAVIGATE = 'navigate';

src/lib/constants/umami.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export const UMAMI_WEBSITE_ID = process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID ?? "";
2-
export const UMAMI_SRC = process.env.NEXT_PUBLIC_UMAMI_SRC ?? "";
1+
export const UMAMI_WEBSITE_ID = process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID ?? '';
2+
export const UMAMI_SRC = process.env.NEXT_PUBLIC_UMAMI_SRC ?? '';

0 commit comments

Comments
 (0)