Skip to content
Snippets Groups Projects
Unverified Commit ff35376c authored by Douglas Fabris's avatar Douglas Fabris Committed by GitHub
Browse files

fix: `GenericModal` with no ask again checkbox missing margin (#32414)

parent 3b06229b
No related branches found
No related tags found
No related merge requests found
---
'@rocket.chat/meteor': patch
---
Fixes the missing spacing on don`t ask again checkbox inside modals
import { Box, CheckBox } from '@rocket.chat/fuselage';
import { Box, Label, CheckBox } from '@rocket.chat/fuselage';
import { useUniqueId } from '@rocket.chat/fuselage-hooks';
import { useUserPreference, useTranslation, useEndpoint } from '@rocket.chat/ui-contexts';
import type { FC, ReactElement, ComponentType } from 'react';
import React, { useState } from 'react';
......@@ -23,6 +24,7 @@ function withDoNotAskAgain<T extends RequiredModalProps>(
): FC<DoNotAskAgainProps & Omit<T, keyof RequiredModalProps>> {
const WrappedComponent: FC<DoNotAskAgainProps & Omit<T, keyof RequiredModalProps>> = function ({ onConfirm, dontAskAgain, ...props }) {
const t = useTranslation();
const dontAskAgainId = useUniqueId();
const dontAskAgainList = useUserPreference<DontAskAgainList>('dontAskAgainList');
const { action, label } = dontAskAgain;
......@@ -49,8 +51,10 @@ function withDoNotAskAgain<T extends RequiredModalProps>(
{...props}
dontAskAgain={
<Box display='flex' flexDirection='row'>
<CheckBox checked={state} onChange={onChange} mie={4} name='dont_ask_again' />
<label htmlFor='dont_ask_again'>{t('Dont_ask_me_again')}</label>
<CheckBox id={dontAskAgainId} checked={state} onChange={onChange} name='dont_ask_again' />
<Label color='annotation' fontScale='p2' mis={8} htmlFor={dontAskAgainId}>
{t('Dont_ask_me_again')}
</Label>
</Box>
}
onConfirm={handleConfirm}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment