2022-05-09 19:35:22 -07:00
|
|
|
import React from 'react';
|
|
|
|
|
2022-11-16 05:32:32 -08:00
|
|
|
import LinkFooter from 'soapbox/features/ui/components/link-footer';
|
2022-05-09 19:35:22 -07:00
|
|
|
import {
|
|
|
|
PromoPanel,
|
|
|
|
InstanceInfoPanel,
|
|
|
|
InstanceModerationPanel,
|
|
|
|
} from 'soapbox/features/ui/util/async-components';
|
|
|
|
import { useAppSelector, useOwnAccount } from 'soapbox/hooks';
|
|
|
|
import { federationRestrictionsDisclosed } from 'soapbox/utils/state';
|
|
|
|
|
|
|
|
import { Layout } from '../components/ui';
|
|
|
|
|
|
|
|
interface IRemoteInstancePage {
|
2023-10-07 14:00:42 -07:00
|
|
|
params?: {
|
|
|
|
instance?: string;
|
2023-10-02 11:54:02 -07:00
|
|
|
};
|
|
|
|
children: React.ReactNode;
|
2022-05-09 19:35:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/** Page for viewing a remote instance timeline. */
|
2022-05-09 19:49:53 -07:00
|
|
|
const RemoteInstancePage: React.FC<IRemoteInstancePage> = ({ children, params }) => {
|
2023-10-07 14:00:42 -07:00
|
|
|
const host = params!.instance!;
|
2022-05-09 19:49:53 -07:00
|
|
|
|
2023-06-25 10:35:09 -07:00
|
|
|
const { account } = useOwnAccount();
|
2022-05-09 19:35:22 -07:00
|
|
|
const disclosed = useAppSelector(federationRestrictionsDisclosed);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Layout.Main>
|
|
|
|
{children}
|
|
|
|
</Layout.Main>
|
|
|
|
|
|
|
|
<Layout.Aside>
|
2023-10-07 15:14:45 -07:00
|
|
|
<PromoPanel />
|
|
|
|
<InstanceInfoPanel host={host} />
|
2024-08-11 01:48:58 -07:00
|
|
|
{(disclosed || account?.is_admin) && (
|
2023-10-07 15:14:45 -07:00
|
|
|
<InstanceModerationPanel host={host} />
|
2022-05-09 19:35:22 -07:00
|
|
|
)}
|
2023-10-07 15:14:45 -07:00
|
|
|
<LinkFooter />
|
2022-05-09 19:35:22 -07:00
|
|
|
</Layout.Aside>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2024-05-13 10:00:42 -07:00
|
|
|
export { RemoteInstancePage as default };
|