-
+
+
);
-}
+};
-export default UserProfileLoader;
+export const MyContributionLoader = () => {
+ return (
+
+
+
+ );
+};
diff --git a/src/features/common/CopyToClipboard/index.tsx b/src/features/common/CopyToClipboard/index.tsx
index b62f844763..298fce2b16 100644
--- a/src/features/common/CopyToClipboard/index.tsx
+++ b/src/features/common/CopyToClipboard/index.tsx
@@ -14,7 +14,7 @@ const Alert = styled(MuiAlert)(({ theme }) => {
interface Props {
text: string;
- isButton: boolean;
+ isButton?: boolean;
}
export default function CopyToClipboard({
diff --git a/src/features/common/InputTypes/BootstrapInput.tsx b/src/features/common/InputTypes/BootstrapInput.tsx
index dfe787c88d..0fb85dd76b 100644
--- a/src/features/common/InputTypes/BootstrapInput.tsx
+++ b/src/features/common/InputTypes/BootstrapInput.tsx
@@ -1,9 +1,16 @@
-import { InputBase, styled } from '@mui/material';
-import tenantConfig from '../../../../tenant.config';
+import { InputBase, InputBaseProps, styled } from '@mui/material';
+import { useTenant } from '../Layout/TenantContext';
+import { Tenant } from '@planet-sdk/common/build/types/tenant';
-const config = tenantConfig();
+interface StyledInputBaseType {
+ config: Tenant;
+}
-const BootstrapInput = styled(InputBase)({
+const StyledInputBase = styled(InputBase, {
+ shouldForwardProp: (prop) => {
+ return prop !== 'config';
+ },
+})(({ config }: StyledInputBaseType) => ({
'& .MuiInputBase-input': {
borderRadius: 9,
position: 'relative',
@@ -13,12 +20,18 @@ const BootstrapInput = styled(InputBase)({
fontSize: 14,
padding: '10px 26px 10px 12px',
// Use the system font instead of the default Roboto font.
- fontFamily: [config?.font.primaryFontFamily].join(','),
+ fontFamily: [config.config.font.primaryFontFamily].join(','),
'&:focus': {
backgroundColor: 'var(--background-color)',
borderRadius: 9,
},
},
-});
+}));
+
+const BootstrapInput = (props: InputBaseProps) => {
+ const { tenantConfig } = useTenant();
+
+ return
;
+};
export default BootstrapInput;
diff --git a/src/features/common/InputTypes/MaterialTextField.tsx b/src/features/common/InputTypes/MaterialTextField.tsx
index ef0898006f..f42de52bde 100644
--- a/src/features/common/InputTypes/MaterialTextField.tsx
+++ b/src/features/common/InputTypes/MaterialTextField.tsx
@@ -1,8 +1,16 @@
-import { TextField, styled } from '@mui/material';
-import tenantConfig from '../../../../tenant.config';
-const config = tenantConfig();
+import { TextField, TextFieldProps, styled } from '@mui/material';
+import { Tenant } from '@planet-sdk/common/build/types/tenant';
+import { useTenant } from '../Layout/TenantContext';
-const MaterialTextField = styled(TextField)({
+interface StyledTextFieldType {
+ config: Tenant;
+}
+
+const StyledTextField = styled(TextField, {
+ shouldForwardProp: (prop) => {
+ return prop !== 'config';
+ },
+})(({ config }: StyledTextFieldType) => ({
width: '100%',
color: 'var(--primary-font-color)',
'& .MuiInputBase-input.MuiOutlinedInput-input': {
@@ -10,11 +18,11 @@ const MaterialTextField = styled(TextField)({
},
'& label.Mui-focused': {
color: 'var(--primary-font-color)',
- fontFamily: config.font.primaryFontFamily,
+ fontFamily: config.config.font.primaryFontFamily,
},
'& label': {
color: 'var(--primary-font-color)',
- fontFamily: config.font.primaryFontFamily,
+ fontFamily: config.config.font.primaryFontFamily,
fontSize: '14px',
top: '-3px',
},
@@ -29,7 +37,7 @@ const MaterialTextField = styled(TextField)({
color: 'var(--primary-font-color)',
border: '0px!important',
borderRadius: '10px',
- fontFamily: config.font.primaryFontFamily,
+ fontFamily: config.config.font.primaryFontFamily,
},
'& .MuiOutlinedInput-input': {
padding: '14px',
@@ -51,6 +59,12 @@ const MaterialTextField = styled(TextField)({
'& .Mui-disabled.MuiOutlinedInput-input ': {
color: 'var(--disabled-font-color)',
},
-});
+}));
+
+const MaterialTextField = (props: TextFieldProps) => {
+ const { tenantConfig } = useTenant();
+
+ return
;
+};
export default MaterialTextField;
diff --git a/src/features/common/LandingVideo/index.tsx b/src/features/common/LandingVideo/index.tsx
index a48f6e7846..9370fb6b5c 100644
--- a/src/features/common/LandingVideo/index.tsx
+++ b/src/features/common/LandingVideo/index.tsx
@@ -53,34 +53,34 @@ function VideoContainer({ setshowVideo }: Props): ReactElement {
switch (localStorage.getItem('language')) {
case 'de':
setvideoURL(
- `https://a.plant-for-the-planet.org/wp-content/videos/en-intro-mobile-planet.mp4`
+ `https://www.plant-for-the-planet.org/wp-content/videos/en-intro-mobile-planet.mp4`
);
break;
case 'en':
setvideoURL(
- `https://a.plant-for-the-planet.org/wp-content/videos/en-intro-mobile-planet.mp4`
+ `https://www.plant-for-the-planet.org/wp-content/videos/en-intro-mobile-planet.mp4`
);
break;
default:
setvideoURL(
- `https://a.plant-for-the-planet.org/wp-content/videos/en-intro-mobile-planet.mp4`
+ `https://www.plant-for-the-planet.org/wp-content/videos/en-intro-mobile-planet.mp4`
);
}
} else {
switch (localStorage.getItem('language')) {
case 'de':
setvideoURL(
- `https://a.plant-for-the-planet.org/wp-content/videos/en-intro-web-planet.mp4`
+ `https://www.plant-for-the-planet.org/wp-content/videos/en-intro-web-planet.mp4`
);
break;
case 'en':
setvideoURL(
- `https://a.plant-for-the-planet.org/wp-content/videos/en-intro-web-planet.mp4`
+ `https://www.plant-for-the-planet.org/wp-content/videos/en-intro-web-planet.mp4`
);
break;
default:
setvideoURL(
- `https://a.plant-for-the-planet.org/wp-content/videos/en-intro-web-planet.mp4`
+ `https://www.plant-for-the-planet.org/wp-content/videos/en-intro-web-planet.mp4`
);
}
}
diff --git a/src/features/common/LandingVideo/styles.module.scss b/src/features/common/LandingVideo/styles.module.scss
index 17cbab5625..1cd6c578a9 100644
--- a/src/features/common/LandingVideo/styles.module.scss
+++ b/src/features/common/LandingVideo/styles.module.scss
@@ -149,7 +149,7 @@
@include mdTabletView {
.playButton,
.embed_playButton {
- right: 125px;
+ right: 20px;
flex-direction: row;
&.playButton--reduce-right-offset {
diff --git a/src/features/common/Layout/Footer/Footer.module.scss b/src/features/common/Layout/Footer/Footer.module.scss
index 5c255d66e1..9d14bc4614 100644
--- a/src/features/common/Layout/Footer/Footer.module.scss
+++ b/src/features/common/Layout/Footer/Footer.module.scss
@@ -3,7 +3,7 @@
.footerMainContainer {
max-width: 950px;
margin: auto 20px 0px;
- background-color: $backgroundColor;
+ background-color: transparent;
}
.logo_container {
diff --git a/src/features/common/Layout/Footer/SelectLanguageAndCountry.tsx b/src/features/common/Layout/Footer/SelectLanguageAndCountry.tsx
index 69acfb67aa..422ace3453 100644
--- a/src/features/common/Layout/Footer/SelectLanguageAndCountry.tsx
+++ b/src/features/common/Layout/Footer/SelectLanguageAndCountry.tsx
@@ -5,7 +5,13 @@ import {
FormControlLabel,
RadioGroup,
} from '@mui/material';
-import React, { ChangeEvent, useContext, useEffect, useState } from 'react';
+import React, {
+ ChangeEvent,
+ useContext,
+ useEffect,
+ useMemo,
+ useState,
+} from 'react';
import {
getCountryDataBy,
sortCountriesByTranslation,
@@ -16,7 +22,7 @@ import { ThemeContext } from '../../../../theme/themeContext';
import GreenRadio from '../../InputTypes/GreenRadio';
import styles from './SelectLanguageAndCountry.module.scss';
import { useTranslation } from 'next-i18next';
-import tenantConfig from '../../../../../tenant.config';
+import { useTenant } from '../TenantContext';
interface MapCountryProps {
value: string;
@@ -44,16 +50,22 @@ interface countryInterface {
languageCode: string;
}
-const config = tenantConfig();
-
-// reduce the allowed languages to the languages listed in the tenants config file
-const selectableLanguages = supportedLanguages.filter((lang) =>
- config.languages.includes(lang.langCode)
-);
-
// Maps the radio buttons for language
function MapLanguage({ value, handleChange }: MapLanguageProps) {
+ const { tenantConfig } = useTenant();
+
+ // reduce the allowed languages to the languages listed in the tenants config file
+ const selectableLanguages = useMemo(
+ () =>
+ supportedLanguages.filter((lang) =>
+ Object.values(tenantConfig.config.languages ?? { 0: 'en' }).includes(
+ lang.langCode
+ )
+ ),
+ [supportedLanguages, tenantConfig.config.languages]
+ );
+
return (