Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rners01
Copy link
Contributor

@rners01 rners01 commented Jan 15, 2024

@rners01 rners01 self-assigned this Jan 15, 2024
@rners01 rners01 requested a review from a team as a code owner January 15, 2024 10:21
@rners01 rners01 force-pushed the add-notifications-preference-to-the-profile-page branch from fa825c8 to b2f57db Compare January 16, 2024 16:03
@rners01 rners01 force-pushed the add-notifications-preference-to-the-profile-page branch from b2f57db to 551dfd5 Compare January 17, 2024 07:33
Comment on lines +54 to +58
const opacity = state.isDisabled ? 0.5 : 1
const transition = 'opacity 300ms'
const colorValue = type === 'dark' ? '#DBF1C1' : '#0A2133'

return { ...provided, opacity, transition, color: colorValue }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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]}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
defaultValue={options && options[0]}
defaultValue={options?.[0]}

defaultValue={options && options[0]}
styles={customStyles}
theme={(selectTheme) => ({
// TODO: Get the theme data using react-jss
Copy link
Contributor

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) => ({
Copy link
Contributor

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) => ({ 

Comment on lines +330 to +343
<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>
Copy link
Contributor

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/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants