diff --git a/ts/components/Select.tsx b/ts/components/Select.tsx index b47578adf..7ca39008b 100644 --- a/ts/components/Select.tsx +++ b/ts/components/Select.tsx @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import React from 'react'; +import React, { ChangeEvent } from 'react'; import classNames from 'classnames'; export type Option = Readonly<{ @@ -19,7 +19,7 @@ export type PropsType = Readonly<{ export function Select(props: PropsType): JSX.Element { const { moduleClassName, value, options, onChange } = props; - const onSelectChange = (event: React.ChangeEvent) => { + const onSelectChange = (event: ChangeEvent) => { onChange(event.target.value); }; diff --git a/ts/components/conversation/conversation-details/GroupLinkManagement.tsx b/ts/components/conversation/conversation-details/GroupLinkManagement.tsx index de1e65188..bb2d07f23 100644 --- a/ts/components/conversation/conversation-details/GroupLinkManagement.tsx +++ b/ts/components/conversation/conversation-details/GroupLinkManagement.tsx @@ -9,6 +9,7 @@ import { LocalizerType } from '../../../types/Util'; import { PanelRow } from './PanelRow'; import { PanelSection } from './PanelSection'; import { AccessControlClass } from '../../../textsecure.d'; +import { Select } from '../../Select'; export type PropsType = { accessEnum: typeof AccessControlClass.AccessRequired; @@ -36,8 +37,8 @@ export const GroupLinkManagement: React.ComponentType = ({ } const createEventHandler = (handleEvent: (x: boolean) => void) => { - return (event: React.ChangeEvent) => { - handleEvent(event.target.value === 'true'); + return (value: string) => { + handleEvent(value === 'true'); }; }; @@ -57,19 +58,20 @@ export const GroupLinkManagement: React.ComponentType = ({ label={i18n('ConversationDetails--group-link')} right={ isAdmin ? ( -
- -
+ - - - - + - {accessControlOptions.map(({ name, value }) => ( - - ))} - - + - {accessControlOptions.map(({ name, value }) => ( - - ))} - - +