Skip to content

Commit

Permalink
Merge pull request #12512 from bigbluebutton/revert-12497-navbar-with…
Browse files Browse the repository at this point in the history
…-large-fonts

Revert "fix: different navbar size for locales with large fonts"
  • Loading branch information
antobinary committed Jun 3, 2021
2 parents 0ba5d37 + fd9b68b commit ebcc9f8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 26 deletions.
10 changes: 3 additions & 7 deletions bigbluebutton-html5/imports/startup/client/intl.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import Settings from '/imports/ui/services/settings';
import LoadingScreen from '/imports/ui/components/loading-screen/component';
import getFromUserSettings from '/imports/ui/services/users-settings';
import _ from 'lodash';
import { Session } from 'meteor/session';

const propTypes = {
locale: PropTypes.string,
Expand All @@ -16,7 +15,6 @@ const propTypes = {
const DEFAULT_LANGUAGE = Meteor.settings.public.app.defaultSettings.application.fallbackLocale;

const RTL_LANGUAGES = ['ar', 'he', 'fa'];
const LARGE_FONT_LANGUAGES = ['te', 'km'];

const defaultProps = {
locale: DEFAULT_LANGUAGE,
Expand All @@ -32,8 +30,6 @@ class IntlStartup extends Component {
document.body.parentNode.setAttribute('dir', 'ltr');
Settings.application.isRTL = false;
}
Session.set('isLargeFont', LARGE_FONT_LANGUAGES.includes(localeName.substring(0, 2)));
window.dispatchEvent(new Event('localeChanged'));
Settings.save();
}

Expand Down Expand Up @@ -153,9 +149,9 @@ class IntlStartup extends Component {

{normalizedLocale
&& (
<IntlProvider locale={normalizedLocale} messages={messages}>
{children}
</IntlProvider>
<IntlProvider locale={normalizedLocale} messages={messages}>
{children}
</IntlProvider>
)
}
</>
Expand Down
9 changes: 4 additions & 5 deletions bigbluebutton-html5/imports/ui/components/app/component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { withDraggableContext } from '../media/webcam-draggable-overlay/context'
import { styles } from './styles';
import { makeCall } from '/imports/ui/services/api';
import ConnectionStatusService from '/imports/ui/components/connection-status/service';
import { NAVBAR_HEIGHT, LARGE_NAVBAR_HEIGHT } from '/imports/ui/components/layout/layout-manager/component';
import { NAVBAR_HEIGHT } from '/imports/ui/components/layout/layout-manager/component';

const MOBILE_MEDIA = 'only screen and (max-width: 40em)';
const APP_CONFIG = Meteor.settings.public.app;
Expand Down Expand Up @@ -267,16 +267,15 @@ class App extends Component {
}

renderNavBar() {
const { navbar, isLargeFont } = this.props;
if (!navbar) return null;
const { navbar } = this.props;

const realNavbarHeight = isLargeFont ? LARGE_NAVBAR_HEIGHT : NAVBAR_HEIGHT;
if (!navbar) return null;

return (
<header
className={styles.navbar}
style={{
height: realNavbarHeight,
height: NAVBAR_HEIGHT,
}}
>
{navbar}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ export default injectIntl(withModalMounter(withTracker(({ intl, baseControls })
randomlySelectedUser,
currentUserId: currentUser.userId,
isPresenter: currentUser.presenter,
isLargeFont: Session.get('isLargeFont')
};
})(AppContainer)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ const NOTE_MIN_WIDTH = 340;
const NOTE_MAX_WIDTH = 800;
const WAITING_MIN_WIDTH = 340;
const WAITING_MAX_WIDTH = 800;
const LARGE_NAVBAR_HEIGHT = 170;
const NAVBAR_HEIGHT = 112;
const NAVBAR_HEIGHT = 170;
const ACTIONSBAR_HEIGHT = isMobile ? 50 : 42;
const BREAKOUT_MIN_WIDTH = 320;
const BREAKOUT_MAX_WIDTH = 400;
Expand Down Expand Up @@ -106,14 +105,10 @@ class LayoutManagerComponent extends Component {
window.addEventListener('webcamPlacementChange', () => {
this.setLayoutSizes(false, false, true);
});

window.addEventListener('fullscreenchange', () => {
setTimeout(() => this.setLayoutSizes(), 200);
});

window.addEventListener('localeChanged', () => {
this.setLayoutSizes();
});
}

componentDidUpdate(prevProps) {
Expand Down Expand Up @@ -768,15 +763,12 @@ class LayoutManagerComponent extends Component {
secondPanel = newBreakoutRoomSize;
}

const isLargeFont = Session.get('isLargeFont');
const realNavbarHeight = isLargeFont ? LARGE_NAVBAR_HEIGHT : NAVBAR_HEIGHT;

const mediaAreaHeight = windowHeight() - (realNavbarHeight + ACTIONSBAR_HEIGHT) - 10;
const mediaAreaHeight = windowHeight() - (NAVBAR_HEIGHT + ACTIONSBAR_HEIGHT) - 10;
const mediaAreaWidth = windowWidth() - (firstPanel.width + secondPanel.width);
const newMediaBounds = {
width: mediaAreaWidth,
height: mediaAreaHeight,
top: realNavbarHeight,
top: NAVBAR_HEIGHT,
left: firstPanel.width + secondPanel.width,
};

Expand Down Expand Up @@ -846,7 +838,6 @@ export {
WAITING_MIN_WIDTH,
WAITING_MAX_WIDTH,
NAVBAR_HEIGHT,
LARGE_NAVBAR_HEIGHT,
ACTIONSBAR_HEIGHT,
WEBCAMSAREA_MIN_PERCENT,
WEBCAMSAREA_MAX_PERCENT,
Expand Down

0 comments on commit ebcc9f8

Please sign in to comment.