File tree Expand file tree Collapse file tree 4 files changed +22
-10
lines changed
packages/web/src/components/edit/fields Expand file tree Collapse file tree 4 files changed +22
-10
lines changed Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ export const PriceAndAudienceField = (props: PriceAndAudienceFieldProps) => {
273
273
}
274
274
set ( initialValues , STREAM_AVAILABILITY_TYPE , availabilityType )
275
275
set ( initialValues , FIELD_VISIBILITY , fieldVisibility )
276
- set ( initialValues , PREVIEW , preview )
276
+ set ( initialValues , PREVIEW , preview ?? 0 )
277
277
set (
278
278
initialValues ,
279
279
SPECIAL_ACCESS_TYPE ,
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ import Tooltip from 'components/tooltip/Tooltip'
13
13
import {
14
14
AccessAndSaleFormValues ,
15
15
DOWNLOAD_CONDITIONS ,
16
+ GateKeeper ,
17
+ LAST_GATE_KEEPER ,
16
18
STREAM_CONDITIONS ,
17
19
SpecialAccessType
18
20
} from '../types'
@@ -41,13 +43,16 @@ export const SpecialAccessFields = (props: TrackAvailabilityFieldsProps) => {
41
43
const [ specialAccessTypeField ] = useField ( {
42
44
name : SPECIAL_ACCESS_TYPE
43
45
} )
46
+ const [ { value : downloadConditions } ] =
47
+ useField < Nullable < AccessConditions > > ( DOWNLOAD_CONDITIONS )
48
+ const [ { value : lastGateKeeper } ] = useField < GateKeeper > ( LAST_GATE_KEEPER )
49
+ const showPremiumDownloadsMessage =
50
+ downloadConditions && lastGateKeeper . access === 'stemsAndDownloads'
44
51
45
52
const [ , , { setValue : setStreamConditionsValue } ] =
46
53
useField < AccessAndSaleFormValues [ typeof STREAM_CONDITIONS ] > (
47
54
STREAM_CONDITIONS
48
55
)
49
- const [ { value : downloadConditions } ] =
50
- useField < Nullable < AccessConditions > > ( DOWNLOAD_CONDITIONS )
51
56
52
57
const handleChange = useCallback (
53
58
( e : ChangeEvent < HTMLInputElement > ) => {
@@ -102,7 +107,7 @@ export const SpecialAccessFields = (props: TrackAvailabilityFieldsProps) => {
102
107
</ Tooltip >
103
108
</ label >
104
109
</ RadioGroup >
105
- { downloadConditions ? (
110
+ { showPremiumDownloadsMessage ? (
106
111
< Hint icon = { IconInfo } > { messages . premiumDownloads } </ Hint >
107
112
) : null }
108
113
</ >
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ import LoadingSpinner from 'components/loading-spinner/LoadingSpinner'
19
19
import {
20
20
AccessAndSaleFormValues ,
21
21
DOWNLOAD_CONDITIONS ,
22
+ GateKeeper ,
23
+ LAST_GATE_KEEPER ,
22
24
STREAM_AVAILABILITY_TYPE ,
23
25
STREAM_CONDITIONS
24
26
} from '../../types'
@@ -53,6 +55,9 @@ export const CollectibleGatedFields = (props: CollectibleGatedFieldsProps) => {
53
55
)
54
56
const [ { value : downloadConditions } ] =
55
57
useField < Nullable < AccessConditions > > ( DOWNLOAD_CONDITIONS )
58
+ const [ { value : lastGateKeeper } ] = useField < GateKeeper > ( LAST_GATE_KEEPER )
59
+ const showPremiumDownloadsMessage =
60
+ downloadConditions && lastGateKeeper . access === 'stemsAndDownloads'
56
61
57
62
const { ethCollectionMap, solCollectionMap, isLoading } = useSelector (
58
63
getSupportedUserCollections
@@ -172,7 +177,7 @@ export const CollectibleGatedFields = (props: CollectibleGatedFieldsProps) => {
172
177
dropdownInputStyle = { styles . dropdownInput }
173
178
disabled = { disabled }
174
179
/>
175
- { downloadConditions ? (
180
+ { showPremiumDownloadsMessage ? (
176
181
< Box mt = 'l' >
177
182
< Hint icon = { IconInfo } > { messages . premiumDownloads } </ Hint >
178
183
</ Box >
Original file line number Diff line number Diff line change @@ -26,7 +26,9 @@ import {
26
26
DOWNLOAD_CONDITIONS ,
27
27
PREVIEW ,
28
28
PRICE ,
29
- ALBUM_TRACK_PRICE
29
+ ALBUM_TRACK_PRICE ,
30
+ GateKeeper ,
31
+ LAST_GATE_KEEPER
30
32
} from '../../types'
31
33
32
34
const messagesV1 = {
@@ -114,6 +116,9 @@ export const UsdcPurchaseFields = (props: TrackAvailabilityFieldsProps) => {
114
116
const { disabled, isAlbum, isUpload } = props
115
117
const [ { value : downloadConditions } ] =
116
118
useField < Nullable < AccessConditions > > ( DOWNLOAD_CONDITIONS )
119
+ const [ { value : lastGateKeeper } ] = useField < GateKeeper > ( LAST_GATE_KEEPER )
120
+ const showPremiumDownloadsMessage =
121
+ downloadConditions && lastGateKeeper . access === 'stemsAndDownloads'
117
122
118
123
const messages = useMessages (
119
124
messagesV1 ,
@@ -140,9 +145,6 @@ export const UsdcPurchaseFields = (props: TrackAvailabilityFieldsProps) => {
140
145
/>
141
146
) }
142
147
< input type = 'hidden' name = { PREVIEW } value = '0' />
143
- { downloadConditions && ! isAlbum ? (
144
- < Hint icon = { IconInfo } > { messages . premiumDownloads } </ Hint >
145
- ) : null }
146
148
</ >
147
149
) : (
148
150
< >
@@ -153,7 +155,7 @@ export const UsdcPurchaseFields = (props: TrackAvailabilityFieldsProps) => {
153
155
prefillValue = { 100 }
154
156
/>
155
157
< PreviewField disabled = { disabled } />
156
- { downloadConditions ? (
158
+ { showPremiumDownloadsMessage ? (
157
159
< Hint icon = { IconInfo } > { messages . premiumDownloads } </ Hint >
158
160
) : null }
159
161
</ >
You can’t perform that action at this time.
0 commit comments