Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

SITE-3882/seat-selection #574

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion src/components/Popover/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function Popover(props: TPopoverProps): JSX.Element {
zIndex = OVERLAY_Z_INDEX - 1,
className = '',
autoWidth = false,
isHidden = false,
} = props

const {
Expand All @@ -37,6 +38,8 @@ function Popover(props: TPopoverProps): JSX.Element {
side,
} = usePopover(placement)

const isPopoverShow = isOpen && !isHidden

return (
<>
<div
Expand All @@ -48,7 +51,7 @@ function Popover(props: TPopoverProps): JSX.Element {
>
{children}
</div>
{isOpen && (
{isPopoverShow && (
<Portal>
<GlobalStylesScope>
<div
Expand Down
2 changes: 2 additions & 0 deletions src/components/Popover/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ type TPopoverProps = {
className?: string,

autoWidth?: boolean,

isHidden?: boolean,
}

type TPopoverWithDefaultsProps = Required<TPopoverProps>
Expand Down
1 change: 1 addition & 0 deletions src/components/Toggler/Toggler.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const GenderToggler = (args: TTogglerProps): JSX.Element => {
{...args}
onChange={onChange}
name="gender"
disabled
>
<TogglerItem value="male">
Мужской
Expand Down
4 changes: 4 additions & 0 deletions src/components/Toggler/TogglerGroup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ type TProps = {
name?: string,

helperText?: React.ReactNode,

disabled?: boolean,
}

/**
Expand All @@ -44,6 +46,7 @@ const TogglerGroup = ({
errorMessage = '',
name = '',
helperText = '',
disabled = false,
...props
}: TProps): JSX.Element => {
return (
Expand All @@ -68,6 +71,7 @@ const TogglerGroup = ({
errorMessage,
name,
hasDelimiter,
disabled,
...props,
})
})}
Expand Down
3 changes: 3 additions & 0 deletions src/components/Toggler/TogglerItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type TProps = {
onBlur?: () => void,
className?: string,
hasDelimiter?: boolean,
disabled?: boolean,
}

const ENTER_KEY_CODE = 13
Expand All @@ -32,6 +33,7 @@ const TogglerItem = ({
onBlur,
className = '',
hasDelimiter = true,
disabled = false,
...props
}: TProps): JSX.Element => {
const isSelected = value === currentValue
Expand All @@ -43,6 +45,7 @@ const TogglerItem = ({
as="div"
onClick={() => onChange(value)}
className={className}
disabled={disabled}
>
{children}
</StyledWrapper>
Expand Down
8 changes: 8 additions & 0 deletions src/components/Toggler/TogglerItem/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { borderRadiusSmall } from 'utils/borderRadius'

interface TStyledWrapperProps {
isSelected: boolean,
disabled: boolean,
}

export const StyledWrapper = styled.span<TStyledWrapperProps>`
Expand All @@ -26,6 +27,13 @@ export const StyledWrapper = styled.span<TStyledWrapperProps>`
font-weight: 500;
box-shadow: 0px 1px 3px rgba(98, 112, 139, 0.2);
`}

${({ disabled }) => disabled && css`
pointer-events: none;
cursor: default;
color: ${({ theme }) => theme.color.colorTextAccentDisable};
`}

${({ theme }) => css`
@media ${theme.queries.isMobile} {
font-size: 14px;
Expand Down