Skip to content

Commit

Permalink
Disable conference hall integration (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoGresse authored Sep 6, 2024
1 parent 03a28ed commit 67b1cab
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 90 deletions.
74 changes: 6 additions & 68 deletions src/conferencehall/RequireConferenceHallLogin.tsx
Original file line number Diff line number Diff line change
@@ -1,78 +1,16 @@
import * as React from 'react'
import { Box, Button, ButtonProps, Typography } from '@mui/material'
import { conferenceHallLogin, ConferenceHallProviders, useConferenceHallUser } from './firebase/authConferenceHall'
import GoogleIcon from '@mui/icons-material/Google'
import TwitterIcon from '@mui/icons-material/Twitter'
import GitHubIcon from '@mui/icons-material/GitHub'
import styled from '@emotion/styled'
import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'

const GoogleButton = styled(Button)<ButtonProps>(() => ({
color: 'white',
backgroundColor: '#ea2533',
'&:hover': {
backgroundColor: '#a31b25',
},
}))
const TwitterButton = styled(Button)<ButtonProps>(() => ({
color: 'white',
backgroundColor: '#34ccfe',
'&:hover': {
backgroundColor: '#1a728f',
},
}))
const GitHubButton = styled(Button)<ButtonProps>(() => ({
color: 'white',
backgroundColor: '#000000',
'&:hover': {
backgroundColor: '#3a3a3a',
},
}))
import { Box, Typography } from '@mui/material'

export type RequireConferenceHallLoginProps = {
children: (userId: string) => React.ReactNode
}
export const RequireConferenceHallLogin = (props: RequireConferenceHallLoginProps) => {
const user = useConferenceHallUser()

if (user) {
return (
<>
<Typography variant="body1" sx={{ display: 'flex' }}>
<CheckCircleOutlineIcon color="success" /> You are logged in to Conference-Hall.io as{' '}
{user.displayName}
</Typography>
{props.children(user.uid)}
</>
)
}

return (
<Box display="flex" gap={2} flexWrap="wrap">
<GoogleButton
size="large"
onClick={() => {
conferenceHallLogin(ConferenceHallProviders.Google)
}}>
<GoogleIcon sx={{ marginRight: 1 }} />
Google
</GoogleButton>
<TwitterButton
size="large"
onClick={() => {
conferenceHallLogin(ConferenceHallProviders.Twitter)
}}>
<TwitterIcon sx={{ marginRight: 1 }} />
Twitter
</TwitterButton>
<GitHubButton
size="large"
onClick={() => {
conferenceHallLogin(ConferenceHallProviders.GitHub)
}}>
<GitHubIcon sx={{ marginRight: 1 }} />
GitHub
</GitHubButton>
<Box display="flex" gap={2} flexWrap="wrap" bgcolor="#FF3333" padding={2} borderRadius={2}>
<Typography fontWeight="600">
⚠️ Conference Hall integration is disabled (major revamp needed for Conference Hall v2). You can track
the status <a href="https://github.com/HugoGresse/OpenPlanner/issues/133">here</a>.
</Typography>
</Box>
)
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { ConferenceHallProposalsPicker } from './ConferenceHallProposalsPicker'
import React, { useState } from 'react'
import React from 'react'
import { ConferenceHallProposal, Format } from '../../types'
import { ConferenceHallFormatsMapping } from './ConferenceHallFormatsMapping'
import { useConferenceHallProposals } from '../hooks/useConferenceHallProposals'
import { mapConferenceHallFormatsToOpenPlanner } from '../../events/actions/conferenceHallUtils/mapFromConferenceHallToOpenPlanner'
import { Typography } from '@mui/material'

type ConferenceHallProposalsPickerConnectedProps = {
conferenceHallEventId: string
Expand All @@ -27,24 +24,12 @@ export const ConferenceHallProposalsPickerConnected = ({
onSubmit,
submitText,
}: ConferenceHallProposalsPickerConnectedProps) => {
const proposals = useConferenceHallProposals(conferenceHallEventId)
const [formats, setFormatDurations] = useState<Format[]>(mapConferenceHallFormatsToOpenPlanner(chFormats))

const submitSelectedProposalsAndFormats = (proposals: ConferenceHallProposal[]) => {
return onSubmit({
proposals,
formats: formats,
})
}

return (
<>
<ConferenceHallFormatsMapping formats={formats} setFormatDurations={setFormatDurations} />
<ConferenceHallProposalsPicker
onSubmit={submitSelectedProposalsAndFormats}
proposals={proposals}
submitText={submitText}
/>
<Typography fontWeight="600" mt={2}>
Conference Hall integration is disabled (major revamp needed for Conference Hall v2). You can track the
status here https://github.com/HugoGresse/OpenPlanner/issues/133
</Typography>
</>
)
}
2 changes: 1 addition & 1 deletion src/events/page/settings/EventSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ export const EventSettings = ({ event }: EventSettingsProps) => {
open={reImportOpen}
title="Re-import from Conference Hall?"
acceptButton="Re-import"
disabled={loading}
disabled={true}
loading={loading}
cancelButton="cancel"
handleClose={() => setReimportOpen(false)}
Expand Down

0 comments on commit 67b1cab

Please sign in to comment.