Skip to content
Commits on Source (22)
......@@ -39,7 +39,7 @@ stages:
- !reference [.rules-map, on-dev]
- !reference [.rules-map, not-on-semantic-release-commit]
- !reference [.rules-map, on-branch]
image: hub.eole.education/proxyhub/geoffreybooth/meteor-base:2.15
image: hub.eole.education/proxyhub/geoffreybooth/meteor-base:2.16
before_script:
- cd app
cache:
......
# The tag here should match the Meteor version of your app, per .meteor/release
FROM hub.eole.education/proxyhub/geoffreybooth/meteor-base:2.15
FROM hub.eole.education/proxyhub/geoffreybooth/meteor-base:2.16
# Copy app package.json and package-lock.json into container
COPY ./app/package*.json $APP_SOURCE_FOLDER/
......
......@@ -21,7 +21,8 @@
"meteor": {
"extensions": [".js"]
}
}
},
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }]
},
"globals": {
"msg": false,
......
......@@ -6,7 +6,7 @@
meteor-base@1.5.1 # Packages every Meteor app needs to have
mobile-experience@1.1.1 # Packages for a great mobile UX
mongo@1.16.8 # The database Meteor supports right now
mongo@1.16.10 # The database Meteor supports right now
reactive-var@1.0.12 # Reactive variable for tracker
standard-minifier-css@1.9.2 # CSS minifier run for production mode
......@@ -33,10 +33,10 @@ hwillson:stub-collections
johanbrook:publication-collector
dburles:factory
random@1.2.1
service-configuration@1.3.3
service-configuration@1.3.4
matb33:collection-hooks
email@2.2.5
check@1.3.2
email@2.2.6
check@1.4.1
eoleteam:accounts-keycloak
mexar:mdt
accounts-base@2.2.10
accounts-oauth@1.4.3
accounts-base@2.2.11
accounts-oauth@1.4.4
accounts-password@2.4.0
aldeed:collection2@3.5.0
aldeed:schema-index@3.1.0
......@@ -14,14 +14,14 @@ boilerplate-generator@1.7.2
caching-compiler@1.2.2
caching-html-compiler@1.2.2
callback-hook@1.5.1
check@1.3.2
check@1.4.1
dburles:collection-helpers@1.1.0
dburles:factory@1.5.0
ddp@1.4.1
ddp-client@2.6.1
ddp-common@1.4.0
ddp-client@2.6.2
ddp-common@1.4.1
ddp-rate-limiter@1.2.1
ddp-server@2.7.0
ddp-server@2.7.1
diff-sequence@1.1.2
dynamic-import@0.7.3
ecmascript@0.16.8
......@@ -29,7 +29,7 @@ ecmascript-runtime@0.8.1
ecmascript-runtime-client@0.12.1
ecmascript-runtime-server@0.11.0
ejson@1.1.3
email@2.2.5
email@2.2.6
eoleteam:accounts-keycloak@2.1.0
eoleteam:keycloak-oauth@2.3.0
es5-shim@4.8.0
......@@ -46,7 +46,7 @@ inter-process-messaging@0.1.1
johanbrook:publication-collector@1.1.0
launch-screen@2.0.0
localstorage@1.2.0
logging@1.3.3
logging@1.3.4
matb33:collection-hooks@1.3.1
mdg:validated-method@1.3.0
meteor@1.11.5
......@@ -56,15 +56,15 @@ meteortesting:mocha@2.1.0
meteortesting:mocha-core@8.1.2
mexar:mdt@0.2.2
minifier-css@1.6.4
minifier-js@2.7.5
minimongo@1.9.3
minifier-js@2.8.0
minimongo@1.9.4
mobile-experience@1.1.1
mobile-status-bar@1.1.0
modern-browsers@0.1.10
modules@0.20.0
modules-runtime@0.13.1
modules-runtime-hot@0.14.2
mongo@1.16.9
mongo@1.16.10
mongo-decimal@0.1.3
mongo-dev-server@1.1.0
mongo-id@1.0.8
......@@ -82,7 +82,7 @@ reactive-var@1.0.12
reload@1.3.1
retry@1.1.0
routepolicy@1.1.1
service-configuration@1.3.3
service-configuration@1.3.4
sha@1.0.9
shell-server@0.5.0
socket-stream-client@0.5.2
......
......@@ -18,6 +18,9 @@
"scriptDetected": "Forbidden content has been detected",
"badCharsDetected": "Following characters are Forbidden: < > & ' \"",
"stringTooLong": "String is too long (max 50k)"
},
"users": {
"notActive": "You must be approved by an administrator to create an event."
}
},
"pages": {
......
......@@ -16,8 +16,11 @@
"methods": {},
"utils": {
"scriptDetected": "Du contenu non autorisé a été détecté",
"badCharsDetected": "Les caractères suivants sont interdits: < > & ' \"",
"badCharsDetected": "Les caractères suivants sont interdits : < > & ' \"",
"stringTooLong": "Chaîne trop longue (50k maximum)"
},
"users": {
"notActive": "Vous devez être validé par un administrateur pour créer un évènement"
}
},
"pages": {
......@@ -52,7 +55,7 @@
"closeButton": "Annuler",
"eventCreated": "Évènement créé avec succès",
"needTitle": "Un titre est requis",
"needEventType": "Un type d'évènements est requis",
"needEventType": "Un type d'évènement est requis",
"startDateMustBeAfterToday": "La date doit être après aujourd'hui",
"startMustBeAfterNow": "Le début de l'évènement est déjà passé",
"endMustBeAfterBegin": "La fin de l'évènement doit être après le début"
......@@ -150,7 +153,7 @@
"menuLogoutLabel": "Se déconnecter",
"menuAddEvent": "Ajouter évènement",
"copyCaldavUrl": "Mon URL Caldav",
"successCopyCaldav": "Url copié avec succès",
"successCopyCaldav": "URL copiée avec succès",
"menuAboutLabel": "À propos"
},
"AppVersion": {
......@@ -211,7 +214,7 @@
"expectedType": "{$label} doit être du type {$dataType}",
"keyNotInSchema": "{$name} n'est pas autorisé par le schéma",
"RegEx": {
"Default": "Echec de validation de l'expression régulière",
"Default": "Échec de validation de l'expression régulière",
"Email": "doit être une adresse e-mail valide",
"EmailWithTLD": "doit être une adresse e-mail valide",
"Domain": "doit être un domaine valide",
......@@ -225,7 +228,7 @@
"Phone": "doit être un numéro de téléphone valide"
},
"dataTypes": {
"String": "Chaine de caractères",
"String": "Chaîne de caractères",
"Number": "Numérique",
"Integer": "Entier",
"Boolean": "Booléen",
......
......@@ -51,10 +51,11 @@ export const createEvent = new ValidatedMethod({
}).validator({ clean: true }),
run({ data }) {
if (!isActive(this.userId)) {
throw new Meteor.Error('api.events.create.notActive', i18n.__('api.users.notActive'));
}
try {
if (!isActive(this.userId)) {
throw new Meteor.Error('api.events.create.notLoggedIn', i18n.__('api.users.notLoggedIn'));
}
_createEvent(data);
} catch (error) {
throw new Meteor.Error(error.code, error.message);
......@@ -62,18 +63,6 @@ export const createEvent = new ValidatedMethod({
},
});
// export const allUsersGroup = new ValidatedMethod({
// name: 'events.allUsers',
// validate: new SimpleSchema({
// arrayAdmins: { type: Array },
// 'arrayAdmins.$': { type: String },
// }).validator({ clean: true }),
// run({ arrayAdmins }) {
// const user = Meteor.users.find({ _id: { $in: arrayAdmins } }, { fields: { _id: 1, emails: 1 } }).fetch();
// return user;
// },
// });
export const editEvent = new ValidatedMethod({
name: 'events.edit',
validate: new SimpleSchema({
......@@ -84,7 +73,7 @@ export const editEvent = new ValidatedMethod({
try {
const event = Events.findOne({ _id: data._id }, { fields: { userId: 1 } });
if (!isActive(this.userId)) {
throw new Meteor.Error('api.events.edit.notLoggedIn', i18n.__('api.users.notLoggedIn'));
throw new Meteor.Error('api.events.edit.notActive', i18n.__('api.users.notActive'));
} else if (event && event.userId !== this.userId) {
throw new Meteor.Error('api.events.edit.notOwner', i18n.__('api.users.mustBeOwner'));
}
......@@ -127,7 +116,7 @@ export const deleteEvent = new ValidatedMethod({
try {
const event = Events.findOne({ _id: eventId }, { fields: { userId: 1 } });
if (!isActive(this.userId)) {
throw new Meteor.Error('api.events.edit.notLoggedIn', i18n.__('api.users.notLoggedIn'));
throw new Meteor.Error('api.events.edit.notActive', i18n.__('api.users.notActive'));
} else if (event && event.userId !== this.userId) {
throw new Meteor.Error('api.events.edit.notOwner', i18n.__('api.users.mustBeOwner'));
}
......@@ -149,11 +138,12 @@ export const changeUserStatus = new ValidatedMethod({
}).validator({ clean: true }),
run({ eventId, status }) {
if (!isActive(this.userId)) {
throw new Meteor.Error('api.events.edit.notActive', i18n.__('api.users.notActive'));
}
try {
const event = Events.findOne({ _id: eventId }) || {};
if (!isActive(this.userId)) {
throw new Meteor.Error('api.events.edit.notLoggedIn', i18n.__('api.users.notLoggedIn'));
}
const participants = event.participants.map((p) => ({
...p,
status: p._id === this.userId ? status : p.status,
......
......@@ -17,10 +17,11 @@ export const getEvent = new ValidatedMethod({
}).validator({ clean: true }),
run({ _id }) {
if (!isActive(this.userId)) {
throw new Meteor.Error('api.events.get.notLoggedIn', i18n.__('api.users.notActive'));
}
try {
if (!isActive(this.userId)) {
throw new Meteor.Error('api.events.get.notLoggedIn', i18n.__('api.users.mustBeLoggedIn'));
}
return Events.findOne({ _id });
} catch (error) {
throw new Meteor.Error(error.code, error.message);
......@@ -35,10 +36,11 @@ export const importEvents = new ValidatedMethod({
validate: null,
run({ data }) {
if (!isActive(this.userId)) {
throw new Meteor.Error('api.events.import.notLoggedIn', i18n.__('api.users.notActive'));
}
try {
if (!isActive(this.userId)) {
throw new Meteor.Error('api.events.import.notLoggedIn', i18n.__('api.users.notLoggedIn'));
}
const evtSchema = Events.schema.omit('createdAt', 'updatedAt', 'userId', '_id');
data.forEach((event) => {
const validatedEvent = evtSchema.clean(event);
......
......@@ -3,18 +3,18 @@ import i18n from 'meteor/universe:i18n';
import PropTypes from 'prop-types';
import { useTracker } from 'meteor/react-meteor-data';
import { makeStyles } from '@material-ui/core/styles';
import Grid from '@material-ui/core/Grid';
import FormControl from '@material-ui/core/FormControl';
import Divider from '@material-ui/core/Divider';
import Select from '@material-ui/core/Select';
import FormHelperText from '@material-ui/core/FormHelperText';
import MenuItem from '@material-ui/core/MenuItem';
import { makeStyles } from 'tss-react/mui';
import Grid from '@mui/material/Grid';
import FormControl from '@mui/material/FormControl';
import Divider from '@mui/material/Divider';
import Select from '@mui/material/Select';
import FormHelperText from '@mui/material/FormHelperText';
import MenuItem from '@mui/material/MenuItem';
import SingleGroupDisplay from './SingleGroupDisplay';
import Groups from '../../../api/groups/groups';
import { getGroupName } from '../../../api/utils/functions';
const useStyles = makeStyles(() => ({
const useStyles = makeStyles()(() => ({
field: {
width: '100%',
},
......@@ -24,7 +24,7 @@ const useStyles = makeStyles(() => ({
}));
const GroupsSelector = ({ stateHook: [state, setState], errors, groupId }) => {
const classes = useStyles();
const { classes } = useStyles();
const handleSelect = (e) => {
const group = Groups.findOne(e.target.value);
......
......@@ -3,27 +3,27 @@ import React, { useEffect, useState } from 'react';
import i18n from 'meteor/universe:i18n';
import PropTypes from 'prop-types';
import { makeStyles } from '@material-ui/core/styles';
import Grid from '@material-ui/core/Grid';
import TextField from '@material-ui/core/TextField';
import Divider from '@material-ui/core/Divider';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import Checkbox from '@material-ui/core/Checkbox';
import FormControl from '@material-ui/core/FormControl';
import Select from '@material-ui/core/Select';
import MenuItem from '@material-ui/core/MenuItem';
import InputLabel from '@material-ui/core/InputLabel';
import { makeStyles } from 'tss-react/mui';
import Grid from '@mui/material/Grid';
import TextField from '@mui/material/TextField';
import Divider from '@mui/material/Divider';
import FormControlLabel from '@mui/material/FormControlLabel';
import Checkbox from '@mui/material/Checkbox';
import FormControl from '@mui/material/FormControl';
import Select from '@mui/material/Select';
import MenuItem from '@mui/material/MenuItem';
import InputLabel from '@mui/material/InputLabel';
import EVENTS_COLOR from '../../utils/eventsColor';
// import moment from 'moment';
const useStyles = makeStyles(() => ({
const useStyles = makeStyles()(() => ({
field: {
width: '100%',
},
}));
const InformationsForm = ({ stateHook: [state, setState], errors }) => {
const classes = useStyles();
const { classes } = useStyles();
// const handleToggleRecurrence = (e) => {
// setState({
......
......@@ -3,23 +3,23 @@ import i18n from 'meteor/universe:i18n';
import PropTypes from 'prop-types';
import { useTracker } from 'meteor/react-meteor-data';
import { makeStyles } from '@material-ui/core/styles';
import Grid from '@material-ui/core/Grid';
import TextField from '@material-ui/core/TextField';
import Divider from '@material-ui/core/Divider';
import Chip from '@material-ui/core/Chip';
import List from '@material-ui/core/List';
import ListItem from '@material-ui/core/ListItem';
import ListItemText from '@material-ui/core/ListItemText';
import ListItemAvatar from '@material-ui/core/ListItemAvatar';
import Avatar from '@material-ui/core/Avatar';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import Checkbox from '@material-ui/core/Checkbox';
import { makeStyles } from 'tss-react/mui';
import Grid from '@mui/material/Grid';
import TextField from '@mui/material/TextField';
import Divider from '@mui/material/Divider';
import Chip from '@mui/material/Chip';
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
import ListItemText from '@mui/material/ListItemText';
import ListItemAvatar from '@mui/material/ListItemAvatar';
import Avatar from '@mui/material/Avatar';
import FormControlLabel from '@mui/material/FormControlLabel';
import Checkbox from '@mui/material/Checkbox';
import { validateEmail } from '../../../api/utils/functions';
import { useAppContext } from '../../contexts/context';
// import Groups from '../../../api/groups/groups';
const useStyles = makeStyles(() => ({
const useStyles = makeStyles()(() => ({
chip: {
margin: 5,
},
......@@ -32,7 +32,7 @@ const useStyles = makeStyles(() => ({
}));
const ParticipantsSelector = ({ stateHook: [state, setState], handleCheckBoxUser }) => {
const classes = useStyles();
const { classes } = useStyles();
const [search, setSearch] = useState('');
const [{ user, userId }] = useAppContext();
......
import React from 'react';
import { useTracker } from 'meteor/react-meteor-data';
import PropTypes from 'prop-types';
import Chip from '@material-ui/core/Chip';
import Avatar from '@material-ui/core/Avatar';
import { makeStyles } from '@material-ui/core/styles';
import Accordion from '@material-ui/core/Accordion';
import AccordionSummary from '@material-ui/core/AccordionSummary';
import AccordionDetails from '@material-ui/core/AccordionDetails';
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
import Typography from '@material-ui/core/Typography';
import DeleteButton from '@material-ui/icons/CloseRounded';
import IconButton from '@material-ui/core/IconButton';
import DoneIcon from '@material-ui/icons/Done';
import RemoveIcon from '@material-ui/icons/CloseOutlined';
import { makeStyles } from 'tss-react/mui';
import Chip from '@mui/material/Chip';
import Avatar from '@mui/material/Avatar';
import Accordion from '@mui/material/Accordion';
import AccordionSummary from '@mui/material/AccordionSummary';
import AccordionDetails from '@mui/material/AccordionDetails';
import Typography from '@mui/material/Typography';
import IconButton from '@mui/material/IconButton';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import DeleteButton from '@mui/icons-material/CloseRounded';
import DoneIcon from '@mui/icons-material/Done';
import RemoveIcon from '@mui/icons-material/CloseOutlined';
import Groups from '../../../api/groups/groups';
import { getGroupName } from '../../../api/utils/functions';
const useStyles = makeStyles((theme) => ({
const useStyles = makeStyles()((theme) => ({
chip: {
margin: 5,
},
......@@ -45,7 +45,7 @@ const useStyles = makeStyles((theme) => ({
}));
const SingleGroupDisplay = ({ group, handleDelete, view, event }) => {
const classes = useStyles();
const { classes } = useStyles();
const users = useTracker(() => {
const { animators = [], members = [] } = Groups.findOne({ _id: group._id }) || {};
......
import React, { useState, useEffect } from 'react';
import { Meteor } from 'meteor/meteor';
import { makeStyles } from '@material-ui/core/styles';
import Toolbar from '@material-ui/core/Toolbar';
import AppBar from '@material-ui/core/AppBar';
import { makeStyles } from 'tss-react/mui';
import Toolbar from '@mui/material/Toolbar';
import AppBar from '@mui/material/AppBar';
import i18n from 'meteor/universe:i18n';
import { useAppContext } from '../../contexts/context';
import { getAppSettingsLinks } from '../../../api/appsettings/methods';
const useStyles = makeStyles((theme) => ({
const useStyles = makeStyles()((theme) => ({
root: {
display: 'flex',
justifyContent: 'space-between',
......@@ -46,7 +46,7 @@ export const LEGAL_ROUTES = {
};
const Footer = () => {
const classes = useStyles();
const { classes } = useStyles();
const [{ isMobile }] = useAppContext();
const laboiteURL = Meteor.settings.public.laboiteUrl;
const [settingsData, setSettingsData] = useState([]);
......
import React, { useState } from 'react';
import i18n from 'meteor/universe:i18n';
import { useHistory, useLocation } from 'react-router-dom';
import { makeStyles } from '@material-ui/core/styles';
import Button from '@material-ui/core/Button';
import Menu from '@material-ui/core/Menu';
import MenuItem from '@material-ui/core/MenuItem';
import Divider from '@material-ui/core/Divider';
import Tooltip from '@material-ui/core/Tooltip';
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
import { makeStyles } from 'tss-react/mui';
import Button from '@mui/material/Button';
import Menu from '@mui/material/Menu';
import MenuItem from '@mui/material/MenuItem';
import Divider from '@mui/material/Divider';
import Tooltip from '@mui/material/Tooltip';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import PropTypes from 'prop-types';
import LogoutDialog from '../system/LogoutDialog';
import UserAvatar from '../system/UserAvatar';
import LanguageSwitcher from '../system/LanguageSwitcher';
import ROUTES from '../../layouts/routes';
const useStyles = makeStyles((theme) => ({
const useStyles = makeStyles()((theme) => ({
avatar: {
marginLeft: theme.spacing(1),
},
......@@ -29,7 +29,7 @@ export const menu = [
];
const MainMenu = ({ user = {} }) => {
const classes = useStyles();
const { classes } = useStyles();
const [anchorEl, setAnchorEl] = useState(null);
const [openLogout, setOpenLogout] = useState(false);
const history = useHistory();
......@@ -107,7 +107,6 @@ const MainMenu = ({ user = {} }) => {
keepMounted
open={Boolean(anchorEl)}
onClose={handleClose}
getContentAnchorEl={null}
anchorOrigin={{
vertical: 'bottom',
horizontal: 'center',
......@@ -132,14 +131,14 @@ const MainMenu = ({ user = {} }) => {
})}
<Divider />
{Meteor.settings.public.caldavUrl ? (
<>
<div>
<Tooltip title={userCaldavUrl()}>
<MenuItem onClick={handleCopyCaldavUrl}>
<T>copyCaldavUrl</T>
</MenuItem>
</Tooltip>
<Divider />
</>
</div>
) : null}
<MenuItem onClick={onLogout}>
......
import React from 'react';
import i18n from 'meteor/universe:i18n';
import { useLocation, useHistory } from 'react-router-dom';
import { makeStyles } from '@material-ui/core/styles';
import Tabs from '@material-ui/core/Tabs';
import Tab from '@material-ui/core/Tab';
import { makeStyles } from 'tss-react/mui';
import { PropTypes } from 'prop-types';
import Tabs from '@mui/material/Tabs';
import Tab from '@mui/material/Tab';
// import HomeIcon from '@material-ui/icons/Home';
export const links = [
......@@ -17,32 +17,31 @@ export const links = [
// },
];
const useStyles = (mobile) =>
makeStyles((theme) => ({
tabs: {
color: theme.palette.text.primary,
},
mobileTabs: {
textTransform: 'none',
},
flexContainer: {
display: 'flex',
alignItems: 'center',
},
indicator: {
top: mobile ? 0 : null,
height: 3,
borderTopLeftRadius: mobile ? 0 : theme.shape.borderRadius,
borderTopRightRadius: mobile ? 0 : theme.shape.borderRadius,
borderBottomLeftRadius: !mobile ? 0 : theme.shape.borderRadius,
borderBottomRightRadius: !mobile ? 0 : theme.shape.borderRadius,
},
}));
const useStyles = makeStyles()((theme, mobile) => ({
tabs: {
color: theme.palette.text.primary,
},
mobileTabs: {
textTransform: 'none',
},
flexContainer: {
display: 'flex',
alignItems: 'center',
},
indicator: {
top: mobile ? 0 : null,
height: 3,
borderTopLeftRadius: mobile ? 0 : theme.shape.borderRadius,
borderTopRightRadius: mobile ? 0 : theme.shape.borderRadius,
borderBottomLeftRadius: !mobile ? 0 : theme.shape.borderRadius,
borderBottomRightRadius: !mobile ? 0 : theme.shape.borderRadius,
},
}));
const MenuBar = ({ mobile }) => {
const { pathname } = useLocation();
const history = useHistory();
const classes = useStyles(mobile)();
const { classes } = useStyles(mobile);
const T = i18n.createComponent('components.MenuBar');
const currentLink = links.find((link) => {
if (link.path === pathname || (pathname.search(link.path) > -1 && link.path !== '/')) {
......@@ -61,10 +60,7 @@ const MenuBar = ({ mobile }) => {
return links.length === 0 ? null : (
<Tabs
className={classes.tabs}
classes={{
flexContainer: classes.flexContainer,
indicator: classes.indicator,
}}
classes={`${classes.flexContainer} ${classes.indicator}`}
value={currentLink ? currentLink.path : false}
indicatorColor="secondary"
textColor="primary"
......
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import AppBar from '@material-ui/core/AppBar';
import { makeStyles } from 'tss-react/mui';
import AppBar from '@mui/material/AppBar';
import MenuBar from './MenuBar';
const useStyles = makeStyles((theme) => ({
const useStyles = makeStyles()((theme) => ({
root: {
backgroundColor: theme.palette.tertiary.main,
bottom: 0,
......@@ -12,7 +12,7 @@ const useStyles = makeStyles((theme) => ({
}));
const MobileMenu = () => {
const classes = useStyles();
const { classes } = useStyles();
return (
<AppBar position="fixed" className={classes.root}>
<MenuBar mobile />
......
import React from 'react';
import { Link } from 'react-router-dom';
import { makeStyles } from '@material-ui/core/styles';
import AppBar from '@material-ui/core/AppBar';
import { makeStyles } from 'tss-react/mui';
import AppBar from '@mui/material/AppBar';
import Toolbar from '@mui/material/Toolbar';
import MenuBar from './MenuBar';
import MainMenu from './MainMenu';
import { useAppContext } from '../../contexts/context';
// import { ThemeContext } from '../../contexts/colorModeContext/provider';
const useStyles = makeStyles((theme) => ({
root: {
const useStyles = makeStyles()((theme) => ({
appbar: {
backgroundColor: theme.palette.tertiary.main,
display: 'flex',
flexDirection: 'row',
......@@ -41,21 +43,24 @@ const LONG_LOGO = 'Agenda.png';
function TopBar() {
const [{ isMobile, user }] = useAppContext();
const classes = useStyles();
// const { switchColorMode } = useContext(ThemeContext);
const { classes } = useStyles();
const LOGO = `/images/${isMobile ? SMALL_LOGO : LONG_LOGO}`;
return (
<AppBar position="fixed" className={classes.root}>
<Link to="/" className={classes.imgLogo}>
<img src={LOGO} className={classes.imgLogo} alt="Logo" />
</Link>
<AppBar position="fixed">
<Toolbar className={classes.appbar}>
<Link to="/" className={classes.imgLogo}>
<img src={LOGO} className={classes.imgLogo} alt="Logo" />
</Link>
{!isMobile && !!user && <MenuBar />}
{!!user && (
<div className={classes.rightContainer}>
<MainMenu user={user} />
</div>
)}
{!isMobile && !!user && <MenuBar />}
{!!user && (
<div className={classes.rightContainer}>
<MainMenu user={user} />
</div>
)}
</Toolbar>
</AppBar>
);
}
......
......@@ -34,7 +34,7 @@ const Calendar = () => {
const [importICS, setImportICS] = useState(false);
const inputRef = useRef();
const history = useHistory();
const classes = useCalendarStyles(isMobile)();
const { classes } = useCalendarStyles(isMobile);
const buttons = useTracker(() => BUTTONS_TEXTS(), [language]);
......