This commit is contained in:
2019-08-26 11:16:41 +02:00
3 changed files with 29 additions and 26 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ class WebPush extends Component {
}
componentDidMount() {
if (swRegistration == null) {
if (swRegistration === null) {
this.onRegisterServiceWorker()
}
}
+2 -2
View File
@@ -253,8 +253,8 @@ function OffreDetail(props) {
console.log(props)
const logoUrl = (offre.company ? publicRuntimeConfig.logoRootUrl + offre.company.logo : "https://www.talentstube.com/img/default_picture_company.svg")
const DefaultUrl = "https://www.talentstube.com/img/default_picture_company.svg"
const imgUrl = (offre.company && offre.company.presentation_video && offre.company.presentation_video.thumbnails[0] && offre.company.presentation_video.thumbnails[0].sizes[2]) ? offre.company.presentation_video.thumbnails[0].sizes[2].link : DefaultUrl
const imgUrlDesktop = (offre.company && offre.company.presentation_video && offre.company.presentation_video.thumbnails[0] && offre.company.presentation_video.thumbnails[0].sizes[4]) ? offre.company.presentation_video.thumbnails[0].sizes[4].link : DefaultUrl
const imgUrl = (offre.company && offre.company.presentation_video && offre.company.presentation_video.thumbnails && offre.company.presentation_video.thumbnails[0] && offre.company.presentation_video.thumbnails[0].sizes[2]) ? offre.company.presentation_video.thumbnails[0].sizes[2].link : DefaultUrl
const imgUrlDesktop = (offre.company && offre.company.presentation_video && offre.company.presentation_video.thumbnails && offre.company.presentation_video.thumbnails[0] && offre.company.presentation_video.thumbnails[0].sizes[4]) ? offre.company.presentation_video.thumbnails[0].sizes[4].link : DefaultUrl
const socialShareUrl = typeof window !== 'undefined' ? window.location : publicRuntimeConfig.frontServerUrl + `/Offre/${offre.id}`;
return (
<Fragment>
+26 -23
View File
@@ -27,6 +27,11 @@ const styles = theme => ({
padding: '0 calc(25vw + 24px)',
paddingBottom: theme.spacing(5),
},
'& div': {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}
},
title: {
fontFamily: 'Dosis',
@@ -37,26 +42,19 @@ const styles = theme => ({
paddingTop: theme.spacing(6),
},
},
form: {
display: 'flex',
flexDirection: 'column',
width: '100%',
},
input: {
marginBottom: theme.spacing(4),
},
button: {
textTransform: 'inherit',
marginLeft: theme.spacing(8),
marginRight: theme.spacing(8),
padding: theme.spacing(1.2, 2),
borderRadius: '3px',
color: theme.palette.secondary.main,
backgroundColor: theme.palette.primary.important,
[theme.breakpoints.up('sm')]: {
margin: 'auto',
label: {
fontFamily: 'Roboto',
fontSize: '1em',
fontWeight: '300',
'& span': {
fontWeight: '500',
},
},
switch: {
marginBottom: theme.spacing(2),
marginLeft: 'auto',
marginRight: 'auto',
},
})
//TODO: put in config
@@ -118,18 +116,23 @@ class Parametres extends Component {
<WebPush.Consumer>
{({ on, toggleSubscription }) => (
<Fragment>
{on ? 'Recevoir des notifications : oui' : 'Recevoir des notifications : non'}
<Typography
className={classes.label}
paragraph={true}
>
Recevoir des notifications : <span>{on ? 'oui' : 'non'}</span>
</Typography>
<Switch
label="Authoriser les notifications"
style={{ marginBottom: 16 }}
onChange={()=>toggleSubscription()}
className={classes.switch}
onChange={() => toggleSubscription()}
checked={on}
/>
</Fragment>
)}
</WebPush.Consumer>
</div></div>
</div>
</div>
</Layout>
)
}