diff --git a/app/soapbox/features/federation-restrictions/components/instance-restrictions.tsx b/app/soapbox/features/federation-restrictions/components/instance-restrictions.tsx index ac86039fd..a912f3f4d 100644 --- a/app/soapbox/features/federation-restrictions/components/instance-restrictions.tsx +++ b/app/soapbox/features/federation-restrictions/components/instance-restrictions.tsx @@ -4,7 +4,7 @@ import React from 'react'; import { FormattedMessage } from 'react-intl'; import Icon from 'soapbox/components/icon'; -import { Text } from 'soapbox/components/ui'; +import { HStack, Stack, Text } from 'soapbox/components/ui'; import { useAppSelector } from 'soapbox/hooks'; import type { Map as ImmutableMap } from 'immutable'; @@ -16,6 +16,23 @@ const hasRestrictions = (remoteInstance: ImmutableMap): boolean => .reduce((acc: boolean, value: boolean) => acc || value, false); }; +interface IRestriction { + icon: string, + children: React.ReactNode, +} + +const Restriction: React.FC = ({ icon, children }) => { + return ( + + + + + {children} + + + ); +}; + interface IInstanceRestrictions { remoteInstance: ImmutableMap, } @@ -40,57 +57,52 @@ const InstanceRestrictions: React.FC = ({ remoteInstance if (followers_only) { items.push(( - - + - + )); } else if (federated_timeline_removal) { items.push(( - - + - + )); } if (fullMediaRemoval) { items.push(( - - + - + )); } else if (partialMediaRemoval) { items.push(( - - + - + )); } if (!fullMediaRemoval && media_nsfw) { items.push(( - - + - + )); } @@ -105,46 +117,45 @@ const InstanceRestrictions: React.FC = ({ remoteInstance if (remoteInstance.getIn(['federation', 'reject']) === true) { return ( - - + - + ); } else if (hasRestrictions(remoteInstance)) { - return [ - ( - + return ( + <> + - - ), - renderRestrictions(), - ]; + + + {renderRestrictions()} + + ); } else { return ( - - + - + ); } }; return ( -
+ {renderContent()} -
+ ); }; diff --git a/app/soapbox/features/remote-timeline/index.tsx b/app/soapbox/features/remote-timeline/index.tsx index 7ab185be9..a6963df48 100644 --- a/app/soapbox/features/remote-timeline/index.tsx +++ b/app/soapbox/features/remote-timeline/index.tsx @@ -5,8 +5,8 @@ import { useHistory } from 'react-router-dom'; import { connectRemoteStream } from 'soapbox/actions/streaming'; import { expandRemoteTimeline } from 'soapbox/actions/timelines'; import IconButton from 'soapbox/components/icon-button'; -import { HStack, Text } from 'soapbox/components/ui'; -import Column from 'soapbox/features/ui/components/column'; +import SubNavigation from 'soapbox/components/sub-navigation'; +import { Column, HStack, Text } from 'soapbox/components/ui'; import { useAppDispatch, useSettings } from 'soapbox/hooks'; import Timeline from '../ui/components/timeline'; @@ -14,7 +14,7 @@ import Timeline from '../ui/components/timeline'; import PinnedHostsPicker from './components/pinned-hosts-picker'; const messages = defineMessages({ - title: { id: 'column.remote', defaultMessage: 'Federated timeline' }, + heading: { id: 'column.remote', defaultMessage: 'Federated timeline' }, }); interface IRemoteTimeline { @@ -65,18 +65,26 @@ const RemoteTimeline: React.FC = ({ params }) => { }, [onlyMedia]); return ( - - {instance && } - {!pinned && - - - - - } + +
+ + + {instance && } + + {!pinned && ( + + + + + + + )} +
+