Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

ui: make all inputs use implicit default variant

thecodrr92ce7ff38292
diff --git a/apps/web/src/components/dialogs/move-note-dialog.js b/apps/web/src/components/dialogs/move-note-dialog.js
index 8aac21752..7d97c26c2 100644
--- a/apps/web/src/components/dialogs/move-note-dialog.js
+++ b/apps/web/src/components/dialogs/move-note-dialog.js
@@ -15,7 +15,7 @@ class MoveDialog extends React.Component {
items: db.notebooks.all,
type: "notebooks",
title: "Notebooks",
- mode: "read"
+ mode: "read",
};
render() {
@@ -51,7 +51,7 @@ class MoveDialog extends React.Component {
props.onClose();
}
},
- disabled: type !== "notes"
+ disabled: type !== "notes",
}}
negativeButton={{ text: "Cancel", onClick: props.onClose }}
>
@@ -66,7 +66,7 @@ class MoveDialog extends React.Component {
sx={{
display: this.history.length ? "block" : "none",
":hover": { color: "primary" },
- marginRight: 2
+ marginRight: 2,
}}
>
<Icon.ArrowLeft />
@@ -86,23 +86,22 @@ class MoveDialog extends React.Component {
}}
sx={{
display: type === "notes" ? "none" : "block",
- ":hover": { color: "primary" }
+ ":hover": { color: "primary" },
}}
>
{mode === "read" ? <Icon.Plus /> : <Icon.Minus />}
</Text>
</Flex>
<Input
- ref={ref => (this._inputRef = ref)}
- variant="default"
+ ref={(ref) => (this._inputRef = ref)}
sx={{ display: mode === "write" ? "block" : "none" }}
my={1}
placeholder={type === "notebooks" ? "Notebook name" : "Topic name"}
- onKeyUp={async e => {
+ onKeyUp={async (e) => {
if (e.nativeEvent.key === "Enter" && e.target.value.length > 0) {
if (type === "notebooks") {
await db.notebooks.add({
- title: e.target.value
+ title: e.target.value,
});
this.setState({ items: db.notebooks.all });
} else {
@@ -111,7 +110,7 @@ class MoveDialog extends React.Component {
.topics.add(e.target.value);
this.setState({
items: db.notebooks.notebook(this.selectedNotebook.id)
- .topics.all
+ .topics.all,
});
}
this._inputRef.value = "";
@@ -125,11 +124,11 @@ class MoveDialog extends React.Component {
borderStyle: "solid",
borderColor: "border",
maxHeight: 8 * 30,
- overflowY: "auto"
+ overflowY: "auto",
}}
>
{items.length ? (
- items.map(item => {
+ items.map((item) => {
return (
<Flex
key={item.title + item.dateCreated}
@@ -139,19 +138,19 @@ class MoveDialog extends React.Component {
borderBottomColor: "border",
borderBottomStyle: "solid",
cursor: "pointer",
- ":hover": { borderBottomColor: "primary" }
+ ":hover": { borderBottomColor: "primary" },
}}
onClick={() => {
this.history.push({
title,
items,
- type
+ type,
});
if (type === "notebooks") {
this.setState({
type: "topics",
items: item.topics,
- title: item.title
+ title: item.title,
});
this.selectedNotebook = item;
} else if (type === "topics") {
@@ -160,7 +159,7 @@ class MoveDialog extends React.Component {
title: `${this.selectedNotebook.title} - ${item.title}`,
items: db.notebooks
.notebook(this.selectedNotebook.id)
- .topics.topic(item.title).all
+ .topics.topic(item.title).all,
});
this.selectedTopic = item.title;
}
@@ -192,7 +191,7 @@ class MoveDialog extends React.Component {
}
export function showMoveNoteDialog(noteIds) {
- return showDialog(perform => (
+ return showDialog((perform) => (
<MoveDialog
noteIds={noteIds}
onClose={() => perform(false)}
diff --git a/apps/web/src/components/dialogs/password-dialog.js b/apps/web/src/components/dialogs/password-dialog.js
index 5c959d6f0..94c704e3e 100644
--- a/apps/web/src/components/dialogs/password-dialog.js
+++ b/apps/web/src/components/dialogs/password-dialog.js
@@ -23,7 +23,7 @@ function PasswordDialog(props) {
icon={props.icon}
positiveButton={{
text: props.positiveButtonText,
- onClick: submit
+ onClick: submit,
}}
negativeButton={{ text: "Cancel", onClick: props.onCancel }}
>
@@ -31,10 +31,10 @@ function PasswordDialog(props) {
<Input
ref={passwordRef}
autoFocus
- variant={isWrong ? "error" : "default"}
+ variant={isWrong ? "error" : "input"}
type="password"
placeholder="Enter vault password"
- onKeyUp={async e => {
+ onKeyUp={async (e) => {
if (e.key === "Enter") {
await submit();
} else {
@@ -61,19 +61,19 @@ function getDialogData(type) {
return {
title: "Set Up Your Vault",
icon: Icon.Vault,
- positiveButtonText: "Done"
+ positiveButtonText: "Done",
};
case "unlock_vault":
return {
title: "Unlock Vault",
icon: Icon.Unlock,
- positiveButtonText: "Unlock"
+ positiveButtonText: "Unlock",
};
case "unlock_note":
return {
title: "Unlock Note",
icon: Icon.Unlock,
- positiveButtonText: "Unlock"
+ positiveButtonText: "Unlock",
};
default:
return;
@@ -82,7 +82,7 @@ function getDialogData(type) {
export function showPasswordDialog(type, validate) {
const { title, icon, positiveButtonText } = getDialogData(type);
- return showDialog(perform => (
+ return showDialog((perform) => (
<PasswordDialog
title={title}
icon={icon}
diff --git a/apps/web/src/components/dialogs/topicdialog.js b/apps/web/src/components/dialogs/topicdialog.js
index b0c0dbc1e..b85365830 100644
--- a/apps/web/src/components/dialogs/topicdialog.js
+++ b/apps/web/src/components/dialogs/topicdialog.js
@@ -15,15 +15,14 @@ function TopicDialog(props) {
icon={props.icon}
positiveButton={{
text: "Add",
- onClick: props.onYes.bind(this, topic)
+ onClick: props.onYes.bind(this, topic),
}}
negativeButton={{ text: "Cancel", onClick: props.onNo }}
>
<Box my={1}>
<Input
- variant="default"
placeholder="name"
- onChange={e => {
+ onChange={(e) => {
setTopic(e.target.value);
}}
></Input>
@@ -33,14 +32,14 @@ function TopicDialog(props) {
}
export function showTopicDialog(notebook) {
- return showDialog(perform => (
+ return showDialog((perform) => (
<TopicDialog
title={"Topic"}
icon={Icon.Topic}
onNo={() => {
perform(false);
}}
- onYes={async topic => {
+ onYes={async (topic) => {
if (!topic) return;
await db.notebooks.notebook(notebook).topics.add(topic);
store.setSelectedNotebookTopics(notebook);