From 72d36b964a7549dd42ff33e5333efdd44a67e9cb Mon Sep 17 00:00:00 2001
From: boojack
Date: Tue, 3 May 2022 12:15:47 +0800
Subject: [PATCH] chore: update styles
---
web/src/components/MemoCardDialog.tsx | 1 +
web/src/components/MyAccountSection.tsx | 10 ---
web/src/components/ShortcutList.tsx | 8 --
web/src/less/memo-card-dialog.less | 108 ++++--------------------
web/src/less/signin.less | 4 +-
web/src/pages/Signin.tsx | 8 +-
6 files changed, 25 insertions(+), 114 deletions(-)
diff --git a/web/src/components/MemoCardDialog.tsx b/web/src/components/MemoCardDialog.tsx
index 503ba308..c21cd16a 100644
--- a/web/src/components/MemoCardDialog.tsx
+++ b/web/src/components/MemoCardDialog.tsx
@@ -9,6 +9,7 @@ import { showDialog } from "./Dialog";
import Only from "./common/OnlyWhen";
import Image from "./Image";
import "../less/memo-card-dialog.less";
+import "../less/memo-content.less";
interface LinkedMemo extends FormattedMemo {
dateStr: string;
diff --git a/web/src/components/MyAccountSection.tsx b/web/src/components/MyAccountSection.tsx
index 802747cb..f0603ee6 100644
--- a/web/src/components/MyAccountSection.tsx
+++ b/web/src/components/MyAccountSection.tsx
@@ -29,11 +29,6 @@ const MyAccountSection: React.FC = () => {
};
const handleConfirmEditUsernameBtnClick = async () => {
- if (user.name === "guest") {
- toastHelper.info("Do not change my username");
- return;
- }
-
if (username === user.name) {
return;
}
@@ -61,11 +56,6 @@ const MyAccountSection: React.FC = () => {
};
const handleChangePasswordBtnClick = () => {
- if (user.name === "guest") {
- toastHelper.info("Do not change my password");
- return;
- }
-
showChangePasswordDialog();
};
diff --git a/web/src/components/ShortcutList.tsx b/web/src/components/ShortcutList.tsx
index 944ecebf..8ca8839d 100644
--- a/web/src/components/ShortcutList.tsx
+++ b/web/src/components/ShortcutList.tsx
@@ -4,7 +4,6 @@ import appContext from "../stores/appContext";
import useToggle from "../hooks/useToggle";
import useLoading from "../hooks/useLoading";
import utils from "../helpers/utils";
-import Only from "./common/OnlyWhen";
import toastHelper from "./Toast";
import showCreateShortcutDialog from "./CreateShortcutDialog";
import "../less/shortcut-list.less";
@@ -46,13 +45,6 @@ const ShortcutList: React.FC = () => {
-
-
- showCreateShortcutDialog()}>
- New shortcut
-
-
-
{sortedShortcuts.map((s) => {
return
;
diff --git a/web/src/less/memo-card-dialog.less b/web/src/less/memo-card-dialog.less
index 042fb88b..2fa37a67 100644
--- a/web/src/less/memo-card-dialog.less
+++ b/web/src/less/memo-card-dialog.less
@@ -2,23 +2,15 @@
.dialog-wrapper.memo-card-dialog {
> .dialog-container {
- padding: 0;
- background-color: transparent;
+ @apply p-0 bg-transparent;
> * {
- flex-shrink: 0;
+ @apply shrink-0;
}
> .memo-card-container {
- position: relative;
.flex(column, flex-start, flex-start);
- width: 512px;
- min-height: 64px;
- max-width: 100%;
- padding: 12px 24px;
- margin-bottom: 12px;
- border-radius: 8px;
- background-color: @bg-paper-yellow;
+ @apply relative w-128 max-w-full py-3 px-6 mb-3 rounded-lg bg-yellow-200;
> * {
z-index: 1;
@@ -26,16 +18,10 @@
> .header-container {
.flex(row, space-between, center);
- width: 100%;
- height: auto;
- padding-bottom: 0;
- margin-bottom: 0;
- margin-top: 0;
+ @apply w-full h-auto pb-0 my-0;
> .time-text {
- font-size: 14px;
- color: gray;
- @apply font-mono;
+ @apply text-sm text-gray-500 font-mono;
}
> .btns-container {
@@ -43,18 +29,10 @@
> .btn {
.flex(row, center, center);
- width: 24px;
- height: 24px;
- margin-left: 4px;
- border-radius: 4px;
-
- &:hover {
- background-color: white;
- }
+ @apply w-6 h-6 ml-1 rounded hover:bg-white;
> .icon-img {
- width: 20px;
- height: 20px;
+ @apply w-5 h-5;
}
}
}
@@ -62,65 +40,36 @@
> .memo-container {
.flex(column, flex-start, flex-start);
- width: 100%;
- padding-top: 8px;
+ @apply w-full pt-2;
> .memo-content-text {
- width: 100%;
- font-size: 16px;
- line-height: 1.6;
- word-wrap: break-word;
- word-break: break-all;
+ @apply w-full text-base leading-6;
.tag-span {
- margin: 0;
- padding: 0;
- font-size: 14px;
- color: @text-blue;
- background-color: unset;
- cursor: unset;
+ @apply p-0 text-blue-600 text-base bg-transparent cursor-auto;
}
}
> .images-wrapper {
.flex(row, flex-start, flex-start);
- margin-top: 8px;
- width: 100%;
- overflow-x: auto;
- overflow-y: hidden;
+ @apply w-full mt-2 overflow-x-auto overflow-y-hidden;
padding-bottom: 2px;
.pretty-scroll-bar(0, 2px);
> .memo-img {
- margin-right: 8px;
- width: auto;
- height: 128px;
- flex-shrink: 0;
- flex-grow: 0;
- overflow-y: hidden;
+ @apply mr-2 w-auto h-32 shrink-0 grow-0 overflow-y-hidden hover:border-gray-400 last:mr-0;
.hide-scroll-bar();
- &:hover {
- border-color: lightgray;
- }
-
- &:last-child {
- margin-right: 0;
- }
-
> img {
- width: auto;
+ @apply w-auto rounded-lg;
max-height: 128px;
- border-radius: 8px;
}
}
}
}
> .normal-text {
- margin-top: 8px;
- font-size: 13px;
- color: gray;
+ @apply mt-2 text-sm text-gray-500;
}
> .layer-container,
@@ -150,38 +99,17 @@
> .linked-memos-wrapper {
.flex(column, flex-start, flex-start);
- width: 512px;
- max-width: 100%;
- margin-top: 8px;
- padding: 12px 24px;
- border-radius: 8px;
- background-color: white;
-
- &:last-child {
- margin-bottom: 36px;
- }
+ @apply w-128 max-w-full mt-2 py-3 px-6 rounded-lg bg-white last:mb-8;
> .normal-text {
- font-size: 13px;
+ @apply text-sm;
}
> .linked-memo-container {
- font-size: 13px;
- line-height: 24px;
- margin-top: 8px;
- cursor: pointer;
- max-width: 100%;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-
- &:hover {
- opacity: 0.8;
- }
+ @apply text-sm leading-6 mt-2 cursor-pointer max-w-full truncate hover:opacity-80;
> .time-text {
- color: gray;
- @apply font-mono;
+ @apply font-mono text-gray-500;
}
}
}
diff --git a/web/src/less/signin.less b/web/src/less/signin.less
index 4d128543..d416b04f 100644
--- a/web/src/less/signin.less
+++ b/web/src/less/signin.less
@@ -25,10 +25,10 @@
@apply relative w-full text-base m-2;
> .normal-text {
- @apply absolute top-3 left-3 pl-1 leading-10 flex-shrink-0 text-base cursor-text text-gray-400 bg-transparent transition-all select-none;
+ @apply absolute top-3 left-3 px-1 leading-10 flex-shrink-0 text-base cursor-text text-gray-400 bg-transparent transition-all select-none;
&.not-null {
- @apply text-sm top-0 leading-4 bg-white;
+ @apply text-sm top-0 leading-4 bg-white rounded;
}
}
diff --git a/web/src/pages/Signin.tsx b/web/src/pages/Signin.tsx
index d8261d0e..586ce4a3 100644
--- a/web/src/pages/Signin.tsx
+++ b/web/src/pages/Signin.tsx
@@ -132,13 +132,13 @@ const Signin: React.FC
= () => {
className={`btn guest-signin ${signinBtnsClickLoadingState.isLoading ? "requesting" : ""}`}
onClick={handleAutoSigninAsGuestBtnClick}
>
- 👉 Login as Guest quickly
+ 👉 Quick login as a guest
- I have an account
+ Sign in/up with account
>
@@ -165,7 +165,7 @@ const Signin: React.FC = () => {
/