Skip to content

Conversation

@vovaspace
Copy link
Collaborator

No description provided.

@vovaspace vovaspace marked this pull request as ready for review February 29, 2024 14:43
@artemmufazalov artemmufazalov linked an issue Mar 1, 2024 that may be closed by this pull request
artemmufazalov
artemmufazalov previously approved these changes Mar 4, 2024
Comment on lines 9 to 14
export const ClusterModeGuard: FC<ClusterModeGuardProps> = ({children, mode}) =>
useTypedSelector((state) =>
mode === 'single' ? state.singleClusterMode : !state.singleClusterMode,
)
? (children as ReactElement)
: null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

it's difficult to read such ternaries. Let's rewrite it like this:

Suggested change
export const ClusterModeGuard: FC<ClusterModeGuardProps> = ({children, mode}) =>
useTypedSelector((state) =>
mode === 'single' ? state.singleClusterMode : !state.singleClusterMode,
)
? (children as ReactElement)
: null;
export function ClusterModeGuard({children, mode}: ClusterModeGuardProps) {
const isMode = useTypedSelector((state) =>
mode === 'single' ? state.singleClusterMode : !state.singleClusterMode,
);
return isMode ? <React.Fragment>{children}</React.Fragment> : null;
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Implemented in 66eade8.

Co-authored-by: Valerii Sidorenko <balepas@nebius.com>
ValeraS
ValeraS previously approved these changes Mar 4, 2024
@vovaspace vovaspace merged commit dd126b0 into ydb-platform:main Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display base64 query response as string

3 participants