Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: separated header dropdown #286

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
3 changes: 3 additions & 0 deletions packages/desktop/src/header-drop-down/HeaderDropDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface HeaderDropDownProps {
target: OverlayProps['target']
container: OverlayProps['container']
children: React.ReactElement
separated?: boolean
onHide: () => void
}

Expand All @@ -40,6 +41,7 @@ export const HeaderDropDown: FC<HeaderDropDownProps> = ({
show,
target,
container,
separated,
onHide,
children,
}) => (
Expand Down Expand Up @@ -75,6 +77,7 @@ export const HeaderDropDown: FC<HeaderDropDownProps> = ({
width={1}
pt={12}
pb={12}
bt={separated ? 'solid 1px #e6e6e6' : undefined}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а разве не всегда подчёркивание должно быть?

s="0 0 16px 0 rgba(0, 0, 0, 0.12)"
>
{children}
Expand Down
11 changes: 9 additions & 2 deletions packages/desktop/src/header-menu/HeaderMenuItem.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {forwardRef, Ref} from 'react'

import {LinkControl, Lnk, Flex, Pos, Card, LinkControlProps} from '@qiwi/pijma-core'
import {LinkControl, Lnk, Flex, Pos, Card, LinkControlProps, Value} from '@qiwi/pijma-core'

import {Text} from '../typography'

Expand All @@ -12,6 +12,7 @@ export interface HeaderMenuItemProps {
rel?: LinkControlProps['rel']
title?: string
active?: boolean
underlineOffset?: Value
ref?: Ref<HTMLAnchorElement>
onClick?: LinkControlProps['onClick']
onFocus?: LinkControlProps['onFocus']
Expand Down Expand Up @@ -62,7 +63,13 @@ export const HeaderMenuItem = forwardRef<HTMLAnchorElement, HeaderMenuItemProps>
</Text>
</Flex>
{props.active ? (
<Pos type="absolute" height="4px" bottom={0} right={0} left={0}>
<Pos
type="absolute"
height="4px"
bottom={props.underlineOffset || 0}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а это что такое? )

right={0}
left={0}
>
<Card bg="#ff8c00" height={1} width={1} rtr={4} rtl={4}/>
</Pos>
) : null}
Expand Down