@@ -14,6 +14,7 @@ import { fetchLogEntryData } from 'utils/fetchLogEntryData'
1414import { ThemeToggle } from 'components/ThemeToggle'
1515import { rainbow } from 'themes.ts'
1616import { RepositorySelector } from 'components/RepositorySelector'
17+ import { Loading } from 'components/Loading'
1718
1819// TODO: once mono repo in place, extract types and components from here
1920
@@ -217,10 +218,6 @@ export const Default: Story = {
217218 setColours ( selected )
218219 } , [ ] )
219220
220- if ( loading || ! entries ) {
221- return < div > Loading...</ div >
222- }
223-
224221 const backgroundColour = theme === 'dark' ? '#1a1a1a' : 'white'
225222 const textColour = theme === 'dark' ? 'white' : '#1a1a1a'
226223
@@ -271,23 +268,31 @@ export const Default: Story = {
271268 </ div >
272269 </ div >
273270
274- < GitLog
275- { ...args }
276- colours = { colours . colors }
277- entries = { entries }
278- theme = { theme }
279- currentBranch = { branch }
280- paging = { {
281- page : args . page ?? 0 ,
282- size : args . pageSize ?? entries . length
283- } }
284- classes = { {
285- containerStyles : {
286- background : backgroundColour
287- } ,
288- logTableClass : styles . table
289- } }
290- />
271+ { loading && (
272+ < div className = { styles . loading } >
273+ < Loading theme = { theme } />
274+ </ div >
275+ ) }
276+
277+ { ! loading && entries && (
278+ < GitLog
279+ { ...args }
280+ colours = { colours . colors }
281+ entries = { entries }
282+ theme = { theme }
283+ currentBranch = { branch }
284+ paging = { {
285+ page : args . page ?? 0 ,
286+ size : args . pageSize ?? entries . length
287+ } }
288+ classes = { {
289+ containerStyles : {
290+ background : backgroundColour
291+ } ,
292+ logTableClass : styles . table
293+ } }
294+ />
295+ ) }
291296 </ div >
292297 )
293298 }
0 commit comments