Hide disabled features (#2473)
* Hide/show on notify and fediverse feature disable/enable * Update browser tests to enable features for testing * Hide/show features in mobile action menu * Do not show fediauth option if fediverse features are not enabled. * Force showing tabs when in Storybook
This commit is contained in:
@@ -21,7 +21,7 @@ const Example = () => {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<AuthModal />
|
||||
<AuthModal forceTabs />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -12,18 +12,26 @@ import {
|
||||
currentUserAtom,
|
||||
chatAuthenticatedAtom,
|
||||
accessTokenAtom,
|
||||
clientConfigStateAtom,
|
||||
} from '../../stores/ClientConfigStore';
|
||||
import { ClientConfig } from '../../../interfaces/client-config.model';
|
||||
|
||||
export const AuthModal: FC = () => {
|
||||
export type AuthModalProps = {
|
||||
forceTabs?: boolean;
|
||||
};
|
||||
|
||||
export const AuthModal: FC<AuthModalProps> = ({ forceTabs }) => {
|
||||
const authenticated = useRecoilValue<boolean>(chatAuthenticatedAtom);
|
||||
const accessToken = useRecoilValue<string>(accessTokenAtom);
|
||||
const currentUser = useRecoilValue(currentUserAtom);
|
||||
const clientConfig = useRecoilValue<ClientConfig>(clientConfigStateAtom);
|
||||
|
||||
if (!currentUser) {
|
||||
return null;
|
||||
}
|
||||
const { displayName } = currentUser;
|
||||
|
||||
const federationEnabled = true;
|
||||
const { federation } = clientConfig;
|
||||
const { enabled: fediverseEnabled } = federation;
|
||||
|
||||
const indieAuthTabTitle = (
|
||||
<span className={styles.tabContent}>
|
||||
@@ -67,7 +75,7 @@ export const AuthModal: FC = () => {
|
||||
items={items}
|
||||
type="card"
|
||||
size="small"
|
||||
renderTabBar={federationEnabled ? null : () => null}
|
||||
renderTabBar={fediverseEnabled || forceTabs ? null : () => null}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user