react-icons/md#MdLanguage JavaScript Examples
The following examples show how to use
react-icons/md#MdLanguage.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.js From hackchat-client with Do What The F*ck You Want To Public License | 4 votes |
export function MainMenu({
mainMenuIsOpen,
usersMenuIsOpen,
ChannelsModalIsOpen,
joinMenuIsOpen,
localeMenuIsOpen,
onOpenMainMenu,
onCloseMainMenu,
onOpenUsersModal,
onCloseUsersModal,
onOpenChannelsModal,
onCloseChannelsModal,
onOpenJoinMenu,
onCloseJoinMenu,
onOpenLocaleMenu,
onCloseLocaleMenu,
history,
intl,
}) {
useInjectReducer({ key: 'mainMenu', reducer });
const usersBtnToolTip = intl.formatMessage(messages.usersBtnToolTip);
const channelsBtnToolTip = intl.formatMessage(messages.channelsBtnToolTip);
const joinBtnToolTip = intl.formatMessage(messages.joinBtnToolTip);
const languageBtnToolTip = intl.formatMessage(messages.languageBtnToolTip);
const mainIcon = mainMenuIsOpen ? <MdClose /> : <MdMenu />;
const menuBtnText = intl.formatMessage(messages.menuBtnToolTip);
const settingsBtnText = intl.formatMessage(messages.settingsBtnToolTip);
return (
<div>
<Collapse className="fixed-bottom" isOpen={mainMenuIsOpen}>
<Container fluid>
<Row className="mx-auto">
<Col>
<MenuButton
onClick={() => {
if (ChannelsModalIsOpen) {
onCloseUsersModal();
} else {
onOpenUsersModal();
}
}}
toolTip={usersBtnToolTip}
>
<MdPeople />
</MenuButton>
<UsersModal open={usersMenuIsOpen} />
</Col>
</Row>
<Row className="mx-auto">
<Col>
<MenuButton
onClick={() => {
if (ChannelsModalIsOpen) {
onCloseChannelsModal();
} else {
onOpenChannelsModal();
}
}}
toolTip={channelsBtnToolTip}
>
<MdForum />
</MenuButton>
<ChannelsModal open={ChannelsModalIsOpen} />
</Col>
</Row>
<Row className="mx-auto">
<Col>
<MenuButton
onClick={() => {
if (joinMenuIsOpen) {
onCloseJoinMenu();
} else {
onOpenJoinMenu();
}
}}
toolTip={joinBtnToolTip}
>
<FaPlus />
</MenuButton>
<JoinModal open={joinMenuIsOpen} />
</Col>
</Row>
<Row className="mx-auto">
<Col>
<MenuButton
onClick={() => {
if (localeMenuIsOpen) {
onCloseLocaleMenu();
} else {
onOpenLocaleMenu();
}
}}
toolTip={languageBtnToolTip}
>
<MdLanguage />
</MenuButton>
<LocaleModal open={localeMenuIsOpen} />
</Col>
</Row>
<Row className="mx-auto">
<Col>
<MenuButton
onClick={() => {
history.push('/settings');
}}
toolTip={settingsBtnText}
>
<MdSettings />
</MenuButton>
</Col>
</Row>
<Row>
<Col>
<Spacer />
</Col>
</Row>
</Container>
</Collapse>
<MenuButton
isMain
className="fixed-bottom"
onClick={() => {
if (mainMenuIsOpen) {
onCloseMainMenu();
} else {
onOpenMainMenu();
}
}}
toolTip={menuBtnText}
>
{mainIcon}
</MenuButton>
</div>
);
}