Skip to content

Commit

Permalink
Merge pull request #12 from DanielArnould/fix-example-cors
Browse files Browse the repository at this point in the history
Switched arxiv link format
  • Loading branch information
DanielArnould authored Jul 4, 2024
2 parents df53862 + 22e8aff commit c01cfde
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 48 deletions.
8 changes: 3 additions & 5 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ import { testHighlights as _testHighlights } from "./test-highlights";
import { CommentedHighlight } from "./types";

const TEST_HIGHLIGHTS = _testHighlights;
const PRIMARY_PDF_URL = "https://arxiv.org/pdf/2203.11115.pdf";
const SECONDARY_PDF_URL = "https://arxiv.org/pdf/1604.02480.pdf";
const LONG_LOADING_PDF_URL =
"https://cdn.filestackcontent.com/wcrjf9qPTCKXV3hMXDwK";
const PRIMARY_PDF_URL = "https://arxiv.org/pdf/2203.11115";
const SECONDARY_PDF_URL = "https://arxiv.org/pdf/1604.02480";

const getNextId = () => String(Math.random()).slice(2);

Expand All @@ -49,7 +47,7 @@ const App = () => {
const highlighterUtilsRef = useRef<PdfHighlighterUtils>();

const toggleDocument = () => {
const urls = [PRIMARY_PDF_URL, SECONDARY_PDF_URL, LONG_LOADING_PDF_URL];
const urls = [PRIMARY_PDF_URL, SECONDARY_PDF_URL];
currentPdfIndexRef.current = (currentPdfIndexRef.current + 1) % urls.length;
setUrl(urls[currentPdfIndexRef.current]);
setHighlights(TEST_HIGHLIGHTS[urls[currentPdfIndexRef.current]] ?? []);
Expand Down
4 changes: 2 additions & 2 deletions example/src/test-highlights.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CommentedHighlight } from "./types";

export const testHighlights: Record<string, Array<CommentedHighlight>> = {
"https://arxiv.org/pdf/2203.11115.pdf": [
"https://arxiv.org/pdf/2203.11115": [
{
content: {
text: "The analysis indicates that TS applications exhibit significantly better code quality and understandability than JS applications.",
Expand Down Expand Up @@ -163,7 +163,7 @@ export const testHighlights: Record<string, Array<CommentedHighlight>> = {
id: "9298580906684795",
},
],
"https://arxiv.org/pdf/1604.02480.pdf": [
"https://arxiv.org/pdf/1604.02480": [
{
content: {
text: "SSA",
Expand Down
64 changes: 23 additions & 41 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c01cfde

Please sign in to comment.