@@ -24,7 +24,9 @@ const TitleWrapper = styled.div`
2424const Row = styled . div `
2525 display: flex;
2626 align-items: center;
27- margin: 16px 0;
27+ margin: 16px 0 0;
28+ padding-bottom: 15px;
29+ border-bottom: 1px solid var(--vscode-list-inactiveSelectionBackground);
2830` ;
2931const Desc = styled . article `
3032 border: 1px solid gray;
@@ -40,6 +42,15 @@ const Sidebar = styled.div`
4042 width: 200px;
4143 margin-left: 20px;
4244` ;
45+ const EditBtn = styled . span `
46+ width: 16px;
47+ height: 16px;
48+ margin-left: 10px;
49+ cursor: pointer;
50+ ` ;
51+ const Empty = styled . div `
52+ text-align: center;
53+ ` ;
4354
4455function App ( ) {
4556 const { currentMR, updateMRTitle } = appStore ;
@@ -56,9 +67,10 @@ function App() {
5667 const { repoInfo, data } = currentMR ;
5768 const { merge_request : mergeRequest } = data ;
5869
59- const handleKeyDown = ( event : any ) => {
70+ const handleKeyDown = async ( event : any ) => {
6071 if ( event . key === 'Enter' ) {
61- updateMRTitle ( title ) ;
72+ await updateMRTitle ( title ) ;
73+ setEditing ( false ) ;
6274 }
6375 } ;
6476
@@ -97,9 +109,11 @@ function App() {
97109 #{ currentMR . iid }
98110 </ a >
99111 )
100- < span className = 'edit' onClick = { handleEdit } >
101- 编辑
102- </ span >
112+ < EditBtn
113+ className = 'edit'
114+ onClick = { handleEdit }
115+ dangerouslySetInnerHTML = { { __html : require ( './assets/edit.svg' ) } }
116+ />
103117 </ >
104118 ) }
105119 </ TitleWrapper >
@@ -109,10 +123,15 @@ function App() {
109123 </ Row >
110124 < BodyWrap >
111125 < Body >
112- < h3 > Description: </ h3 >
126+ < h3 > Description</ h3 >
113127 < Desc >
114- < div dangerouslySetInnerHTML = { { __html : mergeRequest ?. body } } />
128+ { mergeRequest ?. body ? (
129+ < div dangerouslySetInnerHTML = { { __html : mergeRequest ?. body } } />
130+ ) : (
131+ < Empty > Empty</ Empty >
132+ ) }
115133 </ Desc >
134+ < h3 > Activities</ h3 >
116135 < Activities />
117136 </ Body >
118137 < Sidebar >
0 commit comments