all repos — caroster @ 0970de6bc377256a7fc5943751cb5791b1ae768a

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

✨ Polish the release after PO feedback
Simon Mulquin simon@octree.ch
Fri, 07 Jun 2024 08:08:35 +0000
commit

0970de6bc377256a7fc5943751cb5791b1ae768a

parent

8f8d1b858152fdaf4b7594c0f9ebc84e7518a035

M frontend/containers/EventMarker/EventPopup.tsxfrontend/containers/EventMarker/EventPopup.tsx

@@ -61,14 +61,6 @@ </Link>

</Typography> </Box> )} - {!!event.description && ( - <Box sx={{marginTop: 2}}> - <Typography variant="overline" color="GrayText"> - {t('event.fields.description')} - </Typography> - <Typography variant="body1">{event.description}</Typography> - </Box> - )} </Card> </Popup> );
M frontend/containers/Travel/Header.tsxfrontend/containers/Travel/Header.tsx

@@ -13,7 +13,7 @@ import getMapsLink from '../../lib/getMapsLink';

import useMapStore from '../../stores/useMapStore'; import usePermissions from '../../hooks/usePermissions'; import useProfile from '../../hooks/useProfile'; -import DetailsLink from './DetailsLink'; +import DetailsLink from '../DetailsLink'; import {TravelEntity} from '../../generated/graphql'; interface Props {

@@ -37,6 +37,9 @@ userId && userId === travel.attributes.user?.data?.id;

const passengersCount = travel?.attributes.passengers?.data.length || 0; const availableSeats = travel?.attributes.seats - passengersCount || 0; + + const tripHasValidCoordinates = + travel.attributes.meeting_latitude && travel.attributes.meeting_longitude; return ( <Box

@@ -110,8 +113,11 @@ >

{travel.attributes.meeting} </Link> </Typography> - {MAPBOX_CONFIGURED && ( - <Typography variant="overline" color="warning.main">{t`placeInput.noCoordinates`}</Typography> + {MAPBOX_CONFIGURED && !tripHasValidCoordinates && ( + <Typography + variant="overline" + color="warning.main" + >{t`placeInput.noCoordinates`}</Typography> )} </Box> )}

@@ -121,7 +127,11 @@ <Typography variant="overline" sx={{color: 'GrayText'}}>

{t('travel.fields.details')} </Typography> - <Typography variant="body1" sx={{whiteSpace: 'pre-line'}} onClick={e => e.stopPropagation()}> + <Typography + variant="body1" + sx={{whiteSpace: 'pre-line'}} + onClick={e => e.stopPropagation()} + > <Linkify options={{render: DetailsLink}}> {travel.attributes.details} </Linkify>
M frontend/containers/Travel/HeaderEditing.tsxfrontend/containers/Travel/HeaderEditing.tsx

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

-import {useState, useReducer, useCallback, useEffect, useMemo} from 'react'; +import {useState, useReducer, useCallback, useEffect} from 'react'; import Typography from '@mui/material/Typography'; import Button from '@mui/material/Button'; import TextField from '@mui/material/TextField';
M frontend/locales/en.jsonfrontend/locales/en.json

@@ -198,9 +198,9 @@ "profile.password_changed": "Password updated",

"profile.stripe_link.button": "History", "profile.stripe_link.title": "Billing", "profile.title": "Profile", - "PROTECTED.languages.en": "English", - "PROTECTED.languages.fr": "Français", - "PROTECTED.languages.nl": "Nederlands", + "PROTECTED.languages.en": "English (100%)", + "PROTECTED.languages.fr": "Français (100%)", + "PROTECTED.languages.nl": "Nederlands (97%)", "signin.email": "Email", "signin.emailConfirmation": "Your account has been confirmed. You can now login.", "signin.errors.CredentialsSignin": "Check your email and password. If your account is linked to Google, please use login with Google.",
M frontend/pages/e/[uuid]/details.tsxfrontend/pages/e/[uuid]/details.tsx

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

import moment from 'moment'; +import Linkify from 'linkify-react'; import Tooltip from '@mui/material/Tooltip'; import IconButton from '@mui/material/IconButton'; import Box from '@mui/material/Box';

@@ -14,6 +15,7 @@ import {DatePicker} from '@mui/x-date-pickers/DatePicker';

import {PropsWithChildren, useState} from 'react'; import {useTranslation} from 'react-i18next'; import pageUtils from '../../../lib/pageUtils'; +import DetailsLink from '../../../containers/DetailsLink'; import ShareEvent from '../../../containers/ShareEvent'; import PlaceInput from '../../../containers/PlaceInput'; import LangSelector from '../../../components/LangSelector';

@@ -134,55 +136,61 @@ <Typography variant="h4" pb={2}>

{t('event.details')} </Typography> {canEditEventDetails() && modifyButton} - {(isEditing || event.name) && <Box pt={2} pr={1.5}> - <Typography variant="overline">{t('event.fields.name')}</Typography> - <Typography> + {(isEditing || event.name) && ( + <Box pt={2} pr={1.5}> + <Typography variant="overline"> + {t('event.fields.name')} + </Typography> + <Typography> + {isEditing ? ( + <TextField + size="small" + fullWidth + value={event.name} + onChange={e => setEventUpdate({name: e.target.value})} + name="name" + id="EditEventName" + /> + ) : ( + <Typography id="EventName">{event.name}</Typography> + )} + </Typography> + </Box> + )} + {(isEditing || event.address) && ( + <Box pt={2} pr={1.5}> + <Typography variant="overline"> + {t('event.fields.date')} + </Typography> {isEditing ? ( - <TextField - size="small" - fullWidth - value={event.name} - onChange={e => setEventUpdate({name: e.target.value})} - name="name" - id="EditEventName" - /> + <Typography> + <DatePicker + slotProps={{ + textField: { + size: 'small', + id: `EditEventDate`, + fullWidth: true, + placeholder: t('event.fields.date_placeholder'), + }, + }} + format="DD/MM/YYYY" + value={moment(event.date)} + onChange={date => + setEventUpdate({ + date: !date ? null : moment(date).format('YYYY-MM-DD'), + }) + } + /> + </Typography> ) : ( - <Typography id="EventName"> - {event.name} - </Typography> + <Box position="relative"> + <Typography id="EventDate"> + {moment(event.date).format('DD/MM/YYYY')} + </Typography> + </Box> )} - </Typography> - </Box>} - {(isEditing || event.address) && <Box pt={2} pr={1.5}> - <Typography variant="overline">{t('event.fields.date')}</Typography> - {isEditing ? ( - <Typography> - <DatePicker - slotProps={{ - textField: { - size: 'small', - id: `EditEventDate`, - fullWidth: true, - placeholder: t('event.fields.date_placeholder'), - }, - }} - format="DD/MM/YYYY" - value={moment(event.date)} - onChange={date => - setEventUpdate({ - date: !date ? null : moment(date).format('YYYY-MM-DD'), - }) - } - /> - </Typography> - ) : ( - <Box position="relative"> - <Typography id="EventDate"> - {moment(event.date).format('DD/MM/YYYY')} - </Typography> - </Box> - )} - </Box>} + </Box> + )} {(isEditing || event.address) && ( <Box pt={2} pr={1.5}> <Typography variant="overline">

@@ -240,8 +248,13 @@ name="description"

/> </Typography> ) : ( - <Typography id="EventDescription" sx={{pr: 3}}> - {event.description} + <Typography + id="EventDescription" + sx={{pr: 3, whiteSpace: 'pre-line'}} + > + <Linkify options={{render: DetailsLink}}> + {event.description} + </Linkify> </Typography> )} </Box>