@@ -36,6 +36,10 @@ const ProjectsListPage = () => {
3636
3737 const [ createDialogOpen , setCreateDialogOpen ] = React . useState ( false ) ;
3838 const [ newProjectName , setNewProjectName ] = React . useState < string > ( "" ) ;
39+ const [
40+ newProjectMainBranchName ,
41+ setNewProjectMainBranchName ,
42+ ] = React . useState < string > ( "" ) ;
3943
4044 useEffect ( ( ) => {
4145 getProjectList ( projectDispatch ) ;
@@ -89,6 +93,17 @@ const ProjectsListPage = () => {
8993 value = { newProjectName }
9094 onChange = { ( event ) => setNewProjectName ( event . target . value ) }
9195 />
96+ < TextField
97+ margin = "dense"
98+ id = "branchName"
99+ label = "Main branch"
100+ type = "text"
101+ fullWidth
102+ value = { newProjectMainBranchName }
103+ onChange = { ( event ) =>
104+ setNewProjectMainBranchName ( event . target . value )
105+ }
106+ />
92107 </ DialogContent >
93108 < DialogActions >
94109 < Button onClick = { handleCreateClose } color = "primary" >
@@ -98,8 +113,10 @@ const ProjectsListPage = () => {
98113 onClick = { ( ) => {
99114 createProject ( projectDispatch , {
100115 name : newProjectName ,
116+ mainBranchName : newProjectMainBranchName ,
101117 } ) . then ( ( project ) => {
102118 setNewProjectName ( "" ) ;
119+ setNewProjectMainBranchName ( "" ) ;
103120 handleCreateClose ( ) ;
104121 } ) ;
105122 } }
@@ -117,14 +134,12 @@ const ProjectsListPage = () => {
117134 < Typography > Key: { project . id } </ Typography >
118135 < Typography > Name: { project . name } </ Typography >
119136 < Typography > Main branch: { project . mainBranchName } </ Typography >
120- < Typography > Created: { formatDateTime ( project . createdAt ) } </ Typography >
137+ < Typography >
138+ Created: { formatDateTime ( project . createdAt ) }
139+ </ Typography >
121140 </ CardContent >
122141 < CardActions >
123- < Button
124- color = "primary"
125- component = { Link }
126- to = { `${ project . id } ` }
127- >
142+ < Button color = "primary" component = { Link } to = { `${ project . id } ` } >
128143 Builds
129144 </ Button >
130145 < Button
0 commit comments