@@ -11,6 +11,7 @@ import {
11
11
Skeleton as ChakraSkeleton ,
12
12
SkeletonCircle as ChakraSkeletonCircle ,
13
13
UnorderedList ,
14
+ useBreakpointValue ,
14
15
VStack ,
15
16
} from "@chakra-ui/react"
16
17
@@ -87,6 +88,8 @@ const FileContributors = ({
87
88
const [ isModalOpen , setModalOpen ] = useState ( false )
88
89
const { locale } = useRouter ( )
89
90
91
+ const isDesktop = useBreakpointValue ( { base : false , md : true } )
92
+
90
93
if ( error ) return null
91
94
const lastContributor : Author = contributors . length
92
95
? contributors [ 0 ]
@@ -133,49 +136,52 @@ const FileContributors = ({
133
136
{ ...props }
134
137
>
135
138
< Flex me = { 4 } alignItems = "center" flex = "1" >
136
- < SkeletonCircle size = "10" me = { 4 } isLoaded = { ! loading } >
137
- < Avatar
138
- height = "40px"
139
- width = "40px"
140
- src = { lastContributor . avatarUrl }
141
- name = { lastContributor . name }
142
- me = { 2 }
143
- />
144
- </ SkeletonCircle >
145
-
146
- < Skeleton isLoaded = { ! loading } >
147
- < Text m = { 0 } color = "text200" >
148
- < Translation id = "last-edit" /> :{ " " }
149
- { lastContributor . user ?. url && (
150
- < InlineLink href = { lastContributor . user . url } >
151
- @{ lastContributor . user . login }
152
- </ InlineLink >
153
- ) }
154
- { ! lastContributor . user && < span > { lastContributor . name } </ span > } ,{ " " }
155
- { getLocaleTimestamp ( locale as Lang , lastEdit ) }
156
- </ Text >
157
- </ Skeleton >
139
+ { isDesktop && (
140
+ < >
141
+ < SkeletonCircle size = "10" me = { 4 } isLoaded = { ! loading } >
142
+ < Avatar
143
+ height = "40px"
144
+ width = "40px"
145
+ src = { lastContributor . avatarUrl }
146
+ name = { lastContributor . name }
147
+ me = { 2 }
148
+ />
149
+ </ SkeletonCircle >
150
+
151
+ < Skeleton isLoaded = { ! loading } >
152
+ < Text m = { 0 } color = "text200" >
153
+ < Translation id = "last-edit" /> :{ " " }
154
+ { lastContributor . user ?. url && (
155
+ < InlineLink href = { lastContributor . user . url } >
156
+ @{ lastContributor . user . login }
157
+ </ InlineLink >
158
+ ) }
159
+ { ! lastContributor . user && < span > { lastContributor . name } </ span > }
160
+ , { getLocaleTimestamp ( locale as Lang , lastEdit ) }
161
+ </ Text >
162
+ </ Skeleton >
163
+ </ >
164
+ ) }
158
165
</ Flex >
159
166
160
167
< VStack align = "stretch" justifyContent = "space-between" spacing = { 2 } >
161
- < Skeleton isLoaded = { ! loading } mt = { { base : 4 , md : 0 } } >
162
- < Button
163
- variant = "outline"
164
- bg = "background.base"
165
- border = { 0 }
166
- onClick = { ( ) => {
167
- setModalOpen ( true )
168
- trackCustomEvent ( {
169
- eventCategory : "see contributors" ,
170
- eventAction : "click" ,
171
- eventName : "click" ,
172
- } )
173
- } }
174
- w = { { base : "full" , md : "inherit" } }
175
- >
176
- < Translation id = "see-contributors" />
177
- </ Button >
178
- </ Skeleton >
168
+ < Button
169
+ variant = "outline"
170
+ bg = "background.base"
171
+ border = { 0 }
172
+ mb = { { base : 4 , md : 0 } }
173
+ onClick = { ( ) => {
174
+ setModalOpen ( true )
175
+ trackCustomEvent ( {
176
+ eventCategory : "see contributors" ,
177
+ eventAction : "click" ,
178
+ eventName : "click" ,
179
+ } )
180
+ } }
181
+ w = { { base : "full" , md : "inherit" } }
182
+ >
183
+ < Translation id = "see-contributors" />
184
+ </ Button >
179
185
</ VStack >
180
186
</ Flex >
181
187
</ >
0 commit comments