initial commit
This commit is contained in:
33
fluxer_app/src/components/alerts/CallNotRingableModal.tsx
Normal file
33
fluxer_app/src/components/alerts/CallNotRingableModal.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {GenericErrorModal} from './GenericErrorModal';
|
||||
|
||||
export const CallNotRingableModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<GenericErrorModal
|
||||
title={t`Unable to Start Call`}
|
||||
message={t`This user is not available to receive calls right now. They may have calls disabled.`}
|
||||
/>
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
import {openNativePermissionSettings} from '~/utils/NativePermissions';
|
||||
import {isDesktop, isNativeMacOS} from '~/utils/NativeUtils';
|
||||
|
||||
export const CameraPermissionDeniedModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
if (isDesktop() && isNativeMacOS()) {
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Camera Permission Required`}
|
||||
description={t`Fluxer needs access to your camera. Open System Settings → Privacy & Security → Camera, allow Fluxer, and then restart the app.`}
|
||||
primaryText={t`Open Settings`}
|
||||
primaryVariant="primary"
|
||||
onPrimary={() => openNativePermissionSettings('camera')}
|
||||
secondaryText={t`Close`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const message = isDesktop()
|
||||
? t`Fluxer needs access to your camera. Allow camera access in your operating system privacy settings and restart the app.`
|
||||
: t`Fluxer needs access to your camera to enable video chat. Please grant camera permission in your browser settings and try again.`;
|
||||
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Camera Permission Required`}
|
||||
description={message}
|
||||
primaryText={t`Understood`}
|
||||
onPrimary={() => {}}
|
||||
/>
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {GenericErrorModal} from './GenericErrorModal';
|
||||
|
||||
export const ChannelPermissionsUpdateFailedModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<GenericErrorModal
|
||||
title={t`Failed to update channel permissions`}
|
||||
message={t`We couldn't save your channel permission changes at this time.`}
|
||||
/>
|
||||
);
|
||||
});
|
||||
30
fluxer_app/src/components/alerts/DMCloseFailedModal.tsx
Normal file
30
fluxer_app/src/components/alerts/DMCloseFailedModal.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {GenericErrorModal} from './GenericErrorModal';
|
||||
|
||||
export const DMCloseFailedModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<GenericErrorModal title={t`Failed to close DM`} message={t`We couldn't close the direct message at this time.`} />
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
|
||||
export const FeatureTemporarilyDisabledModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Feature Temporarily Disabled`}
|
||||
description={t`This feature has been temporarily disabled. Please try again later.`}
|
||||
primaryText={t`Understood`}
|
||||
onPrimary={() => {}}
|
||||
/>
|
||||
);
|
||||
});
|
||||
52
fluxer_app/src/components/alerts/FileSizeTooLargeModal.tsx
Normal file
52
fluxer_app/src/components/alerts/FileSizeTooLargeModal.tsx
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import * as PremiumModalActionCreators from '~/actions/PremiumModalActionCreators';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
import UserStore from '~/stores/UserStore';
|
||||
|
||||
export const FileSizeTooLargeModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
const user = UserStore.currentUser;
|
||||
const hasPremium = user?.isPremium() ?? false;
|
||||
|
||||
if (hasPremium) {
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`File size too large`}
|
||||
description={t`The file you're trying to upload exceeds the maximum size limit of 500 MB for Plutonium subscribers.`}
|
||||
primaryText={t`Understood`}
|
||||
onPrimary={() => {}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`File Size Limit Exceeded`}
|
||||
description={t`The file you're trying to upload exceeds the maximum size limit of 25 MB for non-subscribers. With Plutonium, you can upload files up to 500 MB, use animated avatars and banners, write longer bios, and unlock many other premium features.`}
|
||||
primaryText={t`Get Plutonium`}
|
||||
primaryVariant="primary"
|
||||
onPrimary={() => PremiumModalActionCreators.open()}
|
||||
secondaryText={t`Cancel`}
|
||||
/>
|
||||
);
|
||||
});
|
||||
32
fluxer_app/src/components/alerts/GenericErrorModal.tsx
Normal file
32
fluxer_app/src/components/alerts/GenericErrorModal.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
|
||||
interface GenericErrorModalProps {
|
||||
title: string;
|
||||
message: React.ReactNode;
|
||||
}
|
||||
|
||||
export const GenericErrorModal: React.FC<GenericErrorModalProps> = observer(({title, message}) => {
|
||||
const {t} = useLingui();
|
||||
return <ConfirmModal title={title} description={message} primaryText={t`Understood`} onPrimary={() => {}} />;
|
||||
});
|
||||
33
fluxer_app/src/components/alerts/GroupLeaveFailedModal.tsx
Normal file
33
fluxer_app/src/components/alerts/GroupLeaveFailedModal.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {GenericErrorModal} from './GenericErrorModal';
|
||||
|
||||
export const GroupLeaveFailedModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<GenericErrorModal
|
||||
title={t`Failed to leave group`}
|
||||
message={t`We couldn't remove you from the group at this time.`}
|
||||
/>
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {Trans, useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import type {ReactElement} from 'react';
|
||||
import {GenericErrorModal} from './GenericErrorModal';
|
||||
|
||||
export const GroupOwnershipTransferFailedModal: React.FC<{username?: string}> = observer(({username}) => {
|
||||
const {t} = useLingui();
|
||||
const message: ReactElement = (
|
||||
<Trans>
|
||||
Ownership could not be transferred to <strong>{username}</strong> at this time.
|
||||
</Trans>
|
||||
);
|
||||
return <GenericErrorModal title={t`Failed to transfer ownership`} message={message} />;
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {Trans, useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import type {ReactElement} from 'react';
|
||||
import {GenericErrorModal} from './GenericErrorModal';
|
||||
|
||||
export const GroupRemoveUserFailedModal: React.FC<{username?: string}> = observer(({username}) => {
|
||||
const {t} = useLingui();
|
||||
const message: ReactElement = (
|
||||
<Trans>
|
||||
We couldn't remove the user from the group at this time. <strong>{username}</strong> is still in the group.
|
||||
</Trans>
|
||||
);
|
||||
return <GenericErrorModal title={t`Failed to remove from group`} message={message} />;
|
||||
});
|
||||
35
fluxer_app/src/components/alerts/GuildAtCapacityModal.tsx
Normal file
35
fluxer_app/src/components/alerts/GuildAtCapacityModal.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
|
||||
export const GuildAtCapacityModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Community at Capacity`}
|
||||
description={t`This community has reached its maximum member limit and is not accepting new members at this time.`}
|
||||
primaryText={t`Understood`}
|
||||
onPrimary={() => {}}
|
||||
/>
|
||||
);
|
||||
});
|
||||
29
fluxer_app/src/components/alerts/InviteAcceptFailedModal.tsx
Normal file
29
fluxer_app/src/components/alerts/InviteAcceptFailedModal.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {GenericErrorModal} from './GenericErrorModal';
|
||||
|
||||
export const InviteAcceptFailedModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
return (
|
||||
<GenericErrorModal title={t`Failed to accept invite`} message={t`We couldn't join this community at this time.`} />
|
||||
);
|
||||
});
|
||||
32
fluxer_app/src/components/alerts/InviteRevokeFailedModal.tsx
Normal file
32
fluxer_app/src/components/alerts/InviteRevokeFailedModal.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {GenericErrorModal} from './GenericErrorModal';
|
||||
|
||||
export const InviteRevokeFailedModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
return (
|
||||
<GenericErrorModal
|
||||
title={t`Failed to revoke invite`}
|
||||
message={t`We couldn't revoke the invite at this time. The invite link may still be active. Please try again in a moment.`}
|
||||
/>
|
||||
);
|
||||
});
|
||||
35
fluxer_app/src/components/alerts/InvitesDisabledModal.tsx
Normal file
35
fluxer_app/src/components/alerts/InvitesDisabledModal.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
|
||||
export const InvitesDisabledModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Invites Paused`}
|
||||
description={t`The admins of the community have paused invites, so you can't join at this time.`}
|
||||
primaryText={t`Understood`}
|
||||
onPrimary={() => {}}
|
||||
/>
|
||||
);
|
||||
});
|
||||
30
fluxer_app/src/components/alerts/InvitesLoadFailedModal.tsx
Normal file
30
fluxer_app/src/components/alerts/InvitesLoadFailedModal.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {GenericErrorModal} from './GenericErrorModal';
|
||||
|
||||
export const InvitesLoadFailedModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<GenericErrorModal title={t`Failed to load invites`} message={t`We couldn't load the invites at this time.`} />
|
||||
);
|
||||
});
|
||||
66
fluxer_app/src/components/alerts/MaxBookmarksModal.tsx
Normal file
66
fluxer_app/src/components/alerts/MaxBookmarksModal.tsx
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {Plural, Trans, useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {modal, push} from '~/actions/ModalActionCreators';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
import {PremiumModal} from '~/components/modals/PremiumModal';
|
||||
import UserStore from '~/stores/UserStore';
|
||||
|
||||
export const MaxBookmarksModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
const currentUser = UserStore.currentUser!;
|
||||
const isPremium = currentUser.isPremium();
|
||||
const maxBookmarks = currentUser.maxBookmarks;
|
||||
|
||||
if (isPremium) {
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Bookmark Limit Reached`}
|
||||
description={
|
||||
<Trans>
|
||||
You've reached the maximum number of bookmarks (
|
||||
<Plural value={maxBookmarks} one="# bookmark" other="# bookmarks" />
|
||||
). Please remove some bookmarks before adding new ones.
|
||||
</Trans>
|
||||
}
|
||||
primaryText={t`Understood`}
|
||||
onPrimary={() => {}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Bookmark Limit Reached`}
|
||||
description={
|
||||
<Trans>
|
||||
You've reached the maximum number of bookmarks for free users (
|
||||
<Plural value={maxBookmarks} one="# bookmark" other="# bookmarks" />
|
||||
). Upgrade to Plutonium to increase your limit to 300 bookmarks, or remove some bookmarks to add new ones.
|
||||
</Trans>
|
||||
}
|
||||
primaryText={t`Upgrade to Plutonium`}
|
||||
primaryVariant="primary"
|
||||
onPrimary={() => push(modal(() => <PremiumModal />))}
|
||||
secondaryText={t`Dismiss`}
|
||||
/>
|
||||
);
|
||||
});
|
||||
52
fluxer_app/src/components/alerts/MaxFavoriteMemesModal.tsx
Normal file
52
fluxer_app/src/components/alerts/MaxFavoriteMemesModal.tsx
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {modal, push} from '~/actions/ModalActionCreators';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
import {PremiumModal} from '~/components/modals/PremiumModal';
|
||||
import UserStore from '~/stores/UserStore';
|
||||
|
||||
export const MaxFavoriteMemesModal = observer(function MaxFavoriteMemesModal() {
|
||||
const {t} = useLingui();
|
||||
const currentUser = UserStore.currentUser;
|
||||
const isPremium = currentUser?.isPremium() ?? false;
|
||||
|
||||
if (isPremium) {
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Saved Media Limit Reached`}
|
||||
description={t`You've reached the maximum limit of 500 saved media items for Plutonium users. To add more, you'll need to remove some existing items from your collection.`}
|
||||
secondaryText={t`Close`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Saved Media Limit Reached`}
|
||||
description={t`You've reached the maximum limit of 50 saved media items for free users. Upgrade to Plutonium to increase your limit to 500 saved media items!`}
|
||||
primaryText={t`Upgrade to Plutonium`}
|
||||
primaryVariant="primary"
|
||||
onPrimary={() => push(modal(() => <PremiumModal />))}
|
||||
secondaryText={t`Maybe Later`}
|
||||
/>
|
||||
);
|
||||
});
|
||||
44
fluxer_app/src/components/alerts/MaxGuildsModal.tsx
Normal file
44
fluxer_app/src/components/alerts/MaxGuildsModal.tsx
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {Plural, Trans, useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
import UserStore from '~/stores/UserStore';
|
||||
|
||||
export const MaxGuildsModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
const currentUser = UserStore.currentUser!;
|
||||
const maxGuilds = currentUser.maxGuilds;
|
||||
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Too Many Communities`}
|
||||
description={
|
||||
<Trans>
|
||||
You've reached the maximum number of communities you can join (
|
||||
<Plural value={maxGuilds} one="# community" other="# communities" />
|
||||
). Please leave a community before joining another one.
|
||||
</Trans>
|
||||
}
|
||||
primaryText={t`Understood`}
|
||||
onPrimary={() => {}}
|
||||
/>
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {GenericErrorModal} from './GenericErrorModal';
|
||||
|
||||
export const MessageDeleteFailedModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
return (
|
||||
<GenericErrorModal
|
||||
title={t`That message didn't delete`}
|
||||
message={t`We hit a snag. Try deleting that message again.`}
|
||||
/>
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
|
||||
export const MessageDeleteTooQuickModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`You're deleting messages too quickly`}
|
||||
description={t`The problem with being faster than light is that you can only live in darkness. Take a breather and try again.`}
|
||||
primaryText={t`Gotcha`}
|
||||
onPrimary={() => {}}
|
||||
/>
|
||||
);
|
||||
});
|
||||
33
fluxer_app/src/components/alerts/MessageEditFailedModal.tsx
Normal file
33
fluxer_app/src/components/alerts/MessageEditFailedModal.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {GenericErrorModal} from './GenericErrorModal';
|
||||
|
||||
export const MessageEditFailedModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<GenericErrorModal
|
||||
title={t`Your message didn't update`}
|
||||
message={t`We hit a snag. Try editing your message again.`}
|
||||
/>
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {RateLimitedConfirmModal} from '~/components/alerts/RateLimitedConfirmModal';
|
||||
|
||||
interface MessageEditTooQuickModalProps {
|
||||
retryAfter?: number;
|
||||
onRetry?: () => void;
|
||||
}
|
||||
|
||||
export const MessageEditTooQuickModal = observer(({retryAfter, onRetry}: MessageEditTooQuickModalProps) => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<RateLimitedConfirmModal title={t`You're editing messages too quickly`} retryAfter={retryAfter} onRetry={onRetry} />
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {GenericErrorModal} from './GenericErrorModal';
|
||||
|
||||
export const MessageForwardFailedModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<GenericErrorModal
|
||||
title={t`Failed to forward message`}
|
||||
message={t`We couldn't forward the message at this time.`}
|
||||
/>
|
||||
);
|
||||
});
|
||||
32
fluxer_app/src/components/alerts/MessageSendFailedModal.tsx
Normal file
32
fluxer_app/src/components/alerts/MessageSendFailedModal.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {GenericErrorModal} from './GenericErrorModal';
|
||||
|
||||
export const MessageSendFailedModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
return (
|
||||
<GenericErrorModal
|
||||
title={t`Your message didn't go through`}
|
||||
message={t`We hit a snag. Try sending your message again.`}
|
||||
/>
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {RateLimitedConfirmModal} from '~/components/alerts/RateLimitedConfirmModal';
|
||||
|
||||
interface MessageSendTooQuickModalProps {
|
||||
retryAfter?: number;
|
||||
onRetry?: () => void;
|
||||
}
|
||||
|
||||
export const MessageSendTooQuickModal = observer(({retryAfter, onRetry}: MessageSendTooQuickModalProps) => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<RateLimitedConfirmModal title={t`You're sending messages too quickly`} retryAfter={retryAfter} onRetry={onRetry} />
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
import {openNativePermissionSettings} from '~/utils/NativePermissions';
|
||||
import {isDesktop, isNativeMacOS} from '~/utils/NativeUtils';
|
||||
|
||||
export const MicrophonePermissionDeniedModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
|
||||
if (isDesktop() && isNativeMacOS()) {
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Microphone Permission Required`}
|
||||
description={t`Fluxer needs access to your microphone. Open System Settings → Privacy & Security → Microphone, allow Fluxer, and then restart the app.`}
|
||||
primaryText={t`Open Settings`}
|
||||
primaryVariant="primary"
|
||||
onPrimary={() => openNativePermissionSettings('microphone')}
|
||||
secondaryText={t`Close`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const message = isDesktop()
|
||||
? t`Fluxer needs access to your microphone. Allow microphone access in your operating system privacy settings and restart the app.`
|
||||
: t`Fluxer needs access to your microphone to enable voice chat. Please grant microphone permission in your browser settings and try again.`;
|
||||
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Microphone Permission Required`}
|
||||
description={message}
|
||||
primaryText={t`Understood`}
|
||||
onPrimary={() => {}}
|
||||
/>
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
|
||||
export const NSFWContentRejectedModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`NSFW content not allowed`}
|
||||
description={t`This channel is not marked as NSFW. Explicit content can only be sent in NSFW channels. Ask a moderator to mark this channel as NSFW if appropriate.`}
|
||||
primaryText={t`Understood`}
|
||||
onPrimary={() => {}}
|
||||
/>
|
||||
);
|
||||
});
|
||||
45
fluxer_app/src/components/alerts/PinFailedModal.tsx
Normal file
45
fluxer_app/src/components/alerts/PinFailedModal.tsx
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {GenericErrorModal} from './GenericErrorModal';
|
||||
|
||||
export type PinFailureReason = 'dm_restricted' | 'generic';
|
||||
|
||||
interface PinFailedModalProps {
|
||||
isUnpin?: boolean;
|
||||
reason?: PinFailureReason;
|
||||
}
|
||||
|
||||
export const PinFailedModal: React.FC<PinFailedModalProps> = observer(({isUnpin, reason = 'generic'}) => {
|
||||
const {t} = useLingui();
|
||||
const title = isUnpin ? t`Failed to unpin message` : t`Failed to pin message`;
|
||||
|
||||
let message: string;
|
||||
switch (reason) {
|
||||
case 'dm_restricted':
|
||||
message = t`You cannot interact with this user right now.`;
|
||||
break;
|
||||
default:
|
||||
message = t`Something went wrong. Please try again later.`;
|
||||
}
|
||||
|
||||
return <GenericErrorModal title={title} message={message} />;
|
||||
});
|
||||
77
fluxer_app/src/components/alerts/RateLimitedConfirmModal.tsx
Normal file
77
fluxer_app/src/components/alerts/RateLimitedConfirmModal.tsx
Normal file
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import React from 'react';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
|
||||
interface RateLimitedConfirmModalProps {
|
||||
title: string;
|
||||
retryAfter?: number;
|
||||
onRetry?: () => void;
|
||||
}
|
||||
|
||||
export const RateLimitedConfirmModal = observer(({title, retryAfter, onRetry}: RateLimitedConfirmModalProps) => {
|
||||
const {t} = useLingui();
|
||||
const hasRetryAfter = retryAfter != null;
|
||||
|
||||
const formatRateLimitTime = React.useCallback(
|
||||
(totalSeconds: number): string => {
|
||||
if (totalSeconds < 60) {
|
||||
return totalSeconds === 1 ? t`${totalSeconds} second` : t`${totalSeconds} seconds`;
|
||||
}
|
||||
|
||||
const minutes = Math.floor(totalSeconds / 60);
|
||||
const seconds = totalSeconds % 60;
|
||||
|
||||
if (seconds === 0) {
|
||||
return minutes === 1 ? t`${minutes} minute` : t`${minutes} minutes`;
|
||||
}
|
||||
|
||||
if (minutes === 1 && seconds === 1) {
|
||||
return t`1 minute and 1 second`;
|
||||
}
|
||||
|
||||
if (minutes === 1) {
|
||||
return t`1 minute and ${seconds} seconds`;
|
||||
}
|
||||
|
||||
if (seconds === 1) {
|
||||
return t`${minutes} minutes and 1 second`;
|
||||
}
|
||||
|
||||
return t`${minutes} minutes and ${seconds} seconds`;
|
||||
},
|
||||
[t],
|
||||
);
|
||||
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={title}
|
||||
description={
|
||||
hasRetryAfter
|
||||
? t`You're being rate limited. Please wait ${formatRateLimitTime(retryAfter)} before trying again.`
|
||||
: t`The problem with being faster than light is that you can only live in darkness. Take a breather and try again.`
|
||||
}
|
||||
secondaryText={hasRetryAfter ? t`Retry` : t`Gotcha`}
|
||||
onSecondary={onRetry}
|
||||
/>
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
|
||||
export const ReactionInteractionDisabledModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Reaction Interaction Disabled`}
|
||||
description={t`You can't interact with reactions in search results as it might disrupt the space-time continuum.`}
|
||||
primaryText={t`Understood`}
|
||||
onPrimary={() => {}}
|
||||
/>
|
||||
);
|
||||
});
|
||||
29
fluxer_app/src/components/alerts/RoleCreateFailedModal.tsx
Normal file
29
fluxer_app/src/components/alerts/RoleCreateFailedModal.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {GenericErrorModal} from './GenericErrorModal';
|
||||
|
||||
export const RoleCreateFailedModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
return (
|
||||
<GenericErrorModal title={t`Failed to create role`} message={t`We couldn't create a new role at this time.`} />
|
||||
);
|
||||
});
|
||||
37
fluxer_app/src/components/alerts/RoleDeleteFailedModal.tsx
Normal file
37
fluxer_app/src/components/alerts/RoleDeleteFailedModal.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {Trans, useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {GenericErrorModal} from './GenericErrorModal';
|
||||
|
||||
export const RoleDeleteFailedModal: React.FC<{roleName?: string}> = observer(({roleName}) => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<GenericErrorModal
|
||||
title={t`Failed to delete role`}
|
||||
message={
|
||||
<Trans>
|
||||
The role <strong>"{roleName}"</strong> could not be deleted at this time. Please try again.
|
||||
</Trans>
|
||||
}
|
||||
/>
|
||||
);
|
||||
});
|
||||
34
fluxer_app/src/components/alerts/RoleNameBlankModal.tsx
Normal file
34
fluxer_app/src/components/alerts/RoleNameBlankModal.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
|
||||
export const RoleNameBlankModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Role name cannot be blank`}
|
||||
description={t`You cannot save a role with a blank name. Please provide a valid name before saving.`}
|
||||
primaryText={t`Understood`}
|
||||
onPrimary={() => {}}
|
||||
/>
|
||||
);
|
||||
});
|
||||
33
fluxer_app/src/components/alerts/RoleUpdateFailedModal.tsx
Normal file
33
fluxer_app/src/components/alerts/RoleUpdateFailedModal.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {GenericErrorModal} from './GenericErrorModal';
|
||||
|
||||
export const RoleUpdateFailedModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<GenericErrorModal
|
||||
title={t`Failed to update roles`}
|
||||
message={t`We couldn't save your role changes at this time.`}
|
||||
/>
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
import {openNativePermissionSettings} from '~/utils/NativePermissions';
|
||||
|
||||
export const ScreenRecordingPermissionDeniedModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Screen Recording Permission Required`}
|
||||
description={t`Fluxer needs access to screen recording. Open System Settings → Privacy & Security → Screen Recording, allow Fluxer, and then try again.`}
|
||||
primaryText={t`Open Settings`}
|
||||
primaryVariant="primary"
|
||||
onPrimary={() => openNativePermissionSettings('screen')}
|
||||
secondaryText={t`Close`}
|
||||
/>
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
|
||||
export const ScreenShareUnsupportedModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Screen Sharing Not Supported`}
|
||||
description={t`Screen sharing is not supported on this device or browser. This feature requires a desktop browser that supports screen sharing, such as Chrome, Firefox, or Edge on Windows, macOS, or Linux.`}
|
||||
primaryText={t`Understood`}
|
||||
onPrimary={() => {}}
|
||||
/>
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {msg} from '@lingui/core/macro';
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
|
||||
interface SlowmodeRateLimitedModalProps {
|
||||
retryAfter: number;
|
||||
}
|
||||
|
||||
export const SlowmodeRateLimitedModal = observer(({retryAfter}: SlowmodeRateLimitedModalProps) => {
|
||||
const {t} = useLingui();
|
||||
|
||||
const formatTime = (seconds: number): string => {
|
||||
if (seconds < 60) {
|
||||
return seconds === 1 ? t`${seconds} second` : t`${seconds} seconds`;
|
||||
}
|
||||
|
||||
const minutes = Math.floor(seconds / 60);
|
||||
const remainingSeconds = seconds % 60;
|
||||
|
||||
if (remainingSeconds === 0) {
|
||||
return minutes === 1 ? t`${minutes} minute` : t`${minutes} minutes`;
|
||||
}
|
||||
|
||||
if (minutes === 1 && remainingSeconds === 1) {
|
||||
return t`1 minute and 1 second`;
|
||||
}
|
||||
|
||||
if (minutes === 1) {
|
||||
return t`1 minute and ${remainingSeconds} seconds`;
|
||||
}
|
||||
|
||||
if (remainingSeconds === 1) {
|
||||
return t`${minutes} minutes and 1 second`;
|
||||
}
|
||||
|
||||
return t`${minutes} minutes and ${remainingSeconds} seconds`;
|
||||
};
|
||||
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Slowmode Active`}
|
||||
description={t(
|
||||
msg`This channel has slowmode enabled. You need to wait ${formatTime(retryAfter)} before sending another message.`,
|
||||
)}
|
||||
primaryText={t`Okay`}
|
||||
onPrimary={() => {}}
|
||||
/>
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
|
||||
export const TemporaryInviteRequiresPresenceModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Gateway Connection Required`}
|
||||
description={t`You must be connected to the gateway to accept this temporary invite. Please check your connection and try again.`}
|
||||
primaryText={t`Understood`}
|
||||
onPrimary={() => {}}
|
||||
/>
|
||||
);
|
||||
});
|
||||
35
fluxer_app/src/components/alerts/TooManyAttachmentsModal.tsx
Normal file
35
fluxer_app/src/components/alerts/TooManyAttachmentsModal.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {MAX_ATTACHMENTS_PER_MESSAGE} from '~/Constants';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
|
||||
export const TooManyAttachmentsModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Whoa, this is heavy`}
|
||||
description={t`You can only upload ${MAX_ATTACHMENTS_PER_MESSAGE} files at a time. Try again with fewer files.`}
|
||||
primaryText={t`Understood`}
|
||||
onPrimary={() => {}}
|
||||
/>
|
||||
);
|
||||
});
|
||||
35
fluxer_app/src/components/alerts/TooManyReactionsModal.tsx
Normal file
35
fluxer_app/src/components/alerts/TooManyReactionsModal.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
|
||||
export const TooManyReactionsModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Whoa, this is heavy`}
|
||||
description={t`This is one heavy message. Some reactions need to be removed before you can add more.`}
|
||||
primaryText={t`Understood`}
|
||||
onPrimary={() => {}}
|
||||
/>
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
|
||||
export const UserBannedFromGuildModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`You're Banned`}
|
||||
description={t`You are banned from this community and cannot join.`}
|
||||
primaryText={t`Understood`}
|
||||
onPrimary={() => {}}
|
||||
/>
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {ConfirmModal} from '~/components/modals/ConfirmModal';
|
||||
|
||||
export const UserIpBannedFromGuildModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<ConfirmModal
|
||||
title={t`Your IP is Banned`}
|
||||
description={t`Your IP address is banned from this community and you cannot join.`}
|
||||
primaryText={t`Understood`}
|
||||
onPrimary={() => {}}
|
||||
/>
|
||||
);
|
||||
});
|
||||
33
fluxer_app/src/components/alerts/VoiceChannelFullModal.tsx
Normal file
33
fluxer_app/src/components/alerts/VoiceChannelFullModal.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import {GenericErrorModal} from './GenericErrorModal';
|
||||
|
||||
export const VoiceChannelFullModal = observer(() => {
|
||||
const {t} = useLingui();
|
||||
|
||||
return (
|
||||
<GenericErrorModal
|
||||
title={t`Voice Channel Full`}
|
||||
message={t`This voice channel has reached its user limit. Please try again later or join a different channel.`}
|
||||
/>
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
.footer {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.fullWidth {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (C) 2026 Fluxer Contributors
|
||||
*
|
||||
* This file is part of Fluxer.
|
||||
*
|
||||
* Fluxer is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Fluxer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {Plural, Trans, useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import type React from 'react';
|
||||
import * as Modal from '~/components/modals/Modal';
|
||||
import {Button} from '~/components/uikit/Button/Button';
|
||||
import {
|
||||
useVoiceConnectionConfirmModalLogic,
|
||||
type VoiceConnectionConfirmModalProps,
|
||||
} from '~/utils/alerts/VoiceConnectionConfirmModalUtils';
|
||||
import styles from './VoiceConnectionConfirmModal.module.css';
|
||||
|
||||
export const VoiceConnectionConfirmModal: React.FC<VoiceConnectionConfirmModalProps> = observer(
|
||||
({guildId: _guildId, channelId: _channelId, onSwitchDevice, onJustJoin, onCancel}) => {
|
||||
const {t} = useLingui();
|
||||
const {existingConnectionsCount, handleSwitchDevice, handleJustJoin, handleCancel} =
|
||||
useVoiceConnectionConfirmModalLogic({
|
||||
onSwitchDevice,
|
||||
onJustJoin,
|
||||
onCancel,
|
||||
});
|
||||
|
||||
return (
|
||||
<Modal.Root size="small" centered>
|
||||
<Modal.Header title={t`Voice Connection Confirmation`} />
|
||||
<Modal.Content>
|
||||
<Trans>
|
||||
You're already connected to this voice channel from{' '}
|
||||
<Plural value={existingConnectionsCount} one="# other device" other="# other devices" />. What would you
|
||||
like to do?
|
||||
</Trans>
|
||||
</Modal.Content>
|
||||
<Modal.Footer>
|
||||
<div className={styles.footer}>
|
||||
<Button variant="primary" onClick={handleSwitchDevice} className={styles.fullWidth}>
|
||||
<Trans>Switch to This Device</Trans>
|
||||
</Button>
|
||||
|
||||
<Button variant="secondary" onClick={handleJustJoin} className={styles.fullWidth}>
|
||||
<Trans>Just Join (Keep Other Connections)</Trans>
|
||||
</Button>
|
||||
|
||||
<Button variant="secondary" onClick={handleCancel} className={styles.fullWidth}>
|
||||
<Trans>Do nothing, I don't want to join</Trans>
|
||||
</Button>
|
||||
</div>
|
||||
</Modal.Footer>
|
||||
</Modal.Root>
|
||||
);
|
||||
},
|
||||
);
|
||||
Reference in New Issue
Block a user