Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable conference hall integration #143

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading