From e78a2b80fa578933f9b0a825ee970ecdd7f2700e Mon Sep 17 00:00:00 2001 From: Andrew Shubnikov <32542672+shbov@users.noreply.github.com> Date: Mon, 3 Jun 2024 20:27:17 +0300 Subject: [PATCH] feat: update github promotion block (#209) * DATAUI-2403: update github promotion block --- public/locales/en/home.json | 3 +- public/locales/ru/home.json | 3 +- .../GithubStarsBlock/GithubStarsBlock.scss | 31 ++++++++++++++----- .../GithubStarsBlock/GithubStarsBlock.tsx | 12 +++---- 4 files changed, 30 insertions(+), 19 deletions(-) diff --git a/public/locales/en/home.json b/public/locales/en/home.json index 4f16d07a9fb..9e324ef3370 100644 --- a/public/locales/en/home.json +++ b/public/locales/en/home.json @@ -32,6 +32,5 @@ "roadmap_items_item11": "Page constructor: footer block", "templates_title": "Start creating with Gravity UI", "companies_title": "Trusted by", - "github_stars-text": "Do you 💖 Gravity UI? Give us", - "github_stars-button": "Star" + "github_stars-text": "Do you 💖 Gravity UI? Give us a ⭐ on Github" } diff --git a/public/locales/ru/home.json b/public/locales/ru/home.json index 88496df3c1f..7c5039d8c28 100644 --- a/public/locales/ru/home.json +++ b/public/locales/ru/home.json @@ -32,6 +32,5 @@ "roadmap_items_item11": "Page constructor: блок футера", "templates_title": "Начните создавать проекты с Gravity UI", "companies_title": "Нам доверяют", - "github_stars-text": "Вам нравится 💖 Gravity UI? Поставьте нам", - "github_stars-button": "Звезду" + "github_stars-text": "Вам нравится 💖 Gravity UI? Поставьте нам ⭐ на Github" } diff --git a/src/blocks/GithubStarsBlock/GithubStarsBlock.scss b/src/blocks/GithubStarsBlock/GithubStarsBlock.scss index 9bfe96a55bb..1fa5ade53d8 100644 --- a/src/blocks/GithubStarsBlock/GithubStarsBlock.scss +++ b/src/blocks/GithubStarsBlock/GithubStarsBlock.scss @@ -15,24 +15,41 @@ $block: '.#{variables.$ns}github-stars-promotion'; align-items: center; justify-content: center; gap: var(--g-spacing-2); - padding: var(--g-spacing-1) var(--g-spacing-1) var(--g-spacing-1) var(--g-spacing-4); - border-radius: var(--g-border-radius-m); + padding: var(--g-spacing-2) var(--g-spacing-4); + padding-right: var(--g-spacing-2); text-decoration: none; background: #cda2e7; + &:hover { + background: #e2bbfa; + } + + @media (max-width: map-get(pcVariables.$gridBreakpoints, 'sm') - 1) { + width: 100%; + } + @media (min-width: map-get(pcVariables.$gridBreakpoints, 'sm')) { + border-radius: var(--g-border-radius-m); transform: translateX(calc(100% + 2 * var(--g-spacing-2))); animation: leftBlockAnimation 250ms ease-out forwards; animation-delay: 500ms; } + &__text { + display: flex; + align-items: center; + gap: var(--g-spacing-1); + + & > .g-icon { + flex: 1 0 auto; + } + } + &__wrapper { display: flex; justify-content: flex-end; align-items: center; - padding-top: var(--g-spacing-2); - @media (min-width: map-get(pcVariables.$gridBreakpoints, 'sm')) { position: absolute; overflow: hidden; @@ -40,8 +57,8 @@ $block: '.#{variables.$ns}github-stars-promotion'; right: 0; z-index: 9; - padding-left: var(--g-spacing-2); - padding-right: var(--g-spacing-2); + padding: var(--g-spacing-2); + padding-bottom: 0; &[data-hide='true'] { display: none; @@ -54,7 +71,7 @@ $block: '.#{variables.$ns}github-stars-promotion'; @media (max-width: map-get(pcVariables.$gridBreakpoints, 'sm') - 1) { justify-content: center; - + margin: 0 -24px; &[data-device='desktop'] { display: none; } diff --git a/src/blocks/GithubStarsBlock/GithubStarsBlock.tsx b/src/blocks/GithubStarsBlock/GithubStarsBlock.tsx index 906ee4fa819..a0abd829011 100644 --- a/src/blocks/GithubStarsBlock/GithubStarsBlock.tsx +++ b/src/blocks/GithubStarsBlock/GithubStarsBlock.tsx @@ -1,6 +1,6 @@ -import {Star} from '@gravity-ui/icons'; +import {ChevronRight} from '@gravity-ui/icons'; import {Animatable, HTML} from '@gravity-ui/page-constructor'; -import {Button, Icon, Text} from '@gravity-ui/uikit'; +import {Icon, Text} from '@gravity-ui/uikit'; import {useTranslation} from 'next-i18next'; import {useRouter} from 'next/router'; import React, {useEffect, useState} from 'react'; @@ -42,14 +42,10 @@ export const GithubStarsBlock: React.FC = ({device}) => { return (
- + {t('home:github_stars-text')} + - -
);