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

fix: Donation flow more fixes #1989

Merged
merged 9 commits into from
Dec 6, 2024
Merged
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion public/locales/bg/donation-flow.json
Original file line number Diff line number Diff line change
@@ -102,7 +102,7 @@
},
"noregister": {
"label": "Продължете без регистрация ",
"description": "Продължавайки без регистрация, нямате възможност да запазите дарението в историята на профила си както и да правите месечни дарения по избрана кампания"
"description": "Продължавайки без регистрация, нямате възможност да запазите дарението в историята на профила си както и да правите месечни дарения по избрана кампания."
},
"field": {
"password": "Парола",
2 changes: 1 addition & 1 deletion public/locales/en/donation-flow.json
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@
},
"card-data": {
"name-label": "Cardholder name",
"error": {
"errors": {
"email": "Please enter your email",
"name": "Please enter your name"
}
2 changes: 1 addition & 1 deletion src/components/client/donation-flow/steps/Amount.tsx
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ export const initialAmountFormValues = {
export const amountValidation = {
amountChosen: yup.string().when('payment', {
is: 'card',
then: yup.string().required(),
then: yup.string().optional(),
}),
finalAmount: yup.number().when('payment', {
is: (payment: string | null) => ['card', null].includes(payment),
Original file line number Diff line number Diff line change
@@ -83,7 +83,6 @@ export default function InlineRegisterForm() {
try {
setLoading(true)
// Register in Keycloak

if (values.terms && values.gdpr && values.password === values.confirmPassword) {
await register(values)
} else if (!values.terms) {
@@ -143,7 +142,7 @@ export default function InlineRegisterForm() {
</Grid>
<Grid item xs={12}>
<PasswordField
name="confirmPassword"
name="registerConfirmPassword"
label="auth:account.confirm-password"
autoComplete="new-password"
/>
@@ -155,11 +154,11 @@ export default function InlineRegisterForm() {
)}
</Grid>
<Grid item xs={12}>
<AcceptTermsField name="terms" />
<AcceptTermsField name="registerTerms" />
{!formik.values.registerTerms && formik.touched.registerTerms && (
<FormHelperText sx={{ color: 'red' }}>{t('validation:terms-of-use')}</FormHelperText>
)}
<AcceptPrivacyPolicyField name="gdpr" />
<AcceptPrivacyPolicyField name="registerGdpr" />
{!formik.values.registerGdpr && formik.touched.registerGdpr && (
<FormHelperText sx={{ color: 'red' }}>
{t('validation:terms-of-service')}
Original file line number Diff line number Diff line change
@@ -35,13 +35,13 @@ export default function PaymentMethod({
{
value: 'card',
label: t('step.payment-method.field.method.card'),
icon: <CardIcon sx={{ width: 80, height: 80 }} />,
icon: <CardIcon sx={{ width: 80, height: 80, minWidth: 421 }} />,
disabled: false,
},
{
value: 'bank',
label: t('step.payment-method.field.method.bank'),
icon: <BankIcon sx={{ width: 80, height: 80 }} />,
icon: <BankIcon sx={{ width: 80, height: 80, minWidth: 421 }} />,
disabled: mode.value === 'subscription',
},
]
16 changes: 9 additions & 7 deletions src/components/common/SocialShareListButton.tsx
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import {
PopoverProps,
ButtonProps,
} from '@mui/material'
import { ContentCopy, Facebook, LinkedIn, Share, Twitter } from '@mui/icons-material'
import { ContentCopy, Facebook, LinkedIn, Share, Twitter, X } from '@mui/icons-material'

import { AlertStore } from 'stores/AlertStore'
import theme from 'common/theme'
@@ -25,8 +25,9 @@ export default function SocialShareListButton({
}) {
const { t } = useTranslation('common')
const [anchorEl, setAnchorEl] = React.useState<HTMLButtonElement | null>(null)
const serializedUrl = new URLSearchParams(url).toString()

const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
console.log(event.currentTarget)
Copy link
Contributor

Choose a reason for hiding this comment

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

probably dont need that one

setAnchorEl(event.currentTarget)
}

@@ -56,26 +57,27 @@ export default function SocialShareListButton({
<ListItemButton
onClick={() => {
navigator.clipboard.writeText(url)
console.log(url)
Copy link
Contributor

Choose a reason for hiding this comment

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

console log again - ditto

AlertStore.show('Campaign link copied to clipboard', 'success')
setAnchorEl(null)
}}>
<Typography>{t('components.social-share.copy')}</Typography>
<ContentCopy sx={{ ml: 1, fill: theme.palette.grey[400] }} />
</ListItemButton>
<ListItemButton href={`https://www.facebook.com/sharer/sharer.php?u=${serializedUrl}`}>
<ListItemButton href={`https://www.facebook.com/sharer/sharer.php?u=${url}`}>
<Typography>{t('components.social-share.share')} Facebook</Typography>
<Facebook sx={{ ml: 1, fill: '#4267B2' }} />
</ListItemButton>
<ListItemButton
href={`
http://www.linkedin.com/shareArticle?mini=true&url=${serializedUrl}
http://www.linkedin.com/shareArticle?mini=true&url=${url}
`}>
<Typography>{t('components.social-share.share')} LinkedIn</Typography>
<LinkedIn sx={{ ml: 1, fill: '#0077b5' }} />
</ListItemButton>
<ListItemButton href={`https://twitter.com/intent/tweet?url=${serializedUrl}`}>
<Typography>{t('components.social-share.share')} Twitter</Typography>
<Twitter sx={{ ml: 1, fill: '#1DA1F2' }} />
<ListItemButton href={`https://x.com/intent/post?url=${url}`}>
<Typography>{t('components.social-share.share')} X</Typography>
<X sx={{ ml: 1 }} />
</ListItemButton>
</List>
</Popover>