Skip to content

Commit

Permalink
hide block on rtl
Browse files Browse the repository at this point in the history
  • Loading branch information
shbov committed May 23, 2024
1 parent 90103bd commit ed4869c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/blocks/GithubStarsBlock/GithubStarsBlock.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ $block: '.#{variables.$ns}github-stars-promotion';
animation-delay: 500ms;
}

@media (max-width: map-get(pcVariables.$gridBreakpoints, 'sm') - 1) {
}

&__wrapper {
display: flex;
justify-content: flex-end;
Expand Down
6 changes: 6 additions & 0 deletions src/blocks/GithubStarsBlock/GithubStarsBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {Star} from '@gravity-ui/icons';
import {Animatable, HTML} from '@gravity-ui/page-constructor';
import {Button, Icon, Text} from '@gravity-ui/uikit';
import {useTranslation} from 'next-i18next';
import {useRouter} from 'next/router';
import React, {useEffect, useState} from 'react';
import {GITHUB_UI_KIT_URL} from 'src/constants';

Expand All @@ -23,6 +24,7 @@ export type GithubStarsModel = GithubStarsBlockProps & {

export const GithubStarsBlock: React.FC<GithubStarsBlockProps> = ({device}) => {
const {t} = useTranslation();
const {pathname} = useRouter();
const [hide, setHide] = useState<boolean>(true);

useEffect(() => {
Expand All @@ -33,6 +35,10 @@ export const GithubStarsBlock: React.FC<GithubStarsBlockProps> = ({device}) => {
localStorage.setItem(LOCAL_STORAGE_KEY, 'true');
};

if (pathname !== '/') {
return null;
}

return (
<div className={b('wrapper')} data-hide={hide} data-device={device}>
<a className={b()} href={GITHUB_UI_KIT_URL} target="_blank" onClick={hideBlock}>
Expand Down

0 comments on commit ed4869c

Please sign in to comment.