Skip to content

Commit

Permalink
fix: GenericModal with no ask again checkbox missing margin (#32414)
Browse files Browse the repository at this point in the history
  • Loading branch information
dougfabris committed May 13, 2024
1 parent 3b06229 commit ff35376
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/weak-starfishes-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fixes the missing spacing on don`t ask again checkbox inside modals
10 changes: 7 additions & 3 deletions apps/meteor/client/components/GenericModal/withDoNotAskAgain.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
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';
Expand All @@ -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;

Expand All @@ -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}
Expand Down

0 comments on commit ff35376

Please sign in to comment.