Skip to content

Commit 9841e55

Browse files
committed
🚧(project) add zotero connector to call api
1 parent 6abe7fd commit 9841e55

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

src/frontend/apps/impress/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
"dependencies": {
1818
"@ag-media/react-pdf-table": "2.0.3",
1919
"@blocknote/code-block": "0.31.1",
20-
"blocknote/core": "https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/core@1732",
2120
"@blocknote/mantine": "0.31.1",
22-
"blocknote/react": "https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/react@1732",
2321
"@blocknote/xl-docx-exporter": "0.31.1",
2422
"@blocknote/xl-pdf-exporter": "0.31.1",
2523
"@emoji-mart/data": "1.2.1",
@@ -32,6 +30,8 @@
3230
"@react-pdf/renderer": "4.3.0",
3331
"@sentry/nextjs": "9.22.0",
3432
"@tanstack/react-query": "5.77.1",
33+
"blocknote/core": "https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/core@1732",
34+
"blocknote/react": "https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/react@1732",
3535
"canvg": "4.0.3",
3636
"clsx": "2.1.1",
3737
"cmdk": "1.1.1",
@@ -55,6 +55,7 @@
5555
"use-debounce": "10.0.4",
5656
"y-protocols": "1.0.6",
5757
"yjs": "*",
58+
"zotero-api-client": "^0.47.0",
5859
"zustand": "5.0.5"
5960
},
6061
"devDependencies": {

src/frontend/apps/impress/src/pages/404.tsx

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
11
import { Button } from '@openfun/cunningham-react';
22
import Image from 'next/image';
3-
import { ReactElement } from 'react';
3+
import { ReactElement, useCallback } from 'react';
44
import { useTranslation } from 'react-i18next';
55
import styled from 'styled-components';
66

7+
import api from 'zotero-api-client';
78
import img403 from '@/assets/icons/icon-403.png';
8-
import { Box, Icon, StyledLink, Text } from '@/components';
9+
import { Box, Icon, Text } from '@/components';
910
import { PageLayout } from '@/layouts';
1011
import { NextPageWithLayout } from '@/types/next';
1112

13+
1214
const StyledButton = styled(Button)`
1315
width: fit-content;
1416
`;
1517

1618
const Page: NextPageWithLayout = () => {
1719
const { t } = useTranslation();
1820

21+
const fetchFromZotero = useCallback(async () => {
22+
const apiKey = '';
23+
const myapi = api(apiKey).library('user', 475425); //
24+
const itemsResponse = await myapi.items().get();
25+
26+
console.log(itemsResponse);
27+
}, []);
28+
1929
return (
2030
<Box
2131
$align="center"
@@ -40,11 +50,12 @@ const Page: NextPageWithLayout = () => {
4050
)}
4151
</Text>
4252

43-
<StyledLink href="/">
44-
<StyledButton icon={<Icon iconName="house" $color="white" />}>
45-
{t('Home')}
46-
</StyledButton>
47-
</StyledLink>
53+
<StyledButton
54+
onClick={() => fetchFromZotero()}
55+
56+
icon={<Icon iconName="house" $color="white" />}>
57+
{t('Home')}
58+
</StyledButton>
4859
</Box>
4960
</Box>
5061
);

0 commit comments

Comments
 (0)