Skip to content
Merged

Footer #1177

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/FilterBar/FilterBar.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.FilterBar {
box-sizing: border-box;
height: 60.5px;
height: 57px;
}

.FilterBarApplied {
Expand Down
13 changes: 5 additions & 8 deletions src/components/SheepLogoWithTips/SheepLogoWithTips.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,26 @@ import s from './SheepLogoWithTips.module.css';
import { tr } from './SheepLogoWithTips.i18n';

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

const allTipsItems = useMemo(() => {
const allTips = [
const allTips = useMemo(() => {
return [
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;
}, []);
const [index, setIndex] = useState(getRandomIndex(allTips.length));

return (
<>
<div ref={popupRef}>
<a
onClick={() => {
setPopupVisibility(true);
setIndex(getRandomIndex(index));
setIndex(getRandomIndex(allTips.length));
}}
>
<SheepLogo />
Expand All @@ -44,7 +41,7 @@ const SheepLogoWithTips: FC = () => {
className={s.TipIcon}
onClickOutside={() => setPopupVisibility(false)}
>
{allTipsItems[index]}
{allTips[index]}
</Popup>
</>
);
Expand Down
Loading