@@ -35,6 +35,8 @@ export const VIEWABLE_FILE_EXT: Readonly<string[]> = [
3535 "jpeg" ,
3636] as const ;
3737
38+ const DIMMED_STYLE = { color : COLORS . FILE_DIMMED } as const ;
39+
3840interface Props {
3941 isdir : boolean ;
4042 name : string ;
@@ -57,6 +59,7 @@ interface Props {
5759 computeServerId ?: number ;
5860 isStarred ?: boolean ;
5961 onToggleStar ?: ( path : string , starred : boolean ) => void ;
62+ dimFileExtensions ?: boolean ;
6063}
6164
6265export const FileRow : React . FC < Props > = React . memo ( ( props ) => {
@@ -68,7 +71,7 @@ export const FileRow: React.FC<Props> = React.memo((props) => {
6871
6972 function render_icon ( ) {
7073 const style : React . CSSProperties = {
71- color : props . mask ? "#bbbbbb" : COLORS . FILE_ICON ,
74+ color : props . mask ? COLORS . FILE_DIMMED : COLORS . FILE_ICON ,
7275 verticalAlign : "sub" ,
7376 } as const ;
7477 let body : React . JSX . Element ;
@@ -117,12 +120,11 @@ export const FileRow: React.FC<Props> = React.memo((props) => {
117120 }
118121
119122 function render_name_link ( styles , name , ext ) {
123+ const extStyle = props . dimFileExtensions ? DIMMED_STYLE : undefined ;
120124 return (
121125 < a style = { styles } cocalc-test = "file-line" >
122126 { misc . trunc_middle ( name , 50 ) }
123- < span style = { { color : ! props . mask ? COLORS . GRAY_M : undefined } } >
124- { ext === "" ? "" : `.${ ext } ` }
125- </ span >
127+ < span style = { extStyle } > { ext === "" ? "" : `.${ ext } ` } </ span >
126128 { render_link_target ( ) }
127129 </ a >
128130 ) ;
@@ -147,7 +149,7 @@ export const FileRow: React.FC<Props> = React.memo((props) => {
147149 wordWrap : "break-word" ,
148150 overflowWrap : "break-word" ,
149151 verticalAlign : "middle" ,
150- color : props . mask ? "#bbbbbb" : COLORS . TAB ,
152+ color : props . mask ? COLORS . FILE_DIMMED : COLORS . TAB ,
151153 } ;
152154
153155 if ( show_tip ) {
0 commit comments