diff --git a/src/blocks/Examples/Examples.scss b/src/blocks/Examples/Examples.scss index db280ae62567..c31d15471aed 100644 --- a/src/blocks/Examples/Examples.scss +++ b/src/blocks/Examples/Examples.scss @@ -15,7 +15,7 @@ $block: '.#{variables.$ns}examples'; flex-wrap: nowrap; justify-content: space-between; gap: 16px; - min-width: 270px; + min-width: 260px; @media (max-width: map-get(pcVariables.$gridBreakpoints, 'md') - 1) { flex-wrap: wrap; diff --git a/src/components/Templates/Templates.scss b/src/components/Templates/Templates.scss index 531401123906..e7130eb60afc 100644 --- a/src/components/Templates/Templates.scss +++ b/src/components/Templates/Templates.scss @@ -12,23 +12,34 @@ $block: '.#{variables.$ns}templates'; flex-direction: column; gap: 20px; + @media (max-width: 329px) { + .yc-button__text { + padding: 0 10px; + } + } + &__commands-wrapper { width: 100%; padding: 16px 36px 16px 16px; background: #160d1b; border-radius: 16px; position: relative; + overflow: hidden; @media (max-width: map-get(pcVariables.$gridBreakpoints, 'lg') - 1) { width: inherit; } + pre { + margin: 0; + overflow: auto; + } } - &__commands { overflow-x: auto; - white-space: nowrap; + font-size: 17px; + line-height: 30px; + font-family: var(--yc-font-family-monospace); } - &__copy { top: 16px; right: 16px; diff --git a/src/components/Templates/Templates.tsx b/src/components/Templates/Templates.tsx index d813a57eb9b9..04517865e75e 100644 --- a/src/components/Templates/Templates.tsx +++ b/src/components/Templates/Templates.tsx @@ -1,6 +1,9 @@ -import {Button, ClipboardButton, Icon, Tabs, Text} from '@gravity-ui/uikit'; +import {Button, ClipboardButton, Icon, Tabs} from '@gravity-ui/uikit'; +import Prism from 'prismjs'; import React from 'react'; +require('prismjs/components/prism-bash'); + import {block} from '../../utils'; import './Templates.scss'; @@ -13,17 +16,12 @@ interface CommandsProps { } const Commands: React.FC = ({commands}) => { + const html = Prism.highlight(commands.join('\n'), Prism.languages.bash, 'bash'); return (
-
- {commands.map((item, index) => { - return ( - - {item} - - ); - })} -
+
+                
+            
); diff --git a/src/content/landing.ts b/src/content/landing.ts index 8682d353b6ad..ff52a6167d58 100644 --- a/src/content/landing.ts +++ b/src/content/landing.ts @@ -169,11 +169,11 @@ const typedLanding: CustomPageContent = { 'cd my-app', 'npm start', ], - // button: { - // href: 'ya.ru', - // target: '_blank', - // title: 'Open CRA Playground', - // }, + button: { + href: 'https://codesandbox.io/p/devbox/gravityui-cra-mpg4q3', + target: '_blank', + title: 'Open CRA Playground', + }, }, { title: 'Next.js', @@ -183,11 +183,11 @@ const typedLanding: CustomPageContent = { 'cd my-app', 'npm run dev', ], - // button: { - // href: 'ya.ru', - // target: '_blank', - // title: 'Open Next.js Playground', - // }, + button: { + href: 'https://codesandbox.io/p/devbox/gravityui-next-js-vvq8lf', + target: '_blank', + title: 'Open Next.js Playground', + }, }, { title: 'Vite', @@ -197,11 +197,11 @@ const typedLanding: CustomPageContent = { 'npm install', 'npm run dev', ], - // button: { - // href: 'ya.ru', - // target: '_blank', - // title: 'Open Next.js Playground', - // }, + button: { + href: 'https://codesandbox.io/p/devbox/gravityui-vite-36dq3r', + target: '_blank', + title: 'Open Vite Playground', + }, }, ], },