Skip to content

Commit

Permalink
fix: add hr, remove text change on community toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
ovbm committed Dec 17, 2024
1 parent b9747f2 commit 977fc77
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
20 changes: 14 additions & 6 deletions apps/www/components/Profile/EditProfile/PrivacySettings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { Label, Checkbox, A, Radio } from '@project-r/styleguide'
import {
Label,
Checkbox,
A,
Radio,
useColorContext,
} from '@project-r/styleguide'
import { css } from 'glamor'
import withT from '../../../lib/withT'
import Link from 'next/link'
Expand All @@ -15,13 +21,15 @@ const styles = {
}

const PrivacySettings = ({ user, onChange, values, errors, t }) => {
console.log(values.hasPublicProfile)
const [colorScheme] = useColorContext()

return (
<div style={{ display: 'flex', flexDirection: 'column', gap: 32 }}>
{!user.isEligibleForProfile && (
<Label>{t('profile/settings/isEligibleForProfile/notEligible')}</Label>
)}
<PublicCheckbox user={user} values={values} onChange={onChange} />
<PublicSelection user={user} values={values} onChange={onChange} />
<hr {...colorScheme.set('color', 'divider')} />
<ListedCheckbox user={user} values={values} onChange={onChange} />
</div>
)
Expand Down Expand Up @@ -55,7 +63,7 @@ export const ListedCheckbox = withT(({ user, values, onChange, t }) => (
{t('profile/settings/isListed/label')}
</Checkbox>
<Label>
{t.elements(`profile/settings/isListed/${!!values.isListed}/note`, {
{t.elements(`profile/settings/isListed/note`, {
communityLink: (
<Link key='communityLink' href='/community' passHref legacyBehavior>
<A target='_blank'>{t('profile/settings/privacy/communityLink')}</A>
Expand All @@ -66,7 +74,7 @@ export const ListedCheckbox = withT(({ user, values, onChange, t }) => (
</div>
))

export const PublicCheckbox = withT(({ user, values, onChange, t }) => (
export const PublicSelection = withT(({ user, values, onChange, t }) => (
<div style={{ display: 'flex', flexDirection: 'column', gap: 32 }}>
<div {...styles.radio}>
<Radio
Expand All @@ -79,7 +87,7 @@ export const PublicCheckbox = withT(({ user, values, onChange, t }) => (
})
}}
>
{t('profile/settings/hasPublicProfile/true/label')}
{t('profile/settings/hasPublicProfile/true/label')}
</Radio>
<Label>{t('profile/settings/hasPublicProfile/true/note')}</Label>
</div>
Expand Down
8 changes: 2 additions & 6 deletions apps/www/lib/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1378,17 +1378,13 @@
"value": "Auf Community-Seite anzeigen"
},
{
"key": "profile/settings/isListed/true/note",
"value": "Ihr Name, Ihr Profilbild und Ihr Statement erscheinen auf {communityLink} und sind für alle sichtbar."
"key": "profile/settings/isListed/note",
"value": "Ihr Name, Ihr Profilbild und Ihr Statement erscheinen auf {communityLink}."
},
{
"key": "climate/profile/settings/isListed/true/note",
"value": "Ihr Name und Ihr Profilbild erscheinen auf {communityLink} und sind für alle sichtbar."
},
{
"key": "profile/settings/isListed/false/note",
"value": "Ihr Name, Ihr Profilbild und Ihr Statement erscheinen nicht auf {communityLink}."
},
{
"key": "profile/settings/isAdminUnlisted/note",
"value": "Leider können wir Sie auf der Community-Seite nicht anzeigen. Schreiben Sie an [email protected] für weitere Informationen."
Expand Down

0 comments on commit 977fc77

Please sign in to comment.