mirror of
https://github.com/balzack/databag.git
synced 2025-02-11 19:19:16 +00:00
styling detail modals
This commit is contained in:
parent
721b4d35b2
commit
e83bd155c4
@ -162,7 +162,12 @@ export const en = {
|
||||
fontSize: 'Change Font Size',
|
||||
postMessage: 'Post Message',
|
||||
|
||||
close: 'Close',
|
||||
leave: 'Leave',
|
||||
confirmTopic: 'Deleting Topic',
|
||||
sureTopic: 'Are you sure you want to delete this topic?',
|
||||
confirmLeave: 'Leaving Topic',
|
||||
sureLeave: 'Are you sure you want to leave this topic?',
|
||||
};
|
||||
|
||||
export const fr = {
|
||||
@ -329,6 +334,11 @@ export const fr = {
|
||||
fontSize: 'Changer la Taille du Text',
|
||||
postMessage: 'Publier le Message',
|
||||
|
||||
leave: 'Partir',
|
||||
close: 'Fermer',
|
||||
leave: 'Quitter',
|
||||
confirmTopic: 'Suppression du Sujet',
|
||||
sureTopic: 'Êtes-Vous Sûr de Vouloir Supprimer ce Sujet?',
|
||||
confirmLeave: 'Quitter le Suject',
|
||||
sureLeave: 'Êtes-Vous Sûr de Vouloir Quitter ce Sujet?',
|
||||
};
|
||||
|
||||
|
@ -16,7 +16,7 @@ export function AccountItem({ item, remove }) {
|
||||
content: <span style={state.menuStyle}>{state.strings.areSure}</span>,
|
||||
icon: <ExclamationCircleOutlined />,
|
||||
bodyStyle: { borderRadius: 8, padding: 16, ...state.menuStyle },
|
||||
okText: state.strings.ok,
|
||||
okText: state.strings.remove,
|
||||
cancelText: state.strings.cancel,
|
||||
onOk() {
|
||||
applyRemoveAccount();
|
||||
|
@ -30,14 +30,15 @@ export function SelectItem({ item, select, selected, markup, setItem, clearItem
|
||||
|
||||
return (
|
||||
<SelectItemWrapper onClick={onSelect}>
|
||||
<div class={ state.className }>
|
||||
{ state.logoSet && (
|
||||
<div className={ state.className }>
|
||||
<Logo url={state.logo} width={32} height={32} radius={8} />
|
||||
<div class="details">
|
||||
<div class="name">{ profile?.name }</div>
|
||||
<div class="handle">{ handle() }</div>
|
||||
<div className="details">
|
||||
<div className="name">{ profile?.name }</div>
|
||||
<div className="handle">{ handle() }</div>
|
||||
</div>
|
||||
{ (select || setItem || clearItem) && (
|
||||
<div class="switch">
|
||||
<div className="switch">
|
||||
<Switch checked={state.selected} onChange={(flag, ev) => onSelect(ev)} size="small" />
|
||||
</div>
|
||||
)}
|
||||
@ -47,6 +48,7 @@ export function SelectItem({ item, select, selected, markup, setItem, clearItem
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</SelectItemWrapper>
|
||||
);
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ export function useSelectItem(item, selected, markup) {
|
||||
|
||||
const [state, setState] = useState({
|
||||
logo: null,
|
||||
logoSet: false,
|
||||
selected: false,
|
||||
busy: false,
|
||||
className: 'passive',
|
||||
@ -30,10 +31,10 @@ export function useSelectItem(item, selected, markup) {
|
||||
useEffect(() => {
|
||||
const contact = card.state.cards.get(item.id);
|
||||
if (contact?.data?.cardProfile?.imageSet) {
|
||||
updateState({ logo: card.actions.getCardImageUrl(item.id) });
|
||||
updateState({ logoSet: true, logo: card.actions.getCardImageUrl(item.id) });
|
||||
}
|
||||
else {
|
||||
updateState({ logo: null });
|
||||
updateState({ logoSet: true, logo: null });
|
||||
}
|
||||
}, [card, item]);
|
||||
|
||||
|
@ -44,11 +44,12 @@ export function Details({ closeDetails, closeConversation, openContact }) {
|
||||
|
||||
const deleteChannel = async () => {
|
||||
modal.confirm({
|
||||
title: 'Are you sure you want to delete the topic?',
|
||||
title: <span style={state.menuStyle}>{state.strings.confirmTopic}</span>,
|
||||
content: <span style={state.menuStyle}>{state.strings.sureTopic}</span>,
|
||||
icon: <ExclamationCircleOutlined />,
|
||||
bodyStyle: { padding: 16 },
|
||||
okText: "Yes, Delete",
|
||||
cancelText: "No, Cancel",
|
||||
bodyStyle: { borderRadius: 8, padding: 16, ...state.menuStyle },
|
||||
okText: state.strings.remove,
|
||||
cancelText: state.strings.cancel,
|
||||
onOk() {
|
||||
applyDeleteChannel();
|
||||
},
|
||||
@ -72,11 +73,12 @@ export function Details({ closeDetails, closeConversation, openContact }) {
|
||||
|
||||
const leaveChannel = async () => {
|
||||
modal.confirm({
|
||||
title: 'Are you sure you want to leave the topic?',
|
||||
title: <span style={state.menuStyle}>{state.strings.confirmLeave}</span>,
|
||||
content: <span style={state.menuStyle}>{state.strings.sureLeave}</span>,
|
||||
icon: <ExclamationCircleOutlined />,
|
||||
bodyStyle: { padding: 16 },
|
||||
okText: "Yes, Leave",
|
||||
cancelText: "No, Cancel",
|
||||
bodyStyle: { borderRadius: 8, padding: 16, ...state.menuStyle },
|
||||
okText: state.strings.leave,
|
||||
cancelText: state.strings.cancel,
|
||||
onOk() {
|
||||
applyLeaveChannel();
|
||||
},
|
||||
@ -228,9 +230,8 @@ export function Details({ closeDetails, closeConversation, openContact }) {
|
||||
<EditSubject subject={state.editSubject} cancelSubject={actions.clearEditSubject} saveSubject={saveSubject} setSubject={actions.setSubjectUpdate}
|
||||
strings={state.strings} />
|
||||
</Modal>
|
||||
<Modal title="Edit Members" centered visible={state.showEditMembers} footer={editMembersFooter}
|
||||
bodyStyle={{ padding: 16 }} onCancel={actions.clearEditMembers}>
|
||||
<EditMembers members={state.editMembers} setMember={setMember} clearMember={clearMember} />
|
||||
<Modal centered visible={state.showEditMembers} closable={false} footer={null} bodyStyle={{borderRadius: 8, padding: 16, ...state.menuStyle}}>
|
||||
<EditMembers members={state.editMembers} setMember={setMember} clearMember={clearMember} onClose={actions.clearEditMembers} strings={state.strings} />
|
||||
</Modal>
|
||||
</DetailsWrapper>
|
||||
);
|
||||
|
@ -1,11 +1,14 @@
|
||||
import { EditMembersWrapper } from './EditMembers.styled';
|
||||
import { CardSelect } from '../../cardSelect/CardSelect';
|
||||
import { Button } from 'antd';
|
||||
|
||||
export function EditMembers({ members, setMember, clearMember }) {
|
||||
export function EditMembers({ members, setMember, clearMember, onClose, strings }) {
|
||||
|
||||
return (
|
||||
<EditMembersWrapper>
|
||||
<div class="list">
|
||||
<div className="title">Edit Membership</div>
|
||||
|
||||
<div className="list">
|
||||
<CardSelect
|
||||
setItem={setMember}
|
||||
clearItem={clearMember}
|
||||
@ -13,6 +16,9 @@ export function EditMembers({ members, setMember, clearMember }) {
|
||||
filter={(card) => card?.data?.cardDetail?.status === 'connected'}
|
||||
/>
|
||||
</div>
|
||||
<div className="controls">
|
||||
<Button key="back" onClick={onClose}>{strings.close}</Button>
|
||||
</div>
|
||||
</EditMembersWrapper>
|
||||
);
|
||||
}
|
||||
|
@ -12,7 +12,22 @@ export const EditMembersWrapper = styled.div`
|
||||
min-height: 100px;
|
||||
max-height: 200px;
|
||||
overflow: auto;
|
||||
border: 1px solid ${Colors.divider};
|
||||
border: 1px solid ${props => props.theme.sectionBorder};
|
||||
background-color: ${props => props.theme.itemArea};
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 1.2rem;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding-bottom: 16px;
|
||||
}
|
||||
|
||||
.controls {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 16px;
|
||||
padding-top: 16px;
|
||||
width: 100%;
|
||||
}
|
||||
`
|
||||
|
Loading…
Reference in New Issue
Block a user