File tree Expand file tree Collapse file tree 4 files changed +57
-27
lines changed Expand file tree Collapse file tree 4 files changed +57
-27
lines changed Original file line number Diff line number Diff line change 2121 border-color : $primary ;
2222}
2323
24- .preview-root {
25- border : 1px solid #eaeaea ;
26- border-radius : 2px ;
27- box-sizing : border-box ;
28- display : inline-flex ;
29- height : 150px ;
30- margin-bottom : 8px ;
31- margin-right : 8px ;
32- padding : 4px ;
33- width : 150px ;
34- }
24+ .preview {
25+ & -root {
26+ border : 1px solid #eaeaea ;
27+ border-radius : 2px ;
28+ box-sizing : border-box ;
29+ display : inline-flex ;
30+ height : 150px ;
31+ margin-bottom : 8px ;
32+ margin-right : 8px ;
33+ padding : 4px ;
34+ position : relative ;
35+ width : 150px ;
36+ }
3537
36- .preview -inner {
37- display : flex ;
38- min-width : 0px ;
39- overflow : hidden ;
40- }
38+ & -inner {
39+ display : flex ;
40+ min-width : 0px ;
41+ overflow : hidden ;
42+ }
4143
42- .preview -image {
43- display : block ;
44- height : 100% ;
45- width : auto ;
46- }
44+ & -image {
45+ display : block ;
46+ height : 100% ;
47+ width : auto ;
48+ }
4749
48- .preview-container {
49- display : flex ;
50- flex-direction : row ;
51- flex-wrap : wrap ;
52- margin-top : 16px ;
50+ & -container {
51+ display : flex ;
52+ flex-direction : row ;
53+ flex-wrap : wrap ;
54+ margin-top : 16px ;
55+ }
56+
57+ & -remove-button {
58+ background : $dark-gray-transparent ;
59+ border : 0 ;
60+ border-radius : 50% ;
61+ color : $eos-white ;
62+ font-weight : $font-weight-close ;
63+ position : absolute ;
64+ right : 4px ;
65+ top : 4px ;
66+ }
67+
68+ & -remove-button :hover {
69+ cursor : pointer ;
70+ }
5371}
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ $light-blue: $eos-cerulean-500;
44$dark-color : #1A2A3A ;
55$gray-bg : #eaeaea ;
66$light-gray : #777777 ;
7+ $dark-gray-transparent : rgba (71 , 71 , 71 , 0.808 );
78$border-gray : #EDEFF0 ;
89$light-green : #66DC71 ;
910$alert : #E6001A ;
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ $font-size-small: 12px;
1313$font-size-cookies-mobile : 13px ;
1414$font-size-heading-404 : 10em ;
1515$font-weight-404 : 600 ;
16+ $font-weight-close : 600 ;
1617$font-weight : 300 ;
1718$line-height : 1.5em ;
1819$color : #141823 ;
Original file line number Diff line number Diff line change @@ -19,8 +19,18 @@ const CommentInput = (props) => {
1919 handleSubmit : handleSubmitReply
2020 } = useForm ( )
2121
22+ const removeFile = ( name ) => {
23+ setAttachments ( attachments . filter ( ( attachment ) => attachment . name !== name ) )
24+ }
25+
2226 const mediaPreview = attachments . map ( ( file ) => (
2327 < div className = 'preview-root' key = { file . name } >
28+ < button
29+ className = 'preview-remove-button'
30+ onClick = { ( ) => removeFile ( file . name ) }
31+ >
32+ x
33+ </ button >
2434 < div className = 'preview-inner' >
2535 < img src = { file . preview } className = 'preview-image' alt = 'preview' />
2636 </ div >
@@ -67,8 +77,8 @@ const CommentInput = (props) => {
6777 </ label >
6878 </ div >
6979 </ div >
80+ { errorsReply . Comments && < FormError message = 'Reply cannot be empty' /> }
7081 < div className = 'preview-container' > { mediaPreview } </ div >
71- { errorsReply . addReply && < FormError message = 'Reply cannot be empty' /> }
7282 < Button className = 'btn btn-default' > Add Reply</ Button >
7383 </ form >
7484 )
You can’t perform that action at this time.
0 commit comments