Skip to content

Commit d75c532

Browse files
committed
Refactoring...
1 parent 9a21df4 commit d75c532

File tree

2 files changed

+35
-40
lines changed

2 files changed

+35
-40
lines changed

src/components/Help/Help.tsx

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import "./Help.sass";
22

3-
import { useCallback, type FC, MouseEvent } from "react";
3+
import { type FC } from "react";
44
import { useNavigate } from "react-router-dom";
55
import { getRoutePath } from "utils";
66

@@ -17,14 +17,9 @@ interface HelpProps {
1717
const Help: FC<HelpProps> = (props) => {
1818
const navigate = useNavigate();
1919

20-
const handleOnClick = useCallback(
21-
(e: MouseEvent) => {
22-
e.stopPropagation();
23-
console.log("Card clicked");
24-
navigate(getRoutePath(props.to));
25-
},
26-
[props.to],
27-
);
20+
const handleOnClick = () => {
21+
navigate(getRoutePath(props.to));
22+
};
2823

2924
return (
3025
<Card className="Help" onClick={handleOnClick}>

src/translation/ru.json

+31-31
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,71 @@
11
{
22
"app": {
33
"name": "ZLottie",
4-
"description": "Lottie minifier",
4+
"description": "Минификатор Lottie",
55
"theme": {
6-
"title": "Theme",
7-
"dark": "Dark",
8-
"light": "Light"
6+
"title": "Тема",
7+
"dark": "Тёмная",
8+
"light": "Светлая"
99
},
1010
"language": {
11-
"title": "Language",
11+
"title": "Язык",
1212
"en": "English",
1313
"ru": "Русский"
1414
}
1515
},
1616
"header": {
17-
"doc": "Documentation"
17+
"doc": "Документация"
1818
},
1919
"home": {
2020
"seo": {
21-
"title": "Minifier"
21+
"title": "Минификатор"
2222
},
2323
"aside": {
2424
"howUse": {
25-
"title": "How to use?",
26-
"text": "Click to learn"
25+
"title": "Как использовать?",
26+
"text": "Читать..."
2727
},
2828
"whyIs": {
29-
"title": "Why is ZLottie?",
30-
"text": "Click to learn"
29+
"title": "Почему ZLottie?",
30+
"text": "Читать..."
3131
},
3232
"saved": {
33-
"title": "Savings",
34-
"subtitle": "Counts how many bytes there were and how many turned out",
35-
"prev": "Previous value",
36-
"next": "Next value",
37-
"all": "Total"
33+
"title": "Экономия",
34+
"subtitle": "Считает, сколько байт было и сколько получилось",
35+
"prev": "Предыдущий",
36+
"next": "Новый",
37+
"all": "Всего"
3838
}
3939
},
4040
"dnd": {
41-
"upload": "Drag & Drop files here",
42-
"alternative": "Or click me and upload files",
41+
"upload": "Перетащите файлы сюда",
42+
"alternative": "Или нажмите, чтобы загрузить их",
4343
"support": {
44-
"before": "Support Only",
45-
"after": "TGS or JSON"
44+
"before": "Поддерживаются только",
45+
"after": "TGS или JSON"
4646
}
4747
},
4848
"files": {
4949
"empty": {
50-
"title": "You have not processed any files",
51-
"text": "Add at least 1 file and everything will appear!"
50+
"title": "Вы ещё не обработали ни одного файла",
51+
"text": "Добавьте хотя бы 1 файл, и всё появится!"
5252
},
5353
"download": {
54-
"json": "Download '.json'",
55-
"zlottie": "Download '.zlottie'"
54+
"json": "Скачать '.json'",
55+
"zlottie": "Скачать '.zlottie'"
5656
}
5757
}
5858
},
5959
"howToUse": {
60-
"title": "Instructions for using 'ZLottie'",
61-
"subtitle": "First of all, I want to thank you for trusting and using ZLottie!",
62-
"text": "What is ZLottie? This is a Lottie in the 'zlib' format. But it's not that simple... \r\n My goal was to create a way to compress and decompress large files, and besides, there was a problem with the very large size of Lottie animations, which can weigh several megabytes (!!!). Later, I was prompted that the GZIP format could be used. And yes, it has significantly reduced the size, but, as always, there is something to strive for! That's how ZLottie turned out. What's it? This is a file compressed using zlib in zlib-raw (you just can't unpack it like that). As a result, the size has decreased significantly! (in some cases, the size is reduced to 8 (!!!) once, just imagine what a saving it is!). But there are also victims! What's the matter… Middleware is needed for unpacking. It doesn't look like a problem, to be honest. Unpacking is extremely fast, and in any case, you should have a placeholder message at the time of lazy loading. As a result, this problem is completely invisible. Unpacking takes less than 0.1 ms, and downloading 500 KB can take up to 30 seconds! In addition, the library for unpacking weighs only 4 KB in production, and if only one function is used, even less after shaking.",
60+
"title": "Инструкция по использованию 'ZLottie'",
61+
"subtitle": "Прежде всего, спасибо, что доверились и используете ZLottie!",
62+
"text": "Что такое ZLottie? Это Lottie в формате 'zlib'. Но всё не так просто... \r\n Моя цель состояла в том, чтобы создать способ сжатия и распаковки больших файлов, а также решить проблему слишком большого размера анимаций Lottie, которые могут весить несколько мегабайт (!!!). Позже мне подсказали, что можно использовать формат GZIP. И да, это значительно уменьшило размер, но, как всегда, есть к чему стремиться! Так появился ZLottie. Что это такое? Это файл, сжатый с использованием zlib в формате zlib-raw (вы не можете просто так его распаковать). В результате размер значительно уменьшился! (в некоторых случаях размер уменьшается до 8 (!!!) раз, только представьте себе такую экономию!). Но есть и жертвы! В чём дело… Для распаковки нужен middleware. Честно говоря, это не выглядит проблемой. Распаковка происходит крайне быстро, и в любом случае у вас должно быть сообщение-заполнитель во время ленивой загрузки. В результате эта проблема совершенно незаметна. Распаковка занимает менее 0.1 мс, а загрузка 500 КБ может занять до 30 секунд! Кроме того, библиотека для распаковки весит всего 4 КБ в продакшене, а если используется только одна функция, то ещё меньше после тряски.",
6363
"usages": {
64-
"0": "Lottie-Web Light was obtained from the Lottie-Web library! (About x2 times less than the usual Lottie-Web);",
65-
"1": "fflate is a library for unpacking. If you check through 'bundlephobia', then the weight of the library at the time of writing is only 4 kb;",
64+
"0": "Lottie-Web Light был получен из библиотеки Lottie-Web! (Примерно в 2 раза меньше, чем обычный Lottie-Web);",
65+
"1": "fflate — это библиотека для распаковки. Если проверить через 'bundlephobia', то вес библиотеки на момент написания составляет всего 4 КБ;",
6666
"2": "zlottie =)"
6767
},
68-
"copy": "Copy code!",
69-
"openInGitHub": "View in GitHub"
68+
"copy": "Скопировать код!",
69+
"openInGitHub": "Открыть в GitHub"
7070
}
7171
}

0 commit comments

Comments
 (0)