Skip to content

Commit 994ab7b

Browse files
authored
Greenlight version number only appears for admins (bigbluebutton#5893)
* Greenlight version number only appears for admins - Changes to App.jsx: passed in currentUser to the Footer - Footer renders the version number if the current user is an admin * - currentUser is no longer passed as a prop to the Footer component. Footer component imports useAuth to get the current user
1 parent 71b8e9b commit 994ab7b

File tree

1 file changed

+4
-1
lines changed
  • app/javascript/components/shared_components

1 file changed

+4
-1
lines changed

app/javascript/components/shared_components/Footer.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,20 @@ import { useTranslation } from 'react-i18next';
1919
import { Container } from 'react-bootstrap';
2020
import useEnv from '../../hooks/queries/env/useEnv';
2121
import useSiteSetting from '../../hooks/queries/site_settings/useSiteSetting';
22+
import { useAuth } from '../../contexts/auth/AuthProvider';
2223

2324
export default function Footer() {
2425
const { t } = useTranslation();
2526
const { data: env } = useEnv();
2627
const { data: links } = useSiteSetting(['Terms', 'PrivacyPolicy']);
28+
const currentUser = useAuth();
29+
const isAdmin = currentUser && currentUser.role && currentUser?.role.name === 'Administrator';
2730

2831
return (
2932
<footer id="footer" className="footer background-whitesmoke text-center">
3033
<Container id="footer-container" className="py-3">
3134
<a href="https://docs.bigbluebutton.org/greenlight/v3/install" target="_blank" rel="noreferrer">Greenlight</a>
32-
<span className="text-muted"> {env?.VERSION_TAG} </span>
35+
{ isAdmin && <span className="text-muted"> {env?.VERSION_TAG} </span> }
3336
{ links?.Terms
3437
&& (
3538
<a className="ps-3" href={links?.Terms} target="_blank" rel="noreferrer">

0 commit comments

Comments
 (0)