new note text in sidebar btn
This commit is contained in:
parent
e97b9bdba4
commit
ced63ab6d1
@ -9,8 +9,17 @@ import useLogin from "@/Hooks/useLogin";
|
|||||||
import Icon from "@/Icons/Icon";
|
import Icon from "@/Icons/Icon";
|
||||||
import { useNoteCreator } from "@/State/NoteCreator";
|
import { useNoteCreator } from "@/State/NoteCreator";
|
||||||
import { NoteCreator } from "./NoteCreator";
|
import { NoteCreator } from "./NoteCreator";
|
||||||
|
import { FormattedMessage } from "react-intl";
|
||||||
|
|
||||||
export const NoteCreatorButton = ({ className, alwaysShow }: { className?: string; alwaysShow?: boolean }) => {
|
export const NoteCreatorButton = ({
|
||||||
|
className,
|
||||||
|
alwaysShow,
|
||||||
|
showText,
|
||||||
|
}: {
|
||||||
|
className?: string;
|
||||||
|
alwaysShow?: boolean;
|
||||||
|
showText?: boolean;
|
||||||
|
}) => {
|
||||||
const buttonRef = useRef<HTMLButtonElement>(null);
|
const buttonRef = useRef<HTMLButtonElement>(null);
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const { readonly } = useLogin(s => ({ readonly: s.readonly }));
|
const { readonly } = useLogin(s => ({ readonly: s.readonly }));
|
||||||
@ -51,7 +60,7 @@ export const NoteCreatorButton = ({ className, alwaysShow }: { className?: strin
|
|||||||
{!shouldHideNoteCreator && (
|
{!shouldHideNoteCreator && (
|
||||||
<button
|
<button
|
||||||
ref={buttonRef}
|
ref={buttonRef}
|
||||||
className={classNames("primary circle", className)}
|
className={classNames("flex flex-row items-center primary rounded-full", { "circle": !showText }, className)}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
update(v => {
|
update(v => {
|
||||||
v.replyTo = undefined;
|
v.replyTo = undefined;
|
||||||
@ -59,6 +68,11 @@ export const NoteCreatorButton = ({ className, alwaysShow }: { className?: strin
|
|||||||
})
|
})
|
||||||
}>
|
}>
|
||||||
<Icon name="plus" size={16} />
|
<Icon name="plus" size={16} />
|
||||||
|
{showText && (
|
||||||
|
<span className="ml-2 hidden xl:inline">
|
||||||
|
<FormattedMessage defaultMessage="New Note" id="2mcwT8" />
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
<NoteCreator key="global-note-creator" />
|
<NoteCreator key="global-note-creator" />
|
||||||
|
@ -64,7 +64,7 @@ export default function NavSidebar() {
|
|||||||
})}
|
})}
|
||||||
{publicKey ? (
|
{publicKey ? (
|
||||||
<div className="mt-2">
|
<div className="mt-2">
|
||||||
<NoteCreatorButton alwaysShow={true} />
|
<NoteCreatorButton alwaysShow={true} showText={true} />
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="mt-2">
|
<div className="mt-2">
|
||||||
|
@ -129,6 +129,9 @@
|
|||||||
"2k0Cv+": {
|
"2k0Cv+": {
|
||||||
"defaultMessage": "Dislikes ({n})"
|
"defaultMessage": "Dislikes ({n})"
|
||||||
},
|
},
|
||||||
|
"2mcwT8": {
|
||||||
|
"defaultMessage": "New Note"
|
||||||
|
},
|
||||||
"2ukA4d": {
|
"2ukA4d": {
|
||||||
"defaultMessage": "{n} hours"
|
"defaultMessage": "{n} hours"
|
||||||
},
|
},
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
"2O2sfp": "Finish",
|
"2O2sfp": "Finish",
|
||||||
"2a2YiP": "{n} Bookmarks",
|
"2a2YiP": "{n} Bookmarks",
|
||||||
"2k0Cv+": "Dislikes ({n})",
|
"2k0Cv+": "Dislikes ({n})",
|
||||||
|
"2mcwT8": "New Note",
|
||||||
"2ukA4d": "{n} hours",
|
"2ukA4d": "{n} hours",
|
||||||
"2zJXeA": "Profiles",
|
"2zJXeA": "Profiles",
|
||||||
"39AHJm": "Sign Up",
|
"39AHJm": "Sign Up",
|
||||||
|
Loading…
Reference in New Issue
Block a user