Skip to content

Commit

Permalink
Example: remove top level code
Browse files Browse the repository at this point in the history
  • Loading branch information
agentcooper committed Sep 14, 2024
1 parent 4a65c28 commit ae0968f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
10 changes: 4 additions & 6 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ const HighlightPopup = ({
const PRIMARY_PDF_URL = "https://arxiv.org/pdf/1708.08021";
const SECONDARY_PDF_URL = "https://arxiv.org/pdf/1604.02480";

const searchParams = new URLSearchParams(document.location.search);
const initialUrl = searchParams.get("url") || PRIMARY_PDF_URL;

export function App() {
const searchParams = new URLSearchParams(document.location.search);
const initialUrl = searchParams.get("url") || PRIMARY_PDF_URL;

const [url, setUrl] = useState(initialUrl);
const [highlights, setHighlights] = useState<Array<IHighlight>>(
testHighlights[initialUrl] ? [...testHighlights[initialUrl]] : [],
Expand All @@ -67,9 +67,7 @@ export function App() {
setHighlights(testHighlights[newUrl] ? [...testHighlights[newUrl]] : []);
};

const scrollViewerTo = useRef((highlight: IHighlight) => {
// Implement scrolling logic here
});
const scrollViewerTo = useRef((highlight: IHighlight) => {});

const scrollToHighlightFromHash = useCallback(() => {
const highlight = getHighlightById(parseIdFromHash());
Expand Down
9 changes: 1 addition & 8 deletions example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"lib": ["ESNext", "DOM"],
"noEmit": true
},
"include": ["./src", "../decs.d.ts"]
"extends": "../tsconfig.json"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"start": "npm run dev",
"dev": "vite build && (cd ./example && vite)",
"build": "npm run clean && npm run compile && vite build && npm run build:example",
"compile": "tsc --noEmit",
"compile": "tsc --noEmit && (cd ./example && tsc --noEmit)",
"build:example": "vite build && (cd ./example && vite build)",
"test": "npm run build && npm run lint && npm run test:e2e",
"test:e2e": "playwright test",
Expand Down

0 comments on commit ae0968f

Please sign in to comment.