From 1061982727bc7face860587f45eadbf060cfd52f Mon Sep 17 00:00:00 2001 From: boojack Date: Wed, 22 Jun 2022 08:34:37 +0800 Subject: [PATCH] chore: rename --- web/src/components/Memo.tsx | 20 ++++++++++---------- web/src/less/memo.less | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/web/src/components/Memo.tsx b/web/src/components/Memo.tsx index 9058cd25d..027bdefca 100644 --- a/web/src/components/Memo.tsx +++ b/web/src/components/Memo.tsx @@ -18,10 +18,10 @@ interface Props { memo: Memo; } -type ShowAllButtonStatus = -1 | 0 | 1; +type ExpandButtonStatus = -1 | 0 | 1; interface State { - showAllButtonStatus: ShowAllButtonStatus; + expandButtonStatus: ExpandButtonStatus; } const Memo: React.FC = (props: Props) => { @@ -31,7 +31,7 @@ const Memo: React.FC = (props: Props) => { createdAtStr: utils.getDateTimeString(propsMemo.createdTs), }; const [state, setState] = useState({ - showAllButtonStatus: -1, + expandButtonStatus: -1, }); const memoContainerRef = useRef(null); const [showConfirmDeleteBtn, toggleConfirmDeleteBtn] = useToggle(false); @@ -45,7 +45,7 @@ const Memo: React.FC = (props: Props) => { if (Number(memoContainerRef.current?.clientHeight) > MAX_MEMO_CONTAINER_HEIGHT) { setState({ ...state, - showAllButtonStatus: 0, + expandButtonStatus: 0, }); } }, []); @@ -124,7 +124,7 @@ const Memo: React.FC = (props: Props) => { const handleShowMoreBtnClick = () => { setState({ ...state, - showAllButtonStatus: Number(Boolean(!state.showAllButtonStatus)) as ShowAllButtonStatus, + expandButtonStatus: Number(Boolean(!state.expandButtonStatus)) as ExpandButtonStatus, }); }; @@ -172,14 +172,14 @@ const Memo: React.FC = (props: Props) => {
- {state.showAllButtonStatus !== -1 && ( -
- - {state.showAllButtonStatus === 0 ? "Expand" : "Fold"} + {state.expandButtonStatus !== -1 && ( +
+ + {state.expandButtonStatus === 0 ? "Expand" : "Fold"}
diff --git a/web/src/less/memo.less b/web/src/less/memo.less index 9056d0757..b039c1cd1 100644 --- a/web/src/less/memo.less +++ b/web/src/less/memo.less @@ -86,16 +86,16 @@ } > .memo-content-text { - @apply w-full h-auto; + @apply w-full h-auto transition-all; } - > .show-all-btn-container { + > .expand-btn-container { @apply w-full relative flex flex-row justify-start items-center; > .btn { @apply flex flex-row justify-start items-center px-2 py-1 my-1 text-xs rounded-lg border bg-gray-100 border-gray-200 opacity-80 shadow hover:opacity-60; - &.show-all-btn { + &.expand-btn { @apply mt-2; > .icon-img { @@ -103,7 +103,7 @@ } } - &.hide-btn { + &.fold-btn { > .icon-img { @apply -rotate-90; }