@@ -8,14 +8,14 @@ import {
88 Text ,
99 Textarea ,
1010} from '@codesandbox/components' ;
11- import { createGlobalStyle } from 'styled-components' ;
1211import css from '@styled-system/css' ;
1312import { CommentFragment } from 'app/graphql/types' ;
1413import { useOvermind } from 'app/overmind' ;
1514import { OPTIMISTIC_COMMENT_ID } from 'app/overmind/namespaces/comments/state' ;
1615import { motion , useAnimation } from 'framer-motion' ;
1716import React , { useState } from 'react' ;
1817import ReactDOM from 'react-dom' ;
18+ import { createGlobalStyle } from 'styled-components' ;
1919
2020import { AvatarBlock } from '../components/AvatarBlock' ;
2121import { EditComment } from '../components/EditComment' ;
@@ -252,48 +252,63 @@ const DialogHeader = ({ comment, hasShadow }) => {
252252 const closeDialog = ( ) => actions . comments . closeComment ( ) ;
253253
254254 return (
255- < Stack
256- align = "center"
257- justify = "space-between"
258- padding = { 4 }
259- paddingRight = { 2 }
260- marginBottom = { 2 }
261- css = { css ( {
262- boxShadow : theme =>
263- hasShadow
264- ? `0px 32px 32px ${ theme . colors . dialog . background } `
265- : 'none' ,
266- } ) }
267- >
268- < Text size = { 3 } weight = "bold" >
269- Comment
270- </ Text >
271- < Stack align = "center" >
272- < IconButton
273- onClick = { ( ) =>
274- actions . comments . resolveComment ( {
275- commentId : comment . id ,
276- isResolved : ! comment . isResolved ,
277- } )
278- }
279- name = "check"
280- size = { 14 }
281- title = "Resolve Comment"
282- css = { css ( {
283- transition : 'color' ,
284- transitionDuration : theme => theme . speeds [ 1 ] ,
285- color : comment . isResolved ? 'green' : 'mutedForeground' ,
286- ':hover:not(:disabled), :focus:not(:disabled)' : {
287- color : comment . isResolved ? 'green' : 'foreground' ,
288- } ,
289- } ) }
290- />
291- < IconButton
292- name = "cross"
293- size = { 10 }
294- title = "Close comment dialog"
295- onClick = { closeDialog }
296- />
255+ < Stack direction = "vertical" css = { { position : 'relative' } } >
256+ < div
257+ css = { css ( {
258+ position : 'absolute' ,
259+ height : '6px' ,
260+ width : '100%' ,
261+ backgroundColor : 'dialog.background' ,
262+ bottom : '6px' ,
263+ zIndex : 0 ,
264+ opacity : hasShadow ? 1 : 0 ,
265+ transition : hasShadow
266+ ? 'opacity 0.2s ease-in'
267+ : 'opacity 0.15s ease-out' ,
268+ boxShadow : theme => `0px 0px 32px black` ,
269+ } ) }
270+ />
271+ < Stack
272+ align = "center"
273+ css = { css ( {
274+ backgroundColor : 'dialog.background' ,
275+ zIndex : 1 ,
276+ } ) }
277+ justify = "space-between"
278+ padding = { 4 }
279+ paddingRight = { 2 }
280+ paddingBottom = { 2 }
281+ >
282+ < Text size = { 3 } weight = "bold" >
283+ Comment
284+ </ Text >
285+ < Stack align = "center" >
286+ < IconButton
287+ onClick = { ( ) =>
288+ actions . comments . resolveComment ( {
289+ commentId : comment . id ,
290+ isResolved : ! comment . isResolved ,
291+ } )
292+ }
293+ name = "check"
294+ size = { 14 }
295+ title = "Resolve Comment"
296+ css = { css ( {
297+ transition : 'color' ,
298+ transitionDuration : theme => theme . speeds [ 1 ] ,
299+ color : comment . isResolved ? 'green' : 'mutedForeground' ,
300+ ':hover:not(:disabled), :focus:not(:disabled)' : {
301+ color : comment . isResolved ? 'green' : 'foreground' ,
302+ } ,
303+ } ) }
304+ />
305+ < IconButton
306+ name = "cross"
307+ size = { 10 }
308+ title = "Close comment dialog"
309+ onClick = { closeDialog }
310+ />
311+ </ Stack >
297312 </ Stack >
298313 </ Stack >
299314 ) ;
0 commit comments