Skip to content

Commit 3fc2b36

Browse files
authored
Merge pull request #1016 from cultuurnet/feature/III-6594
III-6594-Disable Cultuurkuur toggle for existing Cultuurkuur events
2 parents d56f21a + 2e586c8 commit 3fc2b36

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/pages/steps/ScopeStep.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { OfferType, OfferTypes } from '@/constants/OfferType';
99
import { useChangeAudienceMutation } from '@/hooks/api/events';
1010
import { FeatureFlags, useFeatureFlag } from '@/hooks/useFeatureFlag';
1111
import { Alert, AlertVariants } from '@/ui/Alert';
12-
import { parseSpacing } from '@/ui/Box';
12+
import { Box, parseSpacing } from '@/ui/Box';
1313
import { CustomIcon, CustomIconVariants } from '@/ui/CustomIcon';
1414
import { FormElement } from '@/ui/FormElement';
1515
import { getInlineProps, Inline, InlineProps } from '@/ui/Inline';
@@ -133,10 +133,10 @@ const ScopeStep = ({
133133
<FormElement
134134
id={field.name}
135135
label={
136-
<>
136+
<Box opacity={offerId && isCultuurkuurEvent ? 0.7 : 1.0}>
137137
{t('steps.offerTypeStep.cultuurkuur_event')}
138138
<CultuurKuurIcon marginLeft={2} />
139-
</>
139+
</Box>
140140
}
141141
labelVariant={LabelVariants.NORMAL}
142142
labelPosition={LabelPositions.RIGHT}
@@ -145,6 +145,7 @@ const ScopeStep = ({
145145
type={RadioButtonTypes.SWITCH}
146146
checked={isCultuurkuurEvent}
147147
color={colors.udbMainPositiveGreen}
148+
disabled={offerId && isCultuurkuurEvent}
148149
onChange={(e) => {
149150
handleOnChangeAudience(
150151
e.target.checked

src/ui/RadioButton.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ const RadioButton = forwardRef<HTMLInputElement, Props>(
109109
border-color: ${color};
110110
}
111111
112+
.custom-control-input:disabled ~ .custom-control-label::before {
113+
filter: opacity(50%) grayscale(25%);
114+
cursor: not-allowed;
115+
}
116+
112117
.custom-control-label::after {
113118
font-size: 1em;
114119
padding: 0;

0 commit comments

Comments
 (0)