-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2213 from concord-consortium/186610168-manual-points
Add points by hand toolbar button
- Loading branch information
Showing
17 changed files
with
262 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@import "../vars.sass"; | ||
|
||
.chakra-editable { | ||
.chakra-editable__preview[hidden] { | ||
display: none; | ||
} | ||
|
||
button { | ||
background: inherit; | ||
border: none; | ||
cursor: pointer; | ||
|
||
&:hover { | ||
background-color: $workspace-teal-light-6; | ||
} | ||
|
||
svg { | ||
height: 1em; | ||
width: 1em; | ||
vertical-align: baseline; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from "react"; | ||
import { observer } from "mobx-react"; | ||
import { Editable, EditableInput, EditablePreview, useEditableControls } from "@chakra-ui/react"; | ||
|
||
import EditIcon from "../../assets/edit.svg"; | ||
|
||
import "./editable-label-with-button.scss"; | ||
|
||
interface IProps { | ||
defaultValue: string|undefined; | ||
onSubmit: (value:string) => void; | ||
} | ||
|
||
export const EditableLabelWithButton = observer(function EditableDataSetName({defaultValue, onSubmit}: IProps) { | ||
|
||
function EditButton() { | ||
const { isEditing, getEditButtonProps } = useEditableControls(); | ||
if (!isEditing) { | ||
return ( | ||
<button aria-label="Edit name" {...getEditButtonProps()}> | ||
<EditIcon/> | ||
</button> | ||
); | ||
} else { | ||
return null; | ||
} | ||
} | ||
|
||
return ( | ||
<Editable | ||
defaultValue={defaultValue} | ||
isPreviewFocusable={false} | ||
onSubmit={onSubmit} | ||
> | ||
<EditablePreview /> | ||
<EditableInput /> | ||
<EditButton /> | ||
</Editable> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.