mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-06-13 11:31:22 +00:00
Translate listOfBans
This commit is contained in:
parent
ea6b9bf93d
commit
5daf76ace6
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"action": {
|
"action": {
|
||||||
|
"cancel_ban": "cancel ban",
|
||||||
"create_group": "create group",
|
"create_group": "create group",
|
||||||
"find_group": "find group",
|
"find_group": "find group",
|
||||||
"join_group": "join group",
|
"join_group": "join group",
|
||||||
@ -9,6 +10,7 @@
|
|||||||
},
|
},
|
||||||
"advanced_options": "advanced options",
|
"advanced_options": "advanced options",
|
||||||
"approval_threshold": "group Approval Threshold (number / percentage of Admins that must approve a transaction)",
|
"approval_threshold": "group Approval Threshold (number / percentage of Admins that must approve a transaction)",
|
||||||
|
"ban_list": "ban list",
|
||||||
"block_delay": {
|
"block_delay": {
|
||||||
"minimum": "minimum Block delay for Group Transaction Approvals",
|
"minimum": "minimum Block delay for Group Transaction Approvals",
|
||||||
"maximum": "maximum Block delay for Group Transaction Approvals"
|
"maximum": "maximum Block delay for Group Transaction Approvals"
|
||||||
@ -25,6 +27,7 @@
|
|||||||
"invitation_expiry": "invitation Expiry Time",
|
"invitation_expiry": "invitation Expiry Time",
|
||||||
"join_requests": "join requests",
|
"join_requests": "join requests",
|
||||||
"question": {
|
"question": {
|
||||||
|
"cancel_ban": "would you like to perform a CANCEL_GROUP_BAN transaction?",
|
||||||
"create_group": "would you like to perform an CREATE_GROUP transaction?",
|
"create_group": "would you like to perform an CREATE_GROUP transaction?",
|
||||||
"group_invite": "would you like to perform a GROUP_INVITE transaction?",
|
"group_invite": "would you like to perform a GROUP_INVITE transaction?",
|
||||||
"join_group": "would you like to perform an JOIN_GROUP transaction?",
|
"join_group": "would you like to perform an JOIN_GROUP transaction?",
|
||||||
@ -55,7 +58,8 @@
|
|||||||
"join_creation": "successfully requested to join group. It may take a couple of minutes for the changes to propagate",
|
"join_creation": "successfully requested to join group. It may take a couple of minutes for the changes to propagate",
|
||||||
"group_join_name": "joined group {{group_name}}: awaiting confirmation",
|
"group_join_name": "joined group {{group_name}}: awaiting confirmation",
|
||||||
"group_join_label": "joined group {{name}}: success!",
|
"group_join_label": "joined group {{name}}: success!",
|
||||||
"loading_threads": "loading threads... please wait."
|
"loading_threads": "loading threads... please wait.",
|
||||||
|
"unbanned_user": "successfully unbanned user. It may take a couple of minutes for the changes to propagate"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ import { getNameInfo } from './Group';
|
|||||||
import { getFee } from '../../background';
|
import { getFee } from '../../background';
|
||||||
import { LoadingButton } from '@mui/lab';
|
import { LoadingButton } from '@mui/lab';
|
||||||
import { getBaseApiReact } from '../../App';
|
import { getBaseApiReact } from '../../App';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
export const getMemberInvites = async (groupNumber) => {
|
export const getMemberInvites = async (groupNumber) => {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
@ -55,6 +56,7 @@ export const ListOfBans = ({ groupId, setInfoSnack, setOpenSnack, show }) => {
|
|||||||
const [openPopoverIndex, setOpenPopoverIndex] = useState(null); // Track which list item has the popover open
|
const [openPopoverIndex, setOpenPopoverIndex] = useState(null); // Track which list item has the popover open
|
||||||
const listRef = useRef();
|
const listRef = useRef();
|
||||||
const [isLoadingUnban, setIsLoadingUnban] = useState(false);
|
const [isLoadingUnban, setIsLoadingUnban] = useState(false);
|
||||||
|
const { t } = useTranslation(['core', 'group']);
|
||||||
|
|
||||||
const getInvites = async (groupId) => {
|
const getInvites = async (groupId) => {
|
||||||
try {
|
try {
|
||||||
@ -87,7 +89,7 @@ export const ListOfBans = ({ groupId, setInfoSnack, setOpenSnack, show }) => {
|
|||||||
// TODO translate
|
// TODO translate
|
||||||
const fee = await getFee('CANCEL_GROUP_BAN');
|
const fee = await getFee('CANCEL_GROUP_BAN');
|
||||||
await show({
|
await show({
|
||||||
message: 'Would you like to perform a CANCEL_GROUP_BAN transaction?',
|
message: t('group:question.cancel_ban', { postProcess: 'capitalize' }),
|
||||||
publishFee: fee.fee + ' QORT',
|
publishFee: fee.fee + ' QORT',
|
||||||
});
|
});
|
||||||
setIsLoadingUnban(true);
|
setIsLoadingUnban(true);
|
||||||
@ -103,8 +105,9 @@ export const ListOfBans = ({ groupId, setInfoSnack, setOpenSnack, show }) => {
|
|||||||
setIsLoadingUnban(false);
|
setIsLoadingUnban(false);
|
||||||
setInfoSnack({
|
setInfoSnack({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message:
|
message: t('group:message.success.unbanned_user', {
|
||||||
'Successfully unbanned user. It may take a couple of minutes for the changes to propagate',
|
postProcess: 'capitalize',
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
handlePopoverClose();
|
handlePopoverClose();
|
||||||
setOpenSnack(true);
|
setOpenSnack(true);
|
||||||
@ -127,6 +130,7 @@ export const ListOfBans = ({ groupId, setInfoSnack, setOpenSnack, show }) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoadingUnban(false);
|
setIsLoadingUnban(false);
|
||||||
}
|
}
|
||||||
@ -177,10 +181,13 @@ export const ListOfBans = ({ groupId, setInfoSnack, setOpenSnack, show }) => {
|
|||||||
variant="contained"
|
variant="contained"
|
||||||
onClick={() => handleCancelBan(member?.offender)}
|
onClick={() => handleCancelBan(member?.offender)}
|
||||||
>
|
>
|
||||||
Cancel Ban
|
{t('group:action.cancel_ban', {
|
||||||
|
postProcess: 'capitalize',
|
||||||
|
})}
|
||||||
</LoadingButton>
|
</LoadingButton>
|
||||||
</Box>
|
</Box>
|
||||||
</Popover>
|
</Popover>
|
||||||
|
|
||||||
<ListItemButton
|
<ListItemButton
|
||||||
onClick={(event) => handlePopoverOpen(event, index)}
|
onClick={(event) => handlePopoverOpen(event, index)}
|
||||||
>
|
>
|
||||||
@ -205,7 +212,7 @@ export const ListOfBans = ({ groupId, setInfoSnack, setOpenSnack, show }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<p>Ban list</p>
|
<p>{t('group:ban_list', { postProcess: 'capitalize' })}</p>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user