mirror of https://gitlab.com/ecentrics/concordia
Apostolos Fanakis
4 years ago
9 changed files with 69 additions and 51 deletions
@ -1,4 +0,0 @@ |
|||||
body { |
|
||||
margin: 10em; |
|
||||
padding: 0; |
|
||||
} |
|
@ -1,35 +0,0 @@ |
|||||
import React from 'react'; |
|
||||
import { withRouter } from 'react-router'; |
|
||||
import { Menu } from 'semantic-ui-react'; |
|
||||
|
|
||||
import AppContext from './AppContext'; |
|
||||
|
|
||||
import appLogo from '../assets/images/app_logo.png'; |
|
||||
import SignUpForm from './SignUpForm'; |
|
||||
|
|
||||
const MenuComponent = (props) => { |
|
||||
const { history: { push } } = props; |
|
||||
|
|
||||
return ( |
|
||||
<AppContext.Consumer> |
|
||||
{() => ( |
|
||||
<div> |
|
||||
<Menu color="black" inverted> |
|
||||
<Menu.Item |
|
||||
link |
|
||||
name="home" |
|
||||
onClick={() => { push('/'); }} |
|
||||
> |
|
||||
<img src={appLogo} alt="app_logo" /> |
|
||||
</Menu.Item> |
|
||||
|
|
||||
<SignUpForm /> |
|
||||
|
|
||||
</Menu> |
|
||||
</div> |
|
||||
)} |
|
||||
</AppContext.Consumer> |
|
||||
); |
|
||||
}; |
|
||||
|
|
||||
export default withRouter(MenuComponent); |
|
@ -0,0 +1,41 @@ |
|||||
|
import React from 'react'; |
||||
|
import { withRouter } from 'react-router'; |
||||
|
import { Menu } from 'semantic-ui-react'; |
||||
|
import { useTranslation } from 'react-i18next'; |
||||
|
import AppContext from '../../../components/AppContext'; |
||||
|
import appLogo from '../../../assets/images/app_logo.png'; |
||||
|
|
||||
|
const MainLayoutMenu = (props) => { |
||||
|
const { history: { push } } = props; |
||||
|
const { t } = useTranslation(); |
||||
|
|
||||
|
return ( |
||||
|
<AppContext.Consumer> |
||||
|
{() => ( |
||||
|
<div> |
||||
|
<Menu color="black" inverted> |
||||
|
<Menu.Item |
||||
|
link |
||||
|
name="home" |
||||
|
key="home" |
||||
|
onClick={() => { push('/'); }} |
||||
|
> |
||||
|
<img src={appLogo} alt="app_logo" /> |
||||
|
</Menu.Item> |
||||
|
<Menu.Item |
||||
|
link |
||||
|
name="register" |
||||
|
key="register" |
||||
|
onClick={() => { push('/register'); }} |
||||
|
position="right" |
||||
|
> |
||||
|
{t('topbar.button.signup')} |
||||
|
</Menu.Item> |
||||
|
</Menu> |
||||
|
</div> |
||||
|
)} |
||||
|
</AppContext.Consumer> |
||||
|
); |
||||
|
}; |
||||
|
|
||||
|
export default withRouter(MainLayoutMenu); |
@ -0,0 +1,21 @@ |
|||||
|
import React from 'react'; |
||||
|
import PropTypes from 'prop-types'; |
||||
|
|
||||
|
import MainLayoutMenu from './MainLayoutMenu'; |
||||
|
|
||||
|
const MainLayout = (props) => { |
||||
|
const { children } = props; |
||||
|
|
||||
|
return ( |
||||
|
<div id="main-layout"> |
||||
|
<MainLayoutMenu /> |
||||
|
{children} |
||||
|
</div> |
||||
|
); |
||||
|
}; |
||||
|
|
||||
|
MainLayout.propTypes = { |
||||
|
children: PropTypes.element.isRequired, |
||||
|
}; |
||||
|
|
||||
|
export default MainLayout; |
@ -1,21 +1,18 @@ |
|||||
import React from 'react'; |
import React from 'react'; |
||||
import PropTypes from 'prop-types'; |
import PropTypes from 'prop-types'; |
||||
|
|
||||
import MenuComponent from '../components/MenuComponent'; |
const RegisterLayout = (props) => { |
||||
|
|
||||
const CoreLayout = (props) => { |
|
||||
const { children } = props; |
const { children } = props; |
||||
|
|
||||
return ( |
return ( |
||||
<div> |
<div id="register-layout"> |
||||
<MenuComponent /> |
|
||||
{children} |
{children} |
||||
</div> |
</div> |
||||
); |
); |
||||
}; |
}; |
||||
|
|
||||
CoreLayout.propTypes = { |
RegisterLayout.propTypes = { |
||||
children: PropTypes.element.isRequired, |
children: PropTypes.element.isRequired, |
||||
}; |
}; |
||||
|
|
||||
export default CoreLayout; |
export default RegisterLayout; |
Loading…
Reference in new issue