Skip to content

Commit 3acc25a

Browse files
fix(CSS): various css & documentation links + delete annotation when editing (PR #2697 Fixes #2695)
1 parent 43a7d43 commit 3acc25a

File tree

8 files changed

+66
-31
lines changed

8 files changed

+66
-31
lines changed

src/renderer/assets/styles/components/allPublicationsPage.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@
3030

3131
&_inputs {
3232
display: flex;
33-
align-items: center;
33+
align-items: end;
3434
gap: 10px;
35+
height: 56px;
3536

3637
@media screen and (width <= 1072px) {
3738
gap: 30px;
3839
flex-direction: column;
3940
align-items: start;
41+
height: unset;
4042
}
4143
}
4244

src/renderer/assets/styles/components/annotations.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
background-color: var(--color-light-blue);
202202
color: var(--color-blue);
203203

204-
&[data-selected], &:has(input:checked) {
204+
&[data-selected], &:has(input:checked), &[data-state="checked"] {
205205
color: var(--color-secondary);
206206
background-color: var(--color-blue);
207207
}

src/renderer/assets/styles/components/popoverDialog.scss

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,21 @@
698698
outline-offset: -2px;
699699
}
700700

701-
.delete_item {
701+
.delete_item_edition {
702+
color: var(--color-blue);
703+
margin-left: 5px;
704+
705+
&:hover {
706+
background-color: var(--color-secondary);
707+
}
708+
709+
svg {
710+
color: var(--color-blue)!important;
711+
}
712+
}
713+
714+
715+
.delete_item, .delete_item_edition {
702716
z-index: 1000;
703717
border: 1px solid var(--color-blue);
704718
background-color: var(--color-light-blue);

src/renderer/assets/styles/components/popoverDialog.scss.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export declare const CSS_END_components_popoverDialog: string;
1515
export declare const CSS_START_components_popoverDialog: string;
1616
export declare const currentPage: string;
1717
export declare const delete_item: string;
18+
export declare const delete_item_edition: string;
1819
export declare const display_options_item: string;
1920
export declare const docked_header: string;
2021
export declare const docked_header_controls: string;

src/renderer/library/components/catalog/AboutThoriumButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class AboutThoriumButton extends React.Component<IProps, IState> {
104104
<p>{`v${_APP_VERSION}`}</p>
105105
<a href="" onClick={async (ev) => {
106106
ev.preventDefault(); // necessary because href="", CSS must also ensure hyperlink visited style
107-
await shell.openExternal("https://thorium.edrlab.org/en/about/"); // TODO: not link to the english thorium hyperlink
107+
await shell.openExternal("https://thorium.edrlab.org/"); // TODO: not link to the english thorium hyperlink
108108
}}
109109
tabIndex={0}>{__("catalog.about.title", { appName: capitalizedAppName })}</a>
110110
</div>

src/renderer/library/components/dialog/ApiappAddForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export const ApiappHowDoesItWorkInfoBox = () => {
100100
<a href=""
101101
onClick={async (ev) => {
102102
ev.preventDefault(); // necessary because href="", CSS must also ensure hyperlink visited style
103-
await shell.openExternal("https://thorium.edrlab.org/docs/");
103+
await shell.openExternal("https://thorium.edrlab.org/");
104104
}}>
105105
{__("apiapp.documentation")}
106106
<SVG ariaHidden svg={FollowLinkIcon} />

src/renderer/library/components/settings/Settings.tsx

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import * as QuitIcon from "readium-desktop/renderer/assets/icons/close-icon.svg"
1919
import * as CogIcon from "readium-desktop/renderer/assets/icons/cog-icon.svg";
2020
import * as PaletteIcon from "readium-desktop/renderer/assets/icons/palette-icon.svg";
2121
import * as KeyReturnIcon from "readium-desktop/renderer/assets/icons/keyreturn-icon.svg";
22-
import SVG from "readium-desktop/renderer/common/components/SVG";
22+
import SVG, { ISVGProps } from "readium-desktop/renderer/common/components/SVG";
2323
import classNames from "classnames";
2424
import { useTranslator } from "readium-desktop/renderer/common/hooks/useTranslator";
2525
import { useSelector } from "readium-desktop/renderer/common/hooks/useSelector";
@@ -42,6 +42,7 @@ import debounce from "debounce";
4242
import { IAnnotationCreator } from "readium-desktop/common/redux/states/creator";
4343
import { ILibraryRootState } from "readium-desktop/common/redux/states/renderer/libraryRootState";
4444
import { ApiappHowDoesItWorkInfoBox } from "../dialog/ApiappAddForm";
45+
import * as RadioGroup from "@radix-ui/react-radio-group";
4546
// import { TagGroup, TagList, Tag, Label } from "react-aria-components";
4647

4748
interface ISettingsProps {};
@@ -154,6 +155,24 @@ const SaveSessionSettings: React.FC<{}> = () => {
154155
);
155156
};
156157

158+
interface IRadioGroupItemProps {
159+
value: string;
160+
svg?: ISVGProps;
161+
description: string;
162+
disabled?: boolean;
163+
className?: string;
164+
style?: any;
165+
};
166+
167+
const RadioGroupItem = (props: IRadioGroupItemProps) => {
168+
return (
169+
<RadioGroup.Item
170+
data-input-type="radio"
171+
value={props.value} id={props.value} className={props.className} disabled={props.disabled} style={props.style}>
172+
{props.description}
173+
</RadioGroup.Item>
174+
);
175+
};
157176

158177

159178
const SaveCreatorSettings: React.FC<{}> = () => {
@@ -185,27 +204,14 @@ const SaveCreatorSettings: React.FC<{}> = () => {
185204
}} />
186205
<label htmlFor="creator-name">{__("settings.annotationCreator.name")}</label>
187206
</div>
188-
<div className={stylesAnnotations.annotations_filter_taglist} style={{ margin: "10px" }}>
189-
<p>{__("settings.annotationCreator.type")}</p>
190-
<div className={stylesAnnotations.annotations_filter_tag}>
191-
<input type="radio" id="creator-organizationType" style={{display: "none"}} name="creator-type" value="Organization" checked={type === "Organization"} onChange={(e) => {
192-
const t = e.target.value;
193-
if (t === "Organization") {
194-
setType(t);
195-
}
196-
}}/>
197-
<label htmlFor="creator-organizationType">{__("settings.annotationCreator.organization")}</label>
198-
</div>
199-
<div className={stylesAnnotations.annotations_filter_tag}>
200-
<input type="radio" id="creator-personType" style={{display: "none"}} name="creator-type" value="Person" checked={type === "Person"} onChange={(e) => {
201-
const t = e.target.value;
202-
if (t === "Person") {
203-
setType(t);
204-
}
205-
}}/>
206-
<label htmlFor="creator-personType">{__("settings.annotationCreator.person")}</label>
207-
</div>
208-
</div>
207+
<RadioGroup.Root orientation="horizontal" style={{ display: "flex", gap: "10px", marginTop: "20px", flexWrap: "wrap" }}
208+
value={type}
209+
onValueChange={(option: "Organization" | "Person") => setType(option)}
210+
>
211+
<p>{__("settings.annotationCreator.type")}</p>
212+
<RadioGroupItem value="Organization" description={`${__("settings.annotationCreator.organization")}`} className={stylesAnnotations.annotations_filter_tag} />
213+
<RadioGroupItem value="Person" description={`${__("settings.annotationCreator.person")}`} className={stylesAnnotations.annotations_filter_tag} />
214+
</RadioGroup.Root>
209215
</section>
210216
);
211217
};

src/renderer/reader/components/ReaderMenu.tsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,9 +563,7 @@ const AnnotationCard: React.FC<{ timestamp: number, annotation: IAnnotationState
563563
<>
564564
<HardWrapComment comment={comment} />
565565
{tagName ? <div className={stylesTags.tags_wrapper}>
566-
<div className={classNames(
567-
stylesTags.tag, stylesTags.no_hover,
568-
)}>
566+
<div className={stylesTags.tag}>
569567
<a onClick={() => setTagFilter(tagName)}
570568
onKeyUp={(e) => {
571569
if (e.key === "Enter" || e.key === "Space") {
@@ -632,9 +630,22 @@ const AnnotationCard: React.FC<{ timestamp: number, annotation: IAnnotationState
632630
</DialogReactAria>
633631
</PopoverReactAria>
634632
</DialogTriggerReactAria> */}
633+
{isEdited ?
634+
<button title={__("reader.marks.delete")}
635+
className={stylesPopoverDialog.delete_item_edition}
636+
onClick={() => {
637+
triggerEdition(false);
638+
dispatch(readerActions.annotation.pop.build(annotation));
639+
// alert("deleted");
640+
}}
641+
>
642+
<SVG ariaHidden={true} svg={DeleteIcon} />
643+
{__("reader.marks.delete")}
644+
</button> :
635645
<Popover.Root>
636646
<Popover.Trigger asChild>
637-
<button title={__("reader.marks.delete")}
647+
<button
648+
title={__("reader.marks.delete")}
638649
>
639650
<SVG ariaHidden={true} svg={DeleteIcon} />
640651
</button>
@@ -656,6 +667,7 @@ const AnnotationCard: React.FC<{ timestamp: number, annotation: IAnnotationState
656667
</Popover.Portal>
657668

658669
</Popover.Root>
670+
}
659671
</div>
660672
</div>
661673
<div className={stylesPopoverDialog.gauge}>

0 commit comments

Comments
 (0)