mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
Create app namespace for all absolute requires of app modules. Move all packages under packages yarn workspace
This commit is contained in:
62
packages/app/components/footerMenu/FooterMenu.tsx
Normal file
62
packages/app/components/footerMenu/FooterMenu.tsx
Normal file
@ -0,0 +1,62 @@
|
||||
import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { FormattedMessage as Message } from 'react-intl';
|
||||
import LanguageSwitcher from 'app/components/languageSwitcher';
|
||||
import { create as createPopup } from 'app/components/ui/popup/actions';
|
||||
import { ContactLink } from 'app/components/contact';
|
||||
|
||||
import styles from './footerMenu.scss';
|
||||
import messages from './footerMenu.intl.json';
|
||||
|
||||
type Props = {
|
||||
createLanguageSwitcherPopup: () => void;
|
||||
};
|
||||
|
||||
class FooterMenu extends React.Component<Props> {
|
||||
render() {
|
||||
return (
|
||||
<div className={styles.footerMenu}>
|
||||
<Link to="/rules">
|
||||
<Message {...messages.rules} />
|
||||
</Link>
|
||||
{' | '}
|
||||
<ContactLink>
|
||||
<Message {...messages.contactUs} />
|
||||
</ContactLink>
|
||||
{' | '}
|
||||
<Link to="/dev">
|
||||
<Message {...messages.forDevelopers} />
|
||||
</Link>
|
||||
|
||||
<div className={styles.langTriggerContainer}>
|
||||
<a
|
||||
href="#"
|
||||
className={styles.langTrigger}
|
||||
onClick={this.onLanguageSwitcher}
|
||||
>
|
||||
<span className={styles.langTriggerIcon} />
|
||||
<Message {...messages.siteLanguage} />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
onLanguageSwitcher = (event: React.MouseEvent<HTMLElement>) => {
|
||||
event.preventDefault();
|
||||
|
||||
this.props.createLanguageSwitcherPopup();
|
||||
};
|
||||
}
|
||||
|
||||
// mark this component, as not pure, because it is stateless,
|
||||
// but should be re-rendered, if current lang was changed
|
||||
export default connect(
|
||||
null,
|
||||
{
|
||||
createLanguageSwitcherPopup: () => createPopup({ Popup: LanguageSwitcher }),
|
||||
},
|
||||
null,
|
||||
{ pure: false },
|
||||
)(FooterMenu);
|
6
packages/app/components/footerMenu/footerMenu.intl.json
Normal file
6
packages/app/components/footerMenu/footerMenu.intl.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"rules": "Rules",
|
||||
"contactUs": "Contact Us",
|
||||
"siteLanguage": "Site language",
|
||||
"forDevelopers": "For developers"
|
||||
}
|
23
packages/app/components/footerMenu/footerMenu.scss
Normal file
23
packages/app/components/footerMenu/footerMenu.scss
Normal file
@ -0,0 +1,23 @@
|
||||
.footerMenu {
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
color: #666;
|
||||
|
||||
a {
|
||||
color: #666;
|
||||
border-bottom-color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.langTriggerContainer {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.langTriggerIcon {
|
||||
composes: globe from '~app/components/ui/icons.scss';
|
||||
|
||||
position: relative;
|
||||
bottom: 1px;
|
||||
font-size: 11px;
|
||||
margin-right: 3px;
|
||||
}
|
3
packages/app/components/footerMenu/index.ts
Normal file
3
packages/app/components/footerMenu/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import FooterMenu from './FooterMenu';
|
||||
|
||||
export { FooterMenu };
|
Reference in New Issue
Block a user