InviteViaLinkModal: Update design (#4156)
This commit is contained in:
parent
8248de44a6
commit
16c2fdbc04
@ -35,6 +35,10 @@
|
|||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
|
|
||||||
|
&.withRoundedCheckbox {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 600px) {
|
@media (max-width: 600px) {
|
||||||
padding-left: 0 !important;
|
padding-left: 0 !important;
|
||||||
padding-right: 0 !important;
|
padding-right: 0 !important;
|
||||||
|
|||||||
@ -24,6 +24,7 @@ import PrivateChatInfo from './PrivateChatInfo';
|
|||||||
import './Picker.scss';
|
import './Picker.scss';
|
||||||
|
|
||||||
type OwnProps = {
|
type OwnProps = {
|
||||||
|
className?: string;
|
||||||
itemIds: string[];
|
itemIds: string[];
|
||||||
selectedIds: string[];
|
selectedIds: string[];
|
||||||
filterValue?: string;
|
filterValue?: string;
|
||||||
@ -49,6 +50,7 @@ const MAX_FULL_ITEMS = 10;
|
|||||||
const ALWAYS_FULL_ITEMS_COUNT = 5;
|
const ALWAYS_FULL_ITEMS_COUNT = 5;
|
||||||
|
|
||||||
const Picker: FC<OwnProps> = ({
|
const Picker: FC<OwnProps> = ({
|
||||||
|
className,
|
||||||
itemIds,
|
itemIds,
|
||||||
selectedIds,
|
selectedIds,
|
||||||
filterValue,
|
filterValue,
|
||||||
@ -127,7 +129,7 @@ const Picker: FC<OwnProps> = ({
|
|||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="Picker">
|
<div className={buildClassName('Picker', className)}>
|
||||||
{isSearchable && (
|
{isSearchable && (
|
||||||
<div className="picker-header custom-scroll" dir={lang.isRtl ? 'rtl' : undefined}>
|
<div className="picker-header custom-scroll" dir={lang.isRtl ? 'rtl' : undefined}>
|
||||||
{lockedSelectedIds.map((id, i) => (
|
{lockedSelectedIds.map((id, i) => (
|
||||||
@ -162,7 +164,7 @@ const Picker: FC<OwnProps> = ({
|
|||||||
|
|
||||||
{viewportIds?.length ? (
|
{viewportIds?.length ? (
|
||||||
<InfiniteScroll
|
<InfiniteScroll
|
||||||
className="picker-list custom-scroll"
|
className={buildClassName('picker-list', 'custom-scroll', isRoundCheckbox && 'withRoundedCheckbox')}
|
||||||
items={viewportIds}
|
items={viewportIds}
|
||||||
onLoadMore={getMore}
|
onLoadMore={getMore}
|
||||||
noScrollRestore={noScrollRestore}
|
noScrollRestore={noScrollRestore}
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
.contentText {
|
.contentText {
|
||||||
color: var(--color-text-secondary);
|
color: var(--color-text-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.userPicker {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|||||||
@ -38,9 +38,9 @@ const InviteViaLinkModal: FC<OwnProps> = ({
|
|||||||
}, [userIds]);
|
}, [userIds]);
|
||||||
|
|
||||||
const handleClose = useLastCallback(() => closeInviteViaLinkModal());
|
const handleClose = useLastCallback(() => closeInviteViaLinkModal());
|
||||||
const handleClickSkip = useLastCallback(() => closeInviteViaLinkModal());
|
const handleSkip = useLastCallback(() => closeInviteViaLinkModal());
|
||||||
|
|
||||||
const handleClickSendInviteLink = useCallback(() => {
|
const handleSendInviteLink = useCallback(() => {
|
||||||
sendInviteMessages({ chatId: chatId!, userIds: selectedMemberIds! });
|
sendInviteMessages({ chatId: chatId!, userIds: selectedMemberIds! });
|
||||||
closeInviteViaLinkModal();
|
closeInviteViaLinkModal();
|
||||||
}, [selectedMemberIds, chatId]);
|
}, [selectedMemberIds, chatId]);
|
||||||
@ -61,23 +61,25 @@ const InviteViaLinkModal: FC<OwnProps> = ({
|
|||||||
{renderText(lang('SendInviteLink.TextAvailableSingleUser', userNames), ['simple_markdown'])}
|
{renderText(lang('SendInviteLink.TextAvailableSingleUser', userNames), ['simple_markdown'])}
|
||||||
</p>
|
</p>
|
||||||
<Picker
|
<Picker
|
||||||
|
className={styles.userPicker}
|
||||||
itemIds={userIds!}
|
itemIds={userIds!}
|
||||||
selectedIds={selectedMemberIds ?? []}
|
selectedIds={selectedMemberIds}
|
||||||
onSelectedIdsChange={setSelectedMemberIds}
|
onSelectedIdsChange={setSelectedMemberIds}
|
||||||
|
isRoundCheckbox
|
||||||
/>
|
/>
|
||||||
<div className="dialog-buttons">
|
<div className="dialog-buttons">
|
||||||
<Button
|
<Button
|
||||||
className="confirm-dialog-button"
|
className="confirm-dialog-button"
|
||||||
isText
|
isText
|
||||||
onClick={handleClickSendInviteLink}
|
onClick={handleSendInviteLink}
|
||||||
disabled={!selectedMemberIds?.length}
|
disabled={!selectedMemberIds.length}
|
||||||
>
|
>
|
||||||
{lang('SendInviteLink.ActionInvite')}
|
{lang('SendInviteLink.ActionInvite')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
className="confirm-dialog-button"
|
className="confirm-dialog-button"
|
||||||
isText
|
isText
|
||||||
onClick={handleClickSkip}
|
onClick={handleSkip}
|
||||||
>
|
>
|
||||||
{lang('SendInviteLink.ActionSkip')}
|
{lang('SendInviteLink.ActionSkip')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@ -455,6 +455,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.chat-item {
|
||||||
|
.ListItem-button {
|
||||||
|
padding: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Checkbox {
|
||||||
|
padding-left: 3rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.multiline-item {
|
.multiline-item {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
white-space: initial;
|
white-space: initial;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user