Hide language dropdown behind a feature flag

This commit is contained in:
Alex Gleason 2024-10-01 18:59:46 -05:00
parent 58c9fee2c4
commit b4c0649df8
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
3 changed files with 11 additions and 5 deletions

View File

@ -59,15 +59,13 @@ export interface IColumn {
children?: React.ReactNode;
/** Action for the ColumnHeader, displayed at the end. */
action?: React.ReactNode;
/** Determines if the action for the ColumnHeader is displayed on the right. */
actionRightPosition?: boolean;
/** Column size, inherited from Card. */
size?: CardSizes;
}
/** A backdrop for the main section of the UI. */
const Column = React.forwardRef<HTMLDivElement, IColumn>((props, ref): JSX.Element => {
const { backHref, children, label, transparent = false, withHeader = true, className, bodyClassName, action, actionRightPosition, size } = props;
const { backHref, children, label, transparent = false, withHeader = true, className, bodyClassName, action, size } = props;
const soapboxConfig = useSoapboxConfig();
const [isScrolled, setIsScrolled] = useState(false);
@ -108,7 +106,6 @@ const Column = React.forwardRef<HTMLDivElement, IColumn>((props, ref): JSX.Eleme
'p-4 sm:p-0 sm:pb-4 black:p-4': transparent,
'-mt-4 p-4': size !== 'lg' && !transparent,
'-mt-4 p-4 sm:-mt-6 sm:-mx-6 sm:p-6': size === 'lg' && !transparent,
'w-full': actionRightPosition,
})}
action={action}
/>

View File

@ -64,7 +64,13 @@ const PublicTimeline = () => {
}, []);
return (
<Column className='-mt-3 sm:mt-0' label={intl.formatMessage(messages.title)} transparent={!isMobile} action={<LanguageDropdown />} actionRightPosition>
<Column
className='-mt-3 sm:mt-0'
label={intl.formatMessage(messages.title)}
transparent={!isMobile}
action={features.publicTimelineLanguage ? <LanguageDropdown /> : null}
// actionRightPosition
>
<PinnedHostsPicker />
{showExplanationBox && (

View File

@ -900,6 +900,9 @@ const getInstanceFeatures = (instance: Instance) => {
v.software === DITTO,
]),
/** Ability to filter the public timeline by language. */
publicTimelineLanguage: v.software === DITTO,
/**
* Ability to quote posts in statuses.
* @see POST /api/v1/statuses