@@ -47,28 +47,26 @@ export function UploadPackageForm(props: UploadPackageFormProps) {
47
47
successMessage : "Package submitted" ,
48
48
} ) ;
49
49
50
- // Parse categories to the right format for form
51
- function communityCategoriesParse (
50
+ // Parse communities to the right format for form
51
+ function communitiesParse (
52
52
selected : {
53
53
label : string ;
54
54
value : string ;
55
- } [ ] ,
56
- onChange : ( selected : { [ key : string ] : string [ ] } ) => void
55
+ } [ ]
57
56
) {
58
- const communityCategories : { [ key : string ] : string [ ] } = { } ;
59
- selected . map ( ( x ) => ( communityCategories [ x . value ] = [ x . value ] ) ) ;
60
- onChange ( communityCategories ) ;
57
+ return selected . map ( ( x ) => x . value ) ;
61
58
}
62
59
63
- // Parse communities to the right format for form
64
- function communitiesParse (
60
+ // Parse categories to the right format for form
61
+ function communityCategoriesParse (
65
62
selected : {
66
63
label : string ;
67
64
value : string ;
68
- } [ ] ,
69
- onChange : ( selected : string [ ] ) => void
65
+ } [ ]
70
66
) {
71
- onChange ( selected . map ( ( x ) => x . value ) ) ;
67
+ const communityCategories : { [ key : string ] : string [ ] } = { } ;
68
+ selected . map ( ( x ) => ( communityCategories [ x . value ] = [ x . value ] ) ) ;
69
+ return communityCategories ;
72
70
}
73
71
74
72
return (
@@ -87,41 +85,41 @@ export function UploadPackageForm(props: UploadPackageFormProps) {
87
85
< div className = { styles . line } />
88
86
< SettingItem
89
87
title = "Team"
90
- description = "No teams available?"
91
- additionalLeftColumnContent = {
92
- < Dialog . Root
93
- title = "Create Team"
94
- trigger = {
95
- < Button . Root colorScheme = "primary" paddingSize = "large" >
96
- < Button . ButtonLabel > Create team</ Button . ButtonLabel >
97
- < Button . ButtonIcon >
98
- < FontAwesomeIcon icon = { faPlus } />
99
- </ Button . ButtonIcon >
100
- </ Button . Root >
101
- }
102
- >
103
- < CreateTeamForm />
104
- </ Dialog . Root >
105
- }
88
+ description = "Select the team you want your package to be associated with."
106
89
content = {
107
- < FormSelectSearch
108
- name = "team"
109
- schema = { uploadPackageFormSchema }
110
- options = { props . teams . map ( ( t ) => t . name ) }
111
- placeholder = "Choose a team..."
112
- />
90
+ < div className = { styles . teamContentWrapper } >
91
+ < FormSelectSearch
92
+ name = "team"
93
+ schema = { uploadPackageFormSchema }
94
+ options = { props . teams . map ( ( t ) => t . name ) }
95
+ placeholder = "Choose a team..."
96
+ />
97
+ < div className = { styles . createTeamSentence } >
98
+ < span > No teams available?</ span >
99
+ < Dialog . Root
100
+ title = "Create Team"
101
+ trigger = {
102
+ < button className = { styles . createTeamModalLink } >
103
+ Create Team
104
+ </ button >
105
+ }
106
+ >
107
+ < CreateTeamForm />
108
+ </ Dialog . Root >
109
+ </ div >
110
+ </ div >
113
111
}
114
112
/>
115
113
< SettingItem
116
114
title = "Communities"
117
- description = "Select communities you want your package to be listed under. Current community is selected by default. "
115
+ description = "Select communities you want your package to be listed under."
118
116
content = {
119
117
< FormMultiSelectSearch
120
118
name = "communities"
121
119
schema = { uploadPackageFormSchema }
122
120
options = { options }
123
121
placeholder = "Choose community..."
124
- onChangeParse = { communitiesParse }
122
+ fieldFormFormatParser = { communitiesParse }
125
123
/>
126
124
}
127
125
/>
@@ -134,7 +132,7 @@ export function UploadPackageForm(props: UploadPackageFormProps) {
134
132
schema = { uploadPackageFormSchema }
135
133
options = { options }
136
134
placeholder = "Choose categories..."
137
- onChangeParse = { communityCategoriesParse }
135
+ fieldFormFormatParser = { communityCategoriesParse }
138
136
/>
139
137
}
140
138
/>
0 commit comments