= ({ isLoading, handleSubmit }) => {
-
+
-
+
+
+
);
};
diff --git a/app/soapbox/features/landing_page/index.tsx b/app/soapbox/features/landing_page/index.tsx
index dcb9afd36..1e3b01f80 100644
--- a/app/soapbox/features/landing_page/index.tsx
+++ b/app/soapbox/features/landing_page/index.tsx
@@ -1,12 +1,15 @@
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
+import { prepareRequest } from 'soapbox/actions/consumer-auth';
import { Button, Card, CardBody, Stack, Text } from 'soapbox/components/ui';
import VerificationBadge from 'soapbox/components/verification_badge';
import RegistrationForm from 'soapbox/features/auth_login/components/registration_form';
-import { useAppSelector, useFeatures, useSoapboxConfig } from 'soapbox/hooks';
+import { useAppDispatch, useAppSelector, useFeatures, useSoapboxConfig } from 'soapbox/hooks';
+import { capitalize } from 'soapbox/utils/strings';
const LandingPage = () => {
+ const dispatch = useAppDispatch();
const features = useFeatures();
const soapboxConfig = useSoapboxConfig();
const pepeEnabled = soapboxConfig.getIn(['extensions', 'pepe', 'enabled']) === true;
@@ -40,6 +43,29 @@ const LandingPage = () => {
return ;
};
+ /** Display login button for external provider. */
+ const renderProvider = () => {
+ const { authProvider } = soapboxConfig;
+
+ return (
+
+
+
+
+
+
+
+
+
+ );
+ };
+
/** Pepe API registrations are open */
const renderPepe = () => {
return (
@@ -47,18 +73,26 @@ const LandingPage = () => {
- Let's get started!
- Social Media Without Discrimination
+
+
+
+
+
+
-
+
);
};
// Render registration flow depending on features
const renderBody = () => {
- if (pepeEnabled && pepeOpen) {
+ if (soapboxConfig.authProvider) {
+ return renderProvider();
+ } else if (pepeEnabled && pepeOpen) {
return renderPepe();
} else if (features.accountCreation && instance.registrations) {
return renderOpen();
diff --git a/app/soapbox/normalizers/soapbox/soapbox_config.ts b/app/soapbox/normalizers/soapbox/soapbox_config.ts
index 6e9a2c745..a471401c5 100644
--- a/app/soapbox/normalizers/soapbox/soapbox_config.ts
+++ b/app/soapbox/normalizers/soapbox/soapbox_config.ts
@@ -71,6 +71,7 @@ export const CryptoAddressRecord = ImmutableRecord({
export const SoapboxConfigRecord = ImmutableRecord({
ads: ImmutableList(),
appleAppId: null,
+ authProvider: '',
logo: '',
logoDarkMode: null,
banner: '',
diff --git a/app/soapbox/utils/strings.ts b/app/soapbox/utils/strings.ts
new file mode 100644
index 000000000..c1c8e08bc
--- /dev/null
+++ b/app/soapbox/utils/strings.ts
@@ -0,0 +1,7 @@
+/** Capitalize the first letter of a string. */
+// https://stackoverflow.com/a/1026087
+function capitalize(str: string) {
+ return str.charAt(0).toUpperCase() + str.slice(1);
+}
+
+export { capitalize };