all repos — caroster @ 73cc94b7e5b8bf32dc77f112aa686c7d474fbb82

[Octree] Group carpool to your event https://caroster.io

style: đŸ’„ Improve event details panel

#175
Tim Izzo tim@octree.ch
Wed, 27 Oct 2021 13:51:20 +0200
commit

73cc94b7e5b8bf32dc77f112aa686c7d474fbb82

parent

f76eb24ad8c71f44a2c0813ca6eaf6a217b0530e

M frontend/containers/Car/Header.jsfrontend/containers/Car/Header.tsx

@@ -1,4 +1,3 @@

-import React from 'react'; import Typography from '@material-ui/core/Typography'; import IconButton from '@material-ui/core/IconButton'; import Icon from '@material-ui/core/Icon';

@@ -6,9 +5,18 @@ import {makeStyles} from '@material-ui/core/styles';

import moment from 'moment'; import {useTranslation} from 'react-i18next'; import Link from '@material-ui/core/Link'; -const Header = ({car, toggleEditing}) => { +import {Car} from '../../generated/graphql'; + +interface Props { + car: Car; + toggleEditing: () => void; +} + +const Header = (props: Props) => { + const {car, toggleEditing} = props; const classes = useStyles(); const {t} = useTranslation(); + return ( <div className={classes.header}> <IconButton

@@ -44,7 +52,6 @@ </Typography>

<Typography variant="body2" id="CarMeeting"> <Link component="a" - size="small" target="_blank" rel="noopener noreferrer" href={`https://maps.google.com/?q=${encodeURI(car.meeting)}`}
M frontend/containers/EventBar/index.jsfrontend/containers/EventBar/index.js

@@ -2,7 +2,6 @@ import {useEffect, useState, useReducer} from 'react';

import AppBar from '@material-ui/core/AppBar'; import Toolbar from '@material-ui/core/Toolbar'; import Typography from '@material-ui/core/Typography'; -import Container from '@material-ui/core/Container'; import Avatar from '@material-ui/core/Avatar'; import IconButton from '@material-ui/core/IconButton'; import Icon from '@material-ui/core/Icon';

@@ -175,18 +174,13 @@ ]}

/> </Toolbar> {detailsOpen && ( - <Container className={classes.container} maxWidth="sm"> - <EventDetails toggleDetails={toggleDetails} onShare={onShare} /> - </Container> + <EventDetails toggleDetails={toggleDetails} onShare={onShare} /> )} </AppBar> ); }; const useStyles = makeStyles(theme => ({ - container: { - padding: theme.spacing(2), - }, appbar: ({detailsOpen}) => ({ overflow: 'hidden', height: detailsOpen ? '100vh' : theme.mixins.toolbar.minHeight,
M frontend/containers/EventDetails/index.jsfrontend/containers/EventDetails/index.js

@@ -1,8 +1,9 @@

-import React, {useRef} from 'react'; +import {useRef} from 'react'; import Typography from '@material-ui/core/Typography'; import Button from '@material-ui/core/Button'; import Link from '@material-ui/core/Link'; import Icon from '@material-ui/core/Icon'; +import Box from '@material-ui/core/Box'; import TextField from '@material-ui/core/TextField'; import {makeStyles, createMuiTheme, ThemeProvider} from '@material-ui/core'; import {useTranslation} from 'react-i18next';

@@ -23,7 +24,7 @@ if (!event) return null;

return ( <ThemeProvider theme={theme}> - <div className={classes.container}> + <Box className={classes.container}> <div className={classes.section}> {isEditing && ( <div className={classes.section}>

@@ -89,7 +90,8 @@ )}

</Typography> )} </div> - + <Typography variant="h6">{t('event.fields.link')}</Typography> + <Typography variant="body">{t('event.fields.link_desc')}</Typography> <TextField value={window.location.href} inputProps={{

@@ -115,7 +117,7 @@ }}

> {t('event.fields.share')} </Button> - </div> + </Box> </ThemeProvider> ); };

@@ -130,7 +132,12 @@ });

const useStyles = makeStyles(theme => ({ container: { + padding: theme.spacing(2, 9), marginBottom: theme.spacing(12), + + [theme.breakpoints.down('xs')]: { + padding: theme.spacing(2), + }, }, section: { marginBottom: theme.spacing(2),
M frontend/containers/Languages/index.tsxfrontend/containers/Languages/index.tsx

@@ -11,6 +11,7 @@ import {

useUpdateMeMutation, Enum_Userspermissionsuser_Lang, } from '../../generated/graphql'; +import moment from 'moment'; const Languages = () => { const {t, i18n} = useTranslation();

@@ -21,6 +22,8 @@ const {profile, connected} = useProfile();

const [updateProfile] = useUpdateMeMutation(); useEffect(() => { + const momentLang = language === 'FR' ? 'fr-ch' : 'en'; + moment.locale(momentLang); i18n.changeLanguage(language?.toLowerCase()); }, [language]);
M frontend/locales/en.jsonfrontend/locales/en.json

@@ -36,11 +36,13 @@ "event": {

"title": "{{title}} - Caroster", "not_found": "Project not found", "fields": { - "starts_on": "Start on", - "address": "Address", + "starts_on": "Event date", + "address": "Event address", "name": "Name of the event", "empty": "Not specified", - "share": "Share link" + "link": "Share link", + "link_desc": "Share this link to invite people to carpool", + "share": "Copy link" }, "creation": { "title": "New event",
M frontend/locales/fr.jsonfrontend/locales/fr.json

@@ -36,11 +36,13 @@ "event": {

"title": "{{title}} - Caroster", "not_found": "Projet introuvable", "fields": { - "starts_on": "Commence le", - "address": "Adresse", + "starts_on": "Date de l'événement", + "address": "Adresse de l'événement", "name": "Nom de l'événement", "empty": "Non précisé", - "share": "Lien de partage" + "link": "Lien de partage", + "link_desc": "Partager ce lien pour inviter les gens à faire du covoiturage", + "share": "Copier le lien" }, "creation": { "title": "Nouvel évènement",
M frontend/sentry.client.config.jsfrontend/sentry.client.config.js

@@ -7,7 +7,9 @@

const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN; Sentry.init({ - dsn: SENTRY_DSN || 'https://e3591d2a93ec4453804ff83008b72af6@o333894.ingest.sentry.io/5828726', + dsn: + SENTRY_DSN || + 'https://glet_e9aeb5775266f7ed1b1d16ebb550e016@git.octree.ch/api/v4/error_tracking/collector/299', // Note: if you want to override the automatic release value, do not set a // `release` value here - use the environment variable `SENTRY_RELEASE`, so // that it will also get attached to your source maps
M frontend/sentry.propertiesfrontend/sentry.properties

@@ -1,5 +1,5 @@

-defaults.url=https://sentry.io/ +defaults.url=git.octree.ch/api/v4/error_tracking/collector/299 defaults.org=octree-sarl defaults.project=caroster -auth.token=6de1448758964a25a9a8971d57ded2fb218822e21ea246bca92c2d17263d02a1 -cli.executable=../../../.npm/_npx/275038/lib/node_modules/@sentry/wizard/node_modules/@sentry/cli/bin/sentry-cli +auth.token=glet_e9aeb5775266f7ed1b1d16ebb550e016 +cli.executable=../../../.npm/_npx/275038/lib/node_modules/@sentry/wizard/node_modules/@sentry/cli/bin/sentry-cli
M frontend/sentry.server.config.jsfrontend/sentry.server.config.js

@@ -7,7 +7,9 @@

const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN; Sentry.init({ - dsn: SENTRY_DSN || 'https://e3591d2a93ec4453804ff83008b72af6@o333894.ingest.sentry.io/5828726', + dsn: + SENTRY_DSN || + 'https://glet_e9aeb5775266f7ed1b1d16ebb550e016@git.octree.ch/api/v4/error_tracking/collector/299', // Note: if you want to override the automatic release value, do not set a // `release` value here - use the environment variable `SENTRY_RELEASE`, so // that it will also get attached to your source maps