Skip to content

Commit 541d28f

Browse files
committed
fix: ResourceList empty message
1 parent 1ca316f commit 541d28f

File tree

3 files changed

+46
-4
lines changed

3 files changed

+46
-4
lines changed

src/Components/ResourceList.tsx

+25-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,31 @@ export function ResourceList<T extends GalvResource>({
9797
/>
9898
))
9999
} else {
100-
content = 'No resources to show.'
100+
content = (
101+
<Typography
102+
variant={'body1'}
103+
className={classes.resourceListBlankBody}
104+
>
105+
There is nothing to show.
106+
{!user && (
107+
<>
108+
{' '}
109+
You may see more if you are signed in.
110+
<Button
111+
variant="outlined"
112+
size={'small'}
113+
onClick={() => setLoginFormOpen(true)}
114+
>
115+
Log in now
116+
</Button>
117+
</>
118+
)}
119+
{user && (<>
120+
{' '}
121+
Why not get started by creating something?
122+
</>)}
123+
</Typography>
124+
)
101125
}
102126

103127
return (

src/UserLogin.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ export default function UserLogin() {
591591
<ButtonGroup
592592
disableElevation
593593
variant="contained"
594-
title="Disabled elevation buttons"
594+
title="Log in and registration buttons"
595595
>
596596
<Button
597597
onClick={() => {

src/styles/UseStyles.ts

+20-2
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,21 @@ export default makeStyles()((theme) => {
375375
marginRight: theme.spacing(1),
376376
color: theme.palette.text.disabled,
377377
},
378+
resourceListBlankBody: {
379+
paddingTop: theme.spacing(8),
380+
paddingRight: theme.spacing(0),
381+
paddingBottom: theme.spacing(8),
382+
paddingLeft: theme.spacing(0),
383+
'& .MuiButton-root': {
384+
display: 'inline-block',
385+
float: 'inline-end',
386+
},
387+
},
378388
resourceSummary: {
379-
padding: [theme.spacing(0), theme.spacing(2)],
389+
paddingTop: theme.spacing(0),
390+
paddingRight: theme.spacing(2),
391+
paddingBottom: theme.spacing(0),
392+
paddingLeft: theme.spacing(2),
380393
'& > .MuiStack-root': {
381394
display: 'flex',
382395
lineHeight: '2em',
@@ -388,7 +401,12 @@ export default makeStyles()((theme) => {
388401
},
389402
resourceSummaryCard: {
390403
padding: 0,
391-
'& kbd': { padding: [theme.spacing(0), theme.spacing(2)] },
404+
'& kbd': {
405+
paddingTop: theme.spacing(0),
406+
paddingRight: theme.spacing(2),
407+
paddingBottom: theme.spacing(0),
408+
paddingLeft: theme.spacing(2),
409+
},
392410
'& img': { maxWidth: '100%' },
393411
'& .MuiAlert-root': {
394412
width: '100%',

0 commit comments

Comments
 (0)