Skip to content
Merged

Footer #1174

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/LayoutMain/LayoutMain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const LayoutMain: FC<LayoutMainProps> = ({
<>
<Head>
<link rel="icon" href={config.data?.favicon ?? '/favicon.png'} />
<title>{pageTitle}</title>
<title>SD Hire - {pageTitle}</title>
<link rel="stylesheet" id="themeVariables" href={`/theme/${theme}.css`} />
</Head>

Expand Down
4 changes: 2 additions & 2 deletions src/components/PageFooter/PageFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Link } from '../Link';
import { defaultLocale, languages } from '../../utils/getLang';
import { useEditUserSettings } from '../../modules/userHooks';
import { trpc } from '../../trpc/trpcClient';
import SheepLogoWithMessage from '../SheepLogoWithTips/SheepLogoWithTips';
import SheepLogoWithTips from '../SheepLogoWithTips/SheepLogoWithTips';

import { tr } from './PageFooter.i18n';

Expand Down Expand Up @@ -57,7 +57,7 @@ export const PageFooter: FC = () => {
</Link>
</FooterMenu>

<SheepLogoWithMessage />
<SheepLogoWithTips />
</Footer>
);
};
4 changes: 4 additions & 0 deletions src/components/PageNavigation/PageNavigation.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@
.TitleLogo {
fill: var(--text-primary);
color: var(--text-primary);
}

.IconBellOutline {
margin-left: auto;
}
2 changes: 1 addition & 1 deletion src/components/PageNavigation/PageNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const PageNavigation: FC = () => {
<TaskanyLogo src={config.data?.favicon || undefined} size="m" />
<TitleLogo className={s.TitleLogo} />
</Link>
<IconBellOutline size="s" />
<IconBellOutline className={s.IconBellOutline} size="s" />
</NavigationSidebarHeader>
<NavigationSidebarContent>
<PageNavigationActionButton />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"Your smile is my favorite kind of sunlight. Have a nice day!": "",
"Good day!": "",
"Hurray! Something interesting awaits you today!": "",
"Life is wonderful!": "",
"Don't worry, be happy": ""
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* eslint-disable */
// Do not edit, use generator to update
import { i18n, fmt, I18nLangSet } from 'easy-typed-intl';
import getLang from '../../../utils/getLang';

import en from './en.json';
import ru from './ru.json';

export type I18nKey = keyof typeof en & keyof typeof ru;
type I18nLang = 'en' | 'ru';

const keyset: I18nLangSet<I18nKey> = {};

keyset['en'] = en;
keyset['ru'] = ru;

export const tr = i18n<I18nLang, I18nKey>(keyset, fmt, getLang);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"Your smile is my favorite kind of sunlight. Have a nice day!": "Твоя улыбка — мой любимый солнечный свет. Хорошего дня!",
"Good day!": "Хорошего дня!",
"Life is wonderful!": "Жизнь прекрасна",
"Don't worry, be happy": "Не парься, будь счастлив",
"Hurray! Something interesting awaits you today!": "Ура! Сегодня вас ждет кое-что интересное!"
}
23 changes: 18 additions & 5 deletions src/components/SheepLogoWithTips/SheepLogoWithTips.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
import { FC, useRef, useState } from 'react';
import { FC, useMemo, useRef, useState } from 'react';
import { Popup } from '@taskany/bricks/harmony';
import { SheepLogo } from '@taskany/bricks';

import { AllTips, getRandomIndex } from '../../utils/getRandomIndex';
import { getRandomIndex } from '../../utils/getRandomIndex';

import s from './SheepLogoWithTips.module.css';
import { tr } from './SheepLogoWithTips.i18n';

const SheepLogoWithTips: FC = () => {
const [index, setIndex] = useState(getRandomIndex());
const [index, setIndex] = useState(getRandomIndex(0));
const [popupVisible, setPopupVisibility] = useState(false);
const popupRef = useRef<HTMLDivElement>(null);

const allTipsItems = useMemo(() => {
const allTips = [
tr('Your smile is my favorite kind of sunlight. Have a nice day!'),
tr('Good day!'),
tr('Hurray! Something interesting awaits you today!'),
tr('Life is wonderful!'),
tr("Don't worry, be happy"),
];

return allTips;
}, []);

return (
<>
<div ref={popupRef}>
<a
onClick={() => {
setPopupVisibility(true);
setIndex(getRandomIndex());
setIndex(getRandomIndex(index));
}}
>
<SheepLogo />
Expand All @@ -31,7 +44,7 @@ const SheepLogoWithTips: FC = () => {
className={s.TipIcon}
onClickOutside={() => setPopupVisibility(false)}
>
{AllTips[index]}
{allTipsItems[index]}
</Popup>
</>
);
Expand Down
12 changes: 1 addition & 11 deletions src/utils/getRandomIndex.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
import { tr } from './utils.i18n';

export const AllTips = [
tr('Your smile is my favorite kind of sunlight. Have a nice day!'),
tr('Good day!'),
tr('Hurray! Something interesting awaits you today!'),
tr('Life is wonderful!'),
tr("Don't worry, be happy"),
];

export const getRandomIndex = () => Math.floor(Math.random() * AllTips.length);
export const getRandomIndex = (len: number) => Math.floor(Math.random() * len);
7 changes: 1 addition & 6 deletions src/utils/utils.i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,5 @@
"Phone": "",
"Techologies": "",
"problem editor": "",
"hiring stream manager": "",
"Your smile is my favorite kind of sunlight. Have a nice day!": "",
"Good day!": "",
"Hurray! Something interesting awaits you today!": "",
"Life is wonderful!": "",
"Don't worry, be happy": ""
"hiring stream manager": ""
}
5 changes: 0 additions & 5 deletions src/utils/utils.i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,5 @@
"Phone": "Телефон",
"Techologies": "Технологии",
"problem editor": "редактор задач",
"Your smile is my favorite kind of sunlight. Have a nice day!": "Твоя улыбка — мой любимый солнечный свет. Хорошего дня!",
"Good day!": "Хорошего дня!",
"Life is wonderful!": "Жизнь прекрасна",
"Don't worry, be happy": "Не парься, будь счастлив",
"Hurray! Something interesting awaits you today!": "Ура! Сегодня вас ждет кое-что интересное!",
"hiring stream manager": "менеджер потока найма"
}
Loading