aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-07-28 11:17:18 -0400
committerGitHub <noreply@github.com>2023-07-28 11:17:18 -0400
commitef636fd670ba0f9786785e724ef4e88508ee2630 (patch)
tree930a15f1583481c744a3797276373c8e1c89b7b3 /src/client/views/pdf
parentbf34928ad34d45f97c69da91b965c21f47edb5bf (diff)
parent022540e2833025409fd8017c5c9ecb3bfc93867b (diff)
Merge pull request #202 from brown-dash/sophie-report-manager
New Report Manager
Diffstat (limited to 'src/client/views/pdf')
-rw-r--r--src/client/views/pdf/AnchorMenu.tsx126
1 files changed, 66 insertions, 60 deletions
diff --git a/src/client/views/pdf/AnchorMenu.tsx b/src/client/views/pdf/AnchorMenu.tsx
index 07b2afd91..b877cc36a 100644
--- a/src/client/views/pdf/AnchorMenu.tsx
+++ b/src/client/views/pdf/AnchorMenu.tsx
@@ -253,21 +253,18 @@ export class AnchorMenu extends AntimodeMenu<AntimodeMenuProps> {
};
@computed get highlighter() {
- return <Group>
- <IconButton
- icon={<FontAwesomeIcon icon="highlighter" style={{ transition: 'transform 0.1s', transform: 'rotate(-45deg)' }} />}
- tooltip={'Click to Highlight'}
- onClick={this.highlightClicked}
- colorPicker={this.highlightColor}
- color={StrCast(Doc.UserDoc().userColor)}
- />
- <ColorPicker
- colorPickerType={'github'}
- selectedColor={this.highlightColor}
- setSelectedColor={color => this.changeHighlightColor(color)}
- size={Size.XSMALL}
- />
- </Group>
+ return (
+ <Group>
+ <IconButton
+ icon={<FontAwesomeIcon icon="highlighter" style={{ transition: 'transform 0.1s', transform: 'rotate(-45deg)' }} />}
+ tooltip={'Click to Highlight'}
+ onClick={this.highlightClicked}
+ colorPicker={this.highlightColor}
+ color={StrCast(Doc.UserDoc().userColor)}
+ />
+ <ColorPicker colorPickerType={'github'} selectedColor={this.highlightColor} setSelectedColor={color => this.changeHighlightColor(color)} size={Size.XSMALL} />
+ </Group>
+ );
}
@action changeHighlightColor = (color: string) => {
@@ -312,19 +309,20 @@ export class AnchorMenu extends AntimodeMenu<AntimodeMenuProps> {
this.Status === 'marquee' ? (
<>
{this.highlighter}
- <IconButton
- tooltip={'Drag to Place Annotation'}
- onPointerDown={this.pointerDown}
- icon={<FontAwesomeIcon icon="comment-alt"/>}
+ <IconButton
+ tooltip="Drag to Place Annotation" //
+ onPointerDown={this.pointerDown}
+ icon={<FontAwesomeIcon icon="comment-alt" />}
color={StrCast(Doc.UserDoc().userColor)}
/>
{/* GPT Summarize icon only shows up when text is highlighted, not on marquee selection*/}
{AnchorMenu.Instance.StartCropDrag === unimplementedFunction && this.canSummarize() && (
- <Tooltip key="gpt" title={<div className="dash-tooltip">Summarize with AI</div>}>
- <button className="antimodeMenu-button annotate" onPointerDown={this.gptSummarize} style={{ cursor: 'grab' }}>
- <FontAwesomeIcon icon="comment-dots" size="lg" />
- </button>
- </Tooltip>
+ <IconButton
+ tooltip="Summarize with AI" //
+ onPointerDown={this.gptSummarize}
+ icon={<FontAwesomeIcon icon="comment-dots" size="lg" />}
+ color={StrCast(Doc.UserDoc().userColor)}
+ />
)}
<GPTPopup
key="gptpopup"
@@ -338,66 +336,74 @@ export class AnchorMenu extends AntimodeMenu<AntimodeMenuProps> {
mode={this.GPTMode}
/>
{AnchorMenu.Instance.OnAudio === unimplementedFunction ? null : (
- <IconButton
- tooltip={'Click to Record Annotation'}
+ <IconButton
+ tooltip="Click to Record Annotation" //
onPointerDown={this.audioDown}
icon={<FontAwesomeIcon icon="microphone" />}
color={StrCast(Doc.UserDoc().userColor)}
/>
)}
{this.canEdit() && (
- <IconButton
- tooltip={'AI edit suggestions'}
+ <IconButton
+ tooltip="AI edit suggestions" //
onPointerDown={this.gptEdit}
icon={<FontAwesomeIcon icon="pencil-alt" />}
color={StrCast(Doc.UserDoc().userColor)}
/>
)}
- <Popup
- tooltip='Find document to link to selected text'
+ <Popup
+ tooltip="Find document to link to selected text" //
type={Type.PRIM}
icon={<FontAwesomeIcon icon={'search'} />}
popup={<LinkPopup key="popup" linkCreateAnchor={this.onMakeAnchor} />}
color={StrCast(Doc.UserDoc().userColor)}
/>
{AnchorMenu.Instance.StartCropDrag === unimplementedFunction ? null : (
- <IconButton
- tooltip={'Click/Drag to create cropped image'}
+ <IconButton
+ tooltip="Click/Drag to create cropped image" //
onPointerDown={this.cropDown}
- icon={<FontAwesomeIcon icon="image"/>}
+ icon={<FontAwesomeIcon icon="image" />}
color={StrCast(Doc.UserDoc().userColor)}
/>
)}
</>
) : (
<>
- {this.Delete !== returnFalse && <IconButton
- tooltip={'Remove Link Anchor'}
- onPointerDown={this.Delete}
- icon={<FontAwesomeIcon icon="trash-alt" />}
- color={StrCast(Doc.UserDoc().userColor)}
- />}
- {this.PinToPres !== returnFalse && <IconButton
- tooltip={'Pin to Presentation'}
- onPointerDown={this.PinToPres}
- icon={<FontAwesomeIcon icon="map-pin" />}
- color={StrCast(Doc.UserDoc().userColor)}
- />}
- {this.ShowTargetTrail !== returnFalse && <IconButton
- tooltip={'Show Linked Trail'}
- onPointerDown={this.ShowTargetTrail}
- icon={<FontAwesomeIcon icon="taxi" />}
- color={StrCast(Doc.UserDoc().userColor)}
- />}
- {this.IsTargetToggler !== returnFalse && <Toggle
- tooltip={'Make target visibility toggle on click'}
- type={Type.PRIM}
- toggleType={ToggleType.BUTTON}
- toggleStatus={this.IsTargetToggler()}
- onClick={this.MakeTargetToggle}
- icon={<FontAwesomeIcon icon="thumbtack" />}
- color={StrCast(Doc.UserDoc().userColor)}
- />}
+ {this.Delete !== returnFalse && (
+ <IconButton
+ tooltip="Remove Link Anchor" //
+ onPointerDown={this.Delete}
+ icon={<FontAwesomeIcon icon="trash-alt" />}
+ color={StrCast(Doc.UserDoc().userColor)}
+ />
+ )}
+ {this.PinToPres !== returnFalse && (
+ <IconButton
+ tooltip="Pin to Presentation" //
+ onPointerDown={this.PinToPres}
+ icon={<FontAwesomeIcon icon="map-pin" />}
+ color={StrCast(Doc.UserDoc().userColor)}
+ />
+ )}
+ {this.ShowTargetTrail !== returnFalse && (
+ <IconButton
+ tooltip="Show Linked Trail" //
+ onPointerDown={this.ShowTargetTrail}
+ icon={<FontAwesomeIcon icon="taxi" />}
+ color={StrCast(Doc.UserDoc().userColor)}
+ />
+ )}
+ {this.IsTargetToggler !== returnFalse && (
+ <Toggle
+ tooltip={'Make target visibility toggle on click'}
+ type={Type.PRIM}
+ toggleType={ToggleType.BUTTON}
+ toggleStatus={this.IsTargetToggler()}
+ onClick={this.MakeTargetToggle}
+ icon={<FontAwesomeIcon icon="thumbtack" />}
+ color={StrCast(Doc.UserDoc().userColor)}
+ />
+ )}
</>
);