From 188642bb2c94fa4d30b093b16b586c4747d09450 Mon Sep 17 00:00:00 2001 From: kvakazyambra Date: Sun, 27 Aug 2023 19:48:28 +0300 Subject: [PATCH] Minor table of contents fixes --- public/icons/hide-table-of-contents.svg | 2 +- public/icons/show-table-of-contents.svg | 4 ++-- public/locales/en/translation.json | 2 ++ public/locales/ru/translation.json | 2 ++ .../TableOfContents/TableOfContents.module.scss | 10 ++++++---- src/components/TableOfContents/TableOfContents.tsx | 2 +- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/public/icons/hide-table-of-contents.svg b/public/icons/hide-table-of-contents.svg index f1df16eb..fd50f43e 100644 --- a/public/icons/hide-table-of-contents.svg +++ b/public/icons/hide-table-of-contents.svg @@ -1,4 +1,4 @@ - + diff --git a/public/icons/show-table-of-contents.svg b/public/icons/show-table-of-contents.svg index 8b13672d..37075c24 100644 --- a/public/icons/show-table-of-contents.svg +++ b/public/icons/show-table-of-contents.svg @@ -1,4 +1,4 @@ - - + + diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 6758ee6a..d4714bac 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -144,6 +144,7 @@ "Help": "Помощь", "Help to edit": "Help to edit", "Here you can customize your profile the way you want.": "Here you can customize your profile the way you want.", + "Hide table of contents": "Hide table of contents", "Highlight": "Highlight", "Hooray! Welcome!": "Hooray! Welcome!", "Horizontal collaborative journalistic platform": "Horizontal collaborative journalism platform", @@ -265,6 +266,7 @@ "Share": "Share", "Show": "Show", "Show lyrics": "Show lyrics", + "Show table of contents": "Show table of contents", "Slug": "Slug", "Social networks": "Social networks", "Something went wrong, check email and password": "Something went wrong. Check your email and password", diff --git a/public/locales/ru/translation.json b/public/locales/ru/translation.json index 9121034b..da916c9b 100644 --- a/public/locales/ru/translation.json +++ b/public/locales/ru/translation.json @@ -152,6 +152,7 @@ "Help": "Помощь", "Help to edit": "Помочь редактировать", "Here you can customize your profile the way you want.": "Здесь можно настроить свой профиль так, как вы хотите.", + "Hide table of contents": "Скрыть главление", "Highlight": "Подсветка", "Hooray! Welcome!": "Ура! Добро пожаловать!", "Horizontal collaborative journalistic platform": "Горизонтальная платформа для коллаборативной журналистики", @@ -282,6 +283,7 @@ "Short opening": "Расскажите вашу историю...", "Show": "Показать", "Show lyrics": "Текст песни", + "Show table of contents": "Показать главление", "Slug": "Постоянная ссылка", "Social networks": "Социальные сети", "Something went wrong, check email and password": "Что-то пошло не так. Проверьте адрес электронной почты и пароль", diff --git a/src/components/TableOfContents/TableOfContents.module.scss b/src/components/TableOfContents/TableOfContents.module.scss index bcd06260..af54438c 100644 --- a/src/components/TableOfContents/TableOfContents.module.scss +++ b/src/components/TableOfContents/TableOfContents.module.scss @@ -3,14 +3,12 @@ top: 0; &:not(.TableOfContentsFixedWrapperLefted) { + margin-top: -0.2em; + .TableOfContentsPrimaryButton { margin-top: 5.4rem; transform: rotate(180deg); } - - .TableOfContentsContainer { - padding-top: 2.7em; - } } } @@ -72,6 +70,10 @@ background: transparent; border: none; cursor: pointer; + + &:hover { + filter: invert(1); + } } .TableOfContentsHeadingsList { diff --git a/src/components/TableOfContents/TableOfContents.tsx b/src/components/TableOfContents/TableOfContents.tsx index 12b4f310..b4f354e6 100644 --- a/src/components/TableOfContents/TableOfContents.tsx +++ b/src/components/TableOfContents/TableOfContents.tsx @@ -99,9 +99,9 @@ export const TableOfContents = (props: Props) => { })} onClick={(e) => { e.preventDefault() - toggleIsVisible() }} + title={isVisible() ? t('Hide table of contents') : t('Show table of contents')} > }>