-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WebApp] Add notifications preference block to the profile page, UI part #1117
base: master
Are you sure you want to change the base?
Conversation
fa825c8
to
b2f57db
Compare
b2f57db
to
551dfd5
Compare
const opacity = state.isDisabled ? 0.5 : 1 | ||
const transition = 'opacity 300ms' | ||
const colorValue = type === 'dark' ? '#DBF1C1' : '#0A2133' | ||
|
||
return { ...provided, opacity, transition, color: colorValue } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const opacity = state.isDisabled ? 0.5 : 1 | |
const transition = 'opacity 300ms' | |
const colorValue = type === 'dark' ? '#DBF1C1' : '#0A2133' | |
return { ...provided, opacity, transition, color: colorValue } | |
return { | |
...provided, | |
opacity: state.isDisabled ? 0.5 : 1, | |
transition: 'opacity 300ms', | |
color: type === 'dark' ? '#DBF1C1' : '#0A2133', | |
} |
})} | ||
options={options} | ||
onChange={onChange} | ||
defaultValue={options && options[0]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaultValue={options && options[0]} | |
defaultValue={options?.[0]} |
defaultValue={options && options[0]} | ||
styles={customStyles} | ||
theme={(selectTheme) => ({ | ||
// TODO: Get the theme data using react-jss |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you, please, explain this comment?
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) => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use CSS.Properties
for autocomplete
const styles: (theme: SaladTheme) => Record<string, CSS.Properties> = (theme: SaladTheme) => ({
<div className={classes.notificationPreference}> | ||
<div className={classes.fieldContainer}> | ||
<div className={classes.notificationPrefenceLabel}> | ||
<Text variant="baseS">Account Activity Notifications</Text> | ||
</div> | ||
<Dropdown type="light" options={accountNotificationPreferenceDropdownOptions} /> | ||
</div> | ||
<div className={classes.textContainer}> | ||
<Text variant="baseS"> | ||
Notifications related to your usage and progress within Salad. e.g.: Achievements, Progress towards | ||
your Target Reward, etc. | ||
</Text> | ||
</div> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component JSX part is pretty large: what do you think about moving this repetitive code to a separate component <NotificationPreference/>
NOTE: UI part without connection
https://www.notion.so/saladtech/Frontend-Webapp-Notification-Controls-c9f82541d2964290b2f352d9b6af569a