mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: update button elements
This commit is contained in:
@ -63,18 +63,18 @@ const DailyReviewDialog: React.FC<Props> = (props: Props) => {
|
|||||||
<span className="icon-text">📅</span> Daily Review
|
<span className="icon-text">📅</span> Daily Review
|
||||||
</p>
|
</p>
|
||||||
<div className="btns-container">
|
<div className="btns-container">
|
||||||
<span className="btn-text" onClick={() => setCurrentDateStamp(currentDateStamp - DAILY_TIMESTAMP)}>
|
<button className="btn-text" onClick={() => setCurrentDateStamp(currentDateStamp - DAILY_TIMESTAMP)}>
|
||||||
<img className="icon-img" src="/icons/arrow-left.svg" />
|
<img className="icon-img" src="/icons/arrow-left.svg" />
|
||||||
</span>
|
</button>
|
||||||
<span className="btn-text" onClick={() => setCurrentDateStamp(currentDateStamp + DAILY_TIMESTAMP)}>
|
<button className="btn-text" onClick={() => setCurrentDateStamp(currentDateStamp + DAILY_TIMESTAMP)}>
|
||||||
<img className="icon-img" src="/icons/arrow-right.svg" />
|
<img className="icon-img" src="/icons/arrow-right.svg" />
|
||||||
</span>
|
</button>
|
||||||
<span className="btn-text share-btn" onClick={handleShareBtnClick}>
|
<button className="btn-text share-btn" onClick={handleShareBtnClick}>
|
||||||
<img className="icon-img" src="/icons/share.svg" />
|
<img className="icon-img" src="/icons/share.svg" />
|
||||||
</span>
|
</button>
|
||||||
<span className="btn-text" onClick={() => props.destroy()}>
|
<button className="btn-text" onClick={() => props.destroy()}>
|
||||||
<img className="icon-img" src="/icons/close.svg" />
|
<img className="icon-img" src="/icons/close.svg" />
|
||||||
</span>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<DatePicker
|
<DatePicker
|
||||||
className={`date-picker ${showDatePicker ? "" : "!hidden"}`}
|
className={`date-picker ${showDatePicker ? "" : "!hidden"}`}
|
||||||
|
@ -9,7 +9,6 @@ import { showDialog } from "./Dialog";
|
|||||||
import Image from "./Image";
|
import Image from "./Image";
|
||||||
import { formatMemoContent } from "./Memo";
|
import { formatMemoContent } from "./Memo";
|
||||||
import "../less/memo-card-dialog.less";
|
import "../less/memo-card-dialog.less";
|
||||||
import "../less/memo-content.less";
|
|
||||||
|
|
||||||
interface LinkedMemo extends Memo {
|
interface LinkedMemo extends Memo {
|
||||||
createdAtStr: string;
|
createdAtStr: string;
|
||||||
|
@ -127,15 +127,14 @@ const MemoEditor: React.FC<Props> = () => {
|
|||||||
[state]
|
[state]
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleSaveBtnClick = useCallback(async (content: string) => {
|
const handleSaveBtnClick = async (content: string) => {
|
||||||
if (content === "") {
|
if (content === "") {
|
||||||
toastHelper.error("Content can't be empty");
|
toastHelper.error("Content can't be empty");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { editMemoId } = editorStateService.getState();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
const { editMemoId } = editorStateService.getState();
|
||||||
if (editMemoId && editMemoId !== UNKNOWN_ID) {
|
if (editMemoId && editMemoId !== UNKNOWN_ID) {
|
||||||
const prevMemo = memoService.getMemoById(editMemoId ?? UNKNOWN_ID);
|
const prevMemo = memoService.getMemoById(editMemoId ?? UNKNOWN_ID);
|
||||||
|
|
||||||
@ -156,8 +155,12 @@ const MemoEditor: React.FC<Props> = () => {
|
|||||||
toastHelper.error(error.message);
|
toastHelper.error(error.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setState({
|
||||||
|
...state,
|
||||||
|
fullscreen: false,
|
||||||
|
});
|
||||||
setEditorContentCache("");
|
setEditorContentCache("");
|
||||||
}, []);
|
};
|
||||||
|
|
||||||
const handleCancelBtnClick = useCallback(() => {
|
const handleCancelBtnClick = useCallback(() => {
|
||||||
editorStateService.clearEditMemo();
|
editorStateService.clearEditMemo();
|
||||||
@ -235,10 +238,10 @@ const MemoEditor: React.FC<Props> = () => {
|
|||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="action-btn">
|
<button className="action-btn">
|
||||||
<img className="icon-img" src="/icons/image.svg" onClick={handleUploadFileBtnClick} />
|
<img className="icon-img" src="/icons/image.svg" onClick={handleUploadFileBtnClick} />
|
||||||
<span className={`tip-text ${state.isUploadingResource ? "!block" : ""}`}>Uploading</span>
|
<span className={`tip-text ${state.isUploadingResource ? "!block" : ""}`}>Uploading</span>
|
||||||
</div>
|
</button>
|
||||||
<button className="action-btn" onClick={handleFullscreenBtnClick}>
|
<button className="action-btn" onClick={handleFullscreenBtnClick}>
|
||||||
<img className="icon-img" src={`/icons/${state.fullscreen ? "close" : "open"}-fullscreen.svg`} alt="" />
|
<img className="icon-img" src={`/icons/${state.fullscreen ? "close" : "open"}-fullscreen.svg`} alt="" />
|
||||||
</button>
|
</button>
|
||||||
|
@ -38,9 +38,9 @@ const ShortcutList: React.FC<Props> = () => {
|
|||||||
<div className="shortcuts-wrapper">
|
<div className="shortcuts-wrapper">
|
||||||
<p className="title-text">
|
<p className="title-text">
|
||||||
<span className="normal-text">Shortcuts</span>
|
<span className="normal-text">Shortcuts</span>
|
||||||
<span className="btn" onClick={() => showCreateShortcutDialog()}>
|
<button className="btn" onClick={() => showCreateShortcutDialog()}>
|
||||||
<img src="/icons/add.svg" alt="add shortcut" />
|
<img src="/icons/add.svg" alt="add shortcut" />
|
||||||
</span>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
<div className="shortcuts-container">
|
<div className="shortcuts-container">
|
||||||
{sortedShortcuts.map((s) => {
|
{sortedShortcuts.map((s) => {
|
||||||
|
@ -44,9 +44,9 @@ const UserBanner: React.FC<Props> = () => {
|
|||||||
<span className="username-text">{username}</span>
|
<span className="username-text">{username}</span>
|
||||||
{!isVisitorMode && user?.role === "HOST" ? <span className="tag">MOD</span> : null}
|
{!isVisitorMode && user?.role === "HOST" ? <span className="tag">MOD</span> : null}
|
||||||
</div>
|
</div>
|
||||||
<span className="action-btn menu-popup-btn" onClick={handlePopupBtnClick}>
|
<button className="action-btn menu-popup-btn" onClick={handlePopupBtnClick}>
|
||||||
<img src="/icons/more.svg" className="icon-img" />
|
<img src="/icons/more.svg" className="icon-img" />
|
||||||
</span>
|
</button>
|
||||||
<MenuBtnsPopup shownStatus={shouldShowPopupBtns} setShownStatus={setShouldShowPopupBtns} />
|
<MenuBtnsPopup shownStatus={shouldShowPopupBtns} setShownStatus={setShouldShowPopupBtns} />
|
||||||
</div>
|
</div>
|
||||||
<div className="status-text-container">
|
<div className="status-text-container">
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
@apply flex flex-col justify-start items-start relative w-full h-auto flex-nowrap mb-2 mt-1;
|
@apply flex flex-col justify-start items-start relative w-full h-auto flex-nowrap mb-2 mt-1;
|
||||||
|
|
||||||
.subtags-container {
|
.subtags-container {
|
||||||
@apply flex flex-col justify-start items-start h-auto mt-1 ml-4 pl-1;
|
@apply flex flex-col justify-start items-start h-auto mt-1 ml-5 pl-1;
|
||||||
width: calc(100% - 18px);
|
width: calc(100% - 18px);
|
||||||
min-width: 80px;
|
min-width: 80px;
|
||||||
border-left: 2px solid @bg-gray;
|
border-left: 2px solid @bg-gray;
|
||||||
@ -32,7 +32,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
> .tag-text-container {
|
> .tag-text-container {
|
||||||
@apply flex flex-row justify-start items-center overflow-hidden text-ellipsis shrink-0 leading-5 text-black;
|
@apply flex flex-row justify-start items-center overflow-hidden shrink-0 leading-5 text-black;
|
||||||
max-width: calc(100% - 24px);
|
max-width: calc(100% - 24px);
|
||||||
|
|
||||||
> .icon-text {
|
> .icon-text {
|
||||||
@ -40,7 +40,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
> .tag-text {
|
> .tag-text {
|
||||||
@apply shrink-0;
|
@apply truncate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user