From 44ebc876fa6f914900e8fbaf694527b32c8a0448 Mon Sep 17 00:00:00 2001 From: Roland Date: Wed, 29 Mar 2023 13:46:39 -0600 Subject: [PATCH] Renaming examples to avoid grouping of pdf with ebooks. Reworking URLs for media files to avoid escaping url safe characters. --- app/src/App.js | 20 ++--- app/src/Tags.js | 41 ++++++--- app/src/components/Archive.js | 13 +-- app/src/components/Common.js | 90 ++++++++++++++++--- app/src/components/Download.js | 1 - app/src/components/FilePreview.js | 100 +++++++++++++++------- app/src/components/Files.js | 79 +++++------------ app/src/components/Nav.js | 3 +- app/src/components/VideoPlayer.js | 13 +-- app/src/components/Videos.js | 19 ++-- app/src/index.css | 10 +-- app/src/logo.svg | 8 +- app/src/reportWebVitals.js | 18 ++-- app/src/setupTests.js | 11 ++- modules/videos/lib.py | 6 +- test/{example.epub => ebook example.epub} | Bin test/{example.mobi => ebook example.mobi} | Bin test/{example.pdf => pdf example.pdf} | Bin wrolpi/conftest.py | 12 +-- wrolpi/files/test/test_ebooks.py | 15 ++-- wrolpi/files/test/test_pdfs.py | 4 +- 21 files changed, 277 insertions(+), 186 deletions(-) rename test/{example.epub => ebook example.epub} (100%) rename test/{example.mobi => ebook example.mobi} (100%) rename test/{example.pdf => pdf example.pdf} (100%) diff --git a/app/src/App.js b/app/src/App.js index f64e2287..2f92032e 100644 --- a/app/src/App.js +++ b/app/src/App.js @@ -81,18 +81,18 @@ export default function App() { useEventsInterval(); return - - {/* Context and style to handle switching between mobile/computer. */} - - {/* Toasts can be on any page. */} - - - + + + {/* Context and style to handle switching between mobile/computer. */} + + {/* Toasts can be on any page. */} + + - - - + + + } diff --git a/app/src/Tags.js b/app/src/Tags.js index 28cb7c68..16bbf79f 100644 --- a/app/src/Tags.js +++ b/app/src/Tags.js @@ -22,13 +22,21 @@ import { TableRow, } from "semantic-ui-react"; import {contrastingColor, HelpPopup} from "./components/Common"; -import {Button, Segment} from "./components/Theme"; +import {Segment} from "./components/Theme"; import _ from "lodash"; -import {Link} from "react-router-dom"; import {HexColorPicker} from "react-colorful"; +export const TagsContext = React.createContext({ + NameToTagLabel: null, + TagsGroup: null, + TagsLinkGroup: null, + fetchTags: null, + findTagByName: null, + tagNames: [], + tags: [], +}); + const DEFAULT_TAG_COLOR = '#000000'; -export const TagsContext = React.createContext({tags: [], fetchTags: null, findTagByName: null}); export function useTags() { const [tags, setTags] = React.useState(null); @@ -94,9 +102,9 @@ export function useTags() { } return {tagNames.map(i => - + - + )} } @@ -116,7 +124,7 @@ function EditTagLabel({tag, onDelete, onEdit}) { return - setConfirmDeleteOpen(true)} icon='close'/> + setConfirmDeleteOpen(true)} icon='trash'/> return <> -