diff --git a/packages/web-app/src/components/Dropdown.tsx b/packages/web-app/src/components/Dropdown.tsx index f0380a30c..8e5134f75 100644 --- a/packages/web-app/src/components/Dropdown.tsx +++ b/packages/web-app/src/components/Dropdown.tsx @@ -1,5 +1,4 @@ -import type { ReactNode } from 'react' -import { Component } from 'react' +import type { FC } from 'react' import type { WithStyles } from 'react-jss' import withStyles from 'react-jss' import type { OptionsOrGroups } from 'react-select' @@ -15,46 +14,61 @@ const styles = (theme: SaladTheme) => ({ }) interface Props extends WithStyles { + color?: 'dark' | 'light' options?: OptionsOrGroups onChange?: (value?: any) => void } -const customStyles = { - singleValue: (provided: any, state: any) => { - const opacity = state.isDisabled ? 0.5 : 1 - const transition = 'opacity 300ms' - const color = '#DBF1C1' +const darkColorsTheme = { + neutral0: '#0A2133', + primary25: '#1F4F22', + primary: '#DBF1C1', + neutral20: '#DBF1C1', +} - return { ...provided, opacity, transition, color } - }, +const lightColorsTheme = { + primary: '#0A2133', + neutral20: '#0A2133', } -class _Dropdown extends Component { - public override render(): ReactNode { - const { options, onChange, classes } = this.props - - return ( - ({ + // TODO: Get the theme data using react-jss + ...selectTheme, + borderRadius: 0, + colors: { + ...selectTheme.colors, + ...(color === 'dark' ? darkColorsTheme : lightColorsTheme), + }, + })} + /> + ) } export const Dropdown = withStyles(styles)(_Dropdown) diff --git a/packages/web-app/src/modules/account-views/account-views/components/Account.tsx b/packages/web-app/src/modules/account-views/account-views/components/Account.tsx index 33d87bf80..8cae38ed7 100644 --- a/packages/web-app/src/modules/account-views/account-views/components/Account.tsx +++ b/packages/web-app/src/modules/account-views/account-views/components/Account.tsx @@ -7,12 +7,14 @@ import withStyles from 'react-jss' import type { SaladTheme } from '../../../../SaladTheme' import { DefaultTheme } from '../../../../SaladTheme' import { Head } from '../../../../components' +import { Dropdown } from '../../../../components/Dropdown' import { config } from '../../../../config' import { withLogin } from '../../../auth-views' import type { Avatar, Profile } from '../../../profile/models' import { AccountTermsAndConditionsUpdate } from './AccountTermsAndConditionsUpdate' import { GoogleSignInForm } from './GoogleSignInForm' import { PayPalLoginButton } from './PayPalLoginButton' +import { accountNotificationPreferenceDropdownOptions } from './assets/constants' const styles = (theme: SaladTheme) => ({ container: { @@ -35,7 +37,7 @@ const styles = (theme: SaladTheme) => ({ avatarContainer: { paddingTop: 66, }, - accountConnectionsContainer: { + accountSection: { paddingTop: 56, }, connectAccountDescription: { @@ -62,7 +64,7 @@ const styles = (theme: SaladTheme) => ({ paddingTop: 5, wordWrap: 'break-word', }, - minecraftConnectText: { + textContainer: { maxWidth: 400, paddingTop: 20, }, @@ -70,6 +72,18 @@ const styles = (theme: SaladTheme) => ({ paddingTop: 10, color: '#811417', }, + notificationPreferences: { + display: 'flex', + gap: '56px', + flexWrap: 'wrap', + }, + notificationPreference: { + width: 'calc(50% - 56px)', + paddingTop: 56, + }, + notificationPrefenceLabel: { + marginBottom: 3, + }, }) interface Props extends WithStyles { @@ -142,7 +156,6 @@ const _Account: FC = ({ onToggleAcceptTermsAndConditions, }) => { const [payPalLoadRetries, setPayPalLoadRetries] = useState(0) - // Hide google SSO until salad google account devops setup const hideGoogleSSO = !config.isTestEnvironment @@ -217,7 +230,7 @@ const _Account: FC = ({ /> )} -
+
Account Connections
@@ -303,7 +316,7 @@ const _Account: FC = ({ defaultValue={profile?.extensions?.minecraftUsername} />
-
+
Connect Salad to your Minecraft account. A Minecraft username is required to redeem many Minecraft rewards. @@ -311,6 +324,51 @@ const _Account: FC = ({
+
+ Notification Preferences +
+
+
+
+ Account Activity Notifications +
+ +
+
+ + Notifications related to your usage and progress within Salad. e.g.: Achievements, Progress towards + your Target Reward, etc. + +
+
+
+
+
+ Promo Notifications Enabled +
+ +
+
+ + Notifications related to store sales, new rewards and other Salad partnerships. + +
+
+
+
+
+ Community Notifications Enabled +
+ +
+
+ + Notifications related to community events, user survey opportunities, etc. + +
+
+
+
diff --git a/packages/web-app/src/modules/account-views/account-views/components/assets/constants.tsx b/packages/web-app/src/modules/account-views/account-views/components/assets/constants.tsx new file mode 100644 index 000000000..59aa0d11c --- /dev/null +++ b/packages/web-app/src/modules/account-views/account-views/components/assets/constants.tsx @@ -0,0 +1,10 @@ +export const accountNotificationPreferenceDropdownOptions = [ + { + label: 'Enabled', + value: true, + }, + { + label: 'Disabled', + value: false, + }, +]