-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03a28ed
commit e09fafe
Showing
3 changed files
with
13 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} /> | ||
</GoogleButton> | ||
<TwitterButton | ||
size="large" | ||
onClick={() => { | ||
conferenceHallLogin(ConferenceHallProviders.Twitter) | ||
}}> | ||
<TwitterIcon sx={{ marginRight: 1 }} /> | ||
</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> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters