🔧(homepage) let people use a simple login button instead of proconnect
This is done to have people self-hosting meet be able to show a simple "login" button instead of having the ProConnect branding
This commit is contained in:
committed by
aleb_the_flash
parent
15330ad4e1
commit
bbd700270f
@@ -327,6 +327,9 @@ class Base(Configuration):
|
||||
"use_french_gov_footer": values.BooleanValue(
|
||||
False, environ_name="FRONTEND_USE_FRENCH_GOV_FOOTER", environ_prefix=None
|
||||
),
|
||||
"use_proconnect_button": values.BooleanValue(
|
||||
False, environ_name="FRONTEND_USE_PROCONNECT_BUTTON", environ_prefix=None
|
||||
),
|
||||
}
|
||||
|
||||
# Mail
|
||||
|
||||
@@ -18,6 +18,7 @@ export interface ApiConfig {
|
||||
is_silent_login_enabled?: boolean
|
||||
custom_css_url?: string
|
||||
use_french_gov_footer?: boolean
|
||||
use_proconnect_button?: boolean
|
||||
recording?: {
|
||||
is_enabled?: boolean
|
||||
available_modes?: RecordingMode[]
|
||||
|
||||
12
src/frontend/src/components/LoginButton.tsx
Normal file
12
src/frontend/src/components/LoginButton.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import { LinkButton } from '@/primitives'
|
||||
import { authUrl } from '@/features/auth'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
export const LoginButton = () => {
|
||||
const { t } = useTranslation('global', { keyPrefix: 'login' })
|
||||
return (
|
||||
<LinkButton href={authUrl()} data-attr="login" variant="primary">
|
||||
{t('buttonLabel')}
|
||||
</LinkButton>
|
||||
)
|
||||
}
|
||||
@@ -34,7 +34,7 @@ export const ProConnectButton = ({ hint = true }: ProConnectButtonProps) => {
|
||||
<VStack alignItems="start">
|
||||
<Link
|
||||
className={proConnectButtonRecipe()}
|
||||
aria-label={t('buttonLabel')}
|
||||
aria-label={t('proconnectButtonLabel')}
|
||||
href={authUrl()}
|
||||
data-attr="login"
|
||||
/>
|
||||
|
||||
@@ -18,6 +18,8 @@ import { ReactNode, useState } from 'react'
|
||||
import { css } from '@/styled-system/css'
|
||||
import { menuRecipe } from '@/primitives/menuRecipe.ts'
|
||||
import { usePersistentUserChoices } from '@/features/rooms/livekit/hooks/usePersistentUserChoices'
|
||||
import { useConfig } from '@/api/useConfig'
|
||||
import { LoginButton } from '@/components/LoginButton'
|
||||
|
||||
const Columns = ({ children }: { children?: ReactNode }) => {
|
||||
return (
|
||||
@@ -155,6 +157,8 @@ export const Home = () => {
|
||||
const { mutateAsync: createRoom } = useCreateRoom()
|
||||
const [laterRoomId, setLaterRoomId] = useState<null | string>(null)
|
||||
|
||||
const { data } = useConfig()
|
||||
|
||||
return (
|
||||
<UserAware>
|
||||
<Screen>
|
||||
@@ -210,14 +214,19 @@ export const Home = () => {
|
||||
</MenuItem>
|
||||
</RACMenu>
|
||||
</Menu>
|
||||
) : (
|
||||
) : data?.use_proconnect_button ? (
|
||||
<ProConnectButton hint={false} />
|
||||
) : (
|
||||
<LoginButton />
|
||||
)}
|
||||
<DialogTrigger>
|
||||
<Button
|
||||
variant="secondary"
|
||||
style={{
|
||||
height: !isLoggedIn ? '56px' : undefined, // Temporary, Align with ProConnect Button fixed height
|
||||
height:
|
||||
!isLoggedIn && data?.use_proconnect_button
|
||||
? '56px'
|
||||
: undefined, // Temporary, Align with ProConnect Button fixed height
|
||||
}}
|
||||
>
|
||||
{t('joinMeeting')}
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
"loading": "Loading…",
|
||||
"loggedInUserTooltip": "Logged in as…",
|
||||
"login": {
|
||||
"buttonLabel": "Login with ProConnect",
|
||||
"proconnectButtonLabel": "Login with ProConnect",
|
||||
"buttonLabel": "Login",
|
||||
"linkLabel": "What is ProConnect? - new tab",
|
||||
"link": "What is ProConnect?"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user