Skip to content
Snippets Groups Projects
Unverified Commit 01515c6a authored by Ahmad Farhat's avatar Ahmad Farhat Committed by GitHub
Browse files

General cleanup (#4772)

parent 6f274cdb
Branches
No related tags found
No related merge requests found
......@@ -17,12 +17,15 @@ import useCreateServerRoom from '../../../hooks/mutations/admin/manage_users/use
import DeleteUserForm from './forms/DeleteUserForm';
import useUpdateUserStatus from '../../../hooks/mutations/admin/manage_users/useUpdateUserStatus';
import RoleBadge from '../roles/RoleBadge';
import { useAuth } from '../../../contexts/auth/AuthProvider';
export default function ManageUserRow({ user }) {
const { t } = useTranslation();
const currentUser = useAuth();
const mutationWrapper = (args) => useCreateServerRoom({ userId: user.id, ...args });
const updateUserStatus = useUpdateUserStatus();
const localizedTime = localizeDateTimeString(user?.created_at, user?.language);
const localizedTime = localizeDateTimeString(user?.created_at, currentUser?.language);
return (
<tr key={user.id} className="align-middle text-muted border border-2">
......
......@@ -32,11 +32,12 @@ export default function SettingSelect({
SettingSelect.defaultProps = {
defaultValue: '',
children: undefined,
};
SettingSelect.propTypes = {
defaultValue: PropTypes.string,
title: PropTypes.string.isRequired,
description: PropTypes.string.isRequired,
children: PropTypes.arrayOf(PropTypes.element).isRequired,
children: PropTypes.arrayOf(PropTypes.element),
};
import React, { useEffect, useMemo } from 'react';
import React, { useEffect } from 'react';
import {
Col, Row,
} from 'react-bootstrap';
......@@ -31,10 +31,9 @@ export default function HomePage() {
[currentUser.signed_in],
);
// hack to deal with the fact that useEffect and toast dont work together very well
useMemo(() => {
useEffect(() => {
switch (error) {
case 'InviteInvald':
case 'InviteInvalid':
toast.error(t('toast.error.users.invalid_invite'));
break;
case 'SignupError':
......@@ -42,8 +41,7 @@ export default function HomePage() {
break;
default:
}
// Remove the error
setSearchParams(searchParams.delete('error'));
if (error) { setSearchParams(searchParams.delete('error')); }
}, [error]);
return (
......
......@@ -97,7 +97,7 @@ export default function RecordingRow({
<Button
onClick={() => window.open(format.url, '_blank')}
className={`btn-sm rounded-pill me-1 mt-1 border-0 btn-format-${format.recording_type.toLowerCase()}`}
key={format.id}
key={`${format.recording_type}-${format.url}`}
>
{format.recording_type}
</Button>
......
......@@ -90,7 +90,10 @@ RecordingsList.propTypes = {
name: PropTypes.string,
length: PropTypes.number,
visibility: PropTypes.string,
formats: PropTypes.arrayOf(PropTypes.string),
formats: PropTypes.arrayOf(PropTypes.shape({
recording_type: PropTypes.string,
url: PropTypes.string,
})),
users: PropTypes.arrayOf(PropTypes.shape({
id: PropTypes.number,
name: PropTypes.string,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment