feat: sticky header, header actions, nav link to About - #50
Conversation
|
@YuliaDemir is attempting to deploy a commit to the alyaengineer's projects team on Vercel, but is not a member of this team. To resolve this issue, you can:
To read more about collaboration on Vercel, click here. |
| --foreground: #171717; | ||
| } | ||
|
|
||
| @media (prefers-color-scheme: dark) { |
There was a problem hiding this comment.
два одинаковых media-query, давай объединять :) строки 6 и 56
| html, | ||
| body { | ||
| max-width: 100%; | ||
| } |
There was a problem hiding this comment.
в файле три отдельных body { } блока, совместный html, body { } и отдельный html { }. объединить бы
| display: flex; | ||
| flex-direction: column; | ||
| color: var(--foreground); | ||
| font-family: Arial, Helvetica, sans-serif; |
There was a problem hiding this comment.
думаю, надо еще юзать next/font для оптимизированной загрузки шрифтов
| const { locale } = await params; | ||
|
|
||
| return ( | ||
| <html lang={locale}> |
There was a problem hiding this comment.
//TODO, что называется))
добавить оптимизированную загрузку шрифтов
There was a problem hiding this comment.
useScroll нигде не импортируется и копирует логику useScrollTrigger от MUI. при этом пороговое значение тоже отличается - 8 vs 32 px. что оставляем? мне кажется, лучше MUI)
| export function Header() { | ||
| const isCompact = useScrollTrigger({ | ||
| disableHysteresis: true, | ||
| threshold: 32, |
There was a problem hiding this comment.
32 - магическое число, надо положить в константу, как в хуке useScroll (по нему тоже есть комментарий)
const STICKY_SCROLL_OFFSET = 32;
export function Header() {
const isCompact = useScrollTrigger({
disableHysteresis: true,
threshold: STICKY_SCROLL_OFFSET,
});
| minHeight: { | ||
| sm: isCompact ? 52 : 64, | ||
| }, |
There was a problem hiding this comment.
может здесь тоже вынести в константу? например,
const HEADER_SIZES = {
compact: { minHeight: 52, py: 0.5 },
expanded: { minHeight: 64, py: 1.25 },
};
и тогда
const STICKY_SCROLL_OFFSET = 32;
const HEADER_SIZES = {
compact: { minHeight: 52, py: 0.5 },
expanded: { minHeight: 64, py: 1.25 },
};
export function Header() {
const isCompact = useScrollTrigger({
disableHysteresis: true,
threshold: STICKY_SCROLL_OFFSET,
});
const { minHeight, py } = isCompact ? HEADER_SIZES.compact : HEADER_SIZES.expanded;
return (
)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
* Story/1 sticky header general (#50) * feat: install next+ts+linter+prettier+ husky+redux * feat: configs + perfectionist + lint fix * feat: install scss * refactor: add some folders * feat: install i18n + basic configs * feat: add internatiolisation * feat: language switcher * feat: dependencies update * feat: add sticky header * feat: add mui Button-and-Link-like component * fix: lint * style: add style for header * refactor: remove css from language selector * refactor: add const for flex styles in the header boxes * refactor: history style as link * fix: add some fixes * feat: footer with about page link (#59) * feat: add Inter and JetBrains Mono fonts via next/font * feat: reorganize theme into palette, components, typography, theme modules * feat: add i18n translations for header navigation links * fix: prevent header layout shift on language switcher toggle click * feat: add footer with translated links and styling * test: add tests for footer * fix: correct invalid box-shadow offset * fix: fix header height * fix: fix language switcher * refactor: extract routes and external links into constants * refactor: remove leftover placeholder before merge * fix: add InitColorSchemeScript to prevent SSR flash * style: apply Prettier formatting --------- Co-authored-by: YuliaDemir <129578495+YuliaDemir@users.noreply.github.com>
* Story/1 sticky header general (#50) * feat: install next+ts+linter+prettier+ husky+redux * feat: configs + perfectionist + lint fix * feat: install scss * refactor: add some folders * feat: install i18n + basic configs * feat: add internatiolisation * feat: language switcher * feat: dependencies update * feat: add sticky header * feat: add mui Button-and-Link-like component * fix: lint * style: add style for header * refactor: remove css from language selector * refactor: add const for flex styles in the header boxes * refactor: history style as link * fix: add some fixes * feat: schema json yaml support (#63) * chore: setup libraries * feat: swagger-editor * refactor: move title and description into a separated component * refactor: moved controls into the swaggerControl component * chore: update package-lock.json * fix: fix import in swagger-view * feat: add translations into SwaggerControl, SwaggerEditor, SwaggerViewer * fix: fix title translation in main text * fix: enforce unique keys when parsing YAML * refactor: extract DEFAULT_SCHEMA into a constant * feat: add tooltip explaining disabled format toggle * test: add test coverage for schema editing flow * fix: resolve component type errors in swagger viewer * fix: add request timeout with AbortController * fix: preserve Monaco editor undo history and cursor position on format switch * fix: prevent restore fetch from overwriting user-edited schema * fix: handle rejected promise in restoreSchema to prevent unhandled rejection * fix: replace missing setEditorValue with handleEditorChange in SwaggerEditor * fix: apply syntax highlighting immediately on editor mount * fix: preserve original JSON parse error * fix: disable external $ref resolution in schema validation to prevent SSRF * refactor: split SwaggerControl into service, component, and helper move save request to schema-service extract FormatToggle component extract getSignalWithTimeout helper switch errors to toast notifications * refactor: rename useSwaggerHook and drop unnecessary useMemo * test: fix tests after refactor * refactor: extract duplicated language-setting logic into helper in SwaggerMonacoEditor * refactor: remove redundant SwaggerViewer title * fix: use translated conversionError message instead of hardcoded string * refactor: extract SchemaFormat and isRecord into shared schema-types module * fix: reserve space for status alert to prevent layout shift on locale switch * feat: sync Monaco editor theme with app color scheme * style: add shadow, border-radius, deduplicate panel styles * test: fix ReactElement import in swagger-control tests * feat: extract schema fetch logic into SchemaService with restore and save methods * fix: extract magic number into named constant * refactor: extract isRecord type guard into its own module * fix: validate restore payload and cancel restore request on unmount * test: add tests for monaco theme * feat: add SwaggerViewer placeholder component * fix: route SwaggerControl toast messages through shared toaster namespace --------- Co-authored-by: Yulia Demir <Nightelfin91@gmail.com> * fix: remove duplicate SwaggerViewer implementation in swagger-view folder * fix: remove unused key from swaggerControl i18n namespace * fix: guard non-object JSON in SchemaService.restore * refactor: catch unhandled rejection in debounced validation --------- Co-authored-by: YuliaDemir <129578495+YuliaDemir@users.noreply.github.com> Co-authored-by: Yulia Demir <Nightelfin91@gmail.com>


Summary
Implemented the app header behavior for authenticated and non-authenticated users, added sticky header behavior with animation, and introduced a reusable
AppLinkButtoncomponent for navigation-style buttons.Changes Made
Added header actions for non-authenticated users:
Sign InSign UpAdded header actions for authenticated users:
HistorySign OutAdded navigation link to the About page in the header
Added sticky header behavior with animation when the page is scrolled.
Created reusable
AppLinkButtoncomponent for link-based buttons.Used
AppLinkButtonfor navigation actions to keep button styling and behavior consistent across the app.Related issue
Closes #19 #17 #9
Feature
Feature 1: App Header
Feature 7: General Requirements
Also add the matching labels from the Labels panel on the right:
Feature 1: App HeaderFeature 7: General RequirementsAcceptance criteria
Feature 1: App Header
Feature 2: Sign In / Sign Up
Feature 3: Swagger Editor
Feature 4: Swagger Viewer
Feature 5: History and Analytics
Feature 6: About Page
Feature 7: General Requirements
Feature 8: YouTube Video
Type of change
Checklist
any/@ts-ignore