Skip to content

Commit 2c4b57c

Browse files
authored
Merge pull request #78 from admin-golang/infinity-list-icon-optional
{examples, templates, icon}: Infinity list icon optional.
2 parents ebb89ed + 1a5b089 commit 2c4b57c

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

examples/infinity-scrolling/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func NewInfinityListPage() (admin.Pager, error) {
1313
return admin.NewIInfinityListPage(admin.IInfinityListPageConfig{
1414
PageConfig: admin.PageConfig{
1515
Icon: icon.Icon{
16-
Type: icon.Email,
16+
Type: icon.Empty,
1717
},
1818
IsDefault: true,
1919
ID: "Home",

icon/icon.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package icon
22

3-
type IconType uint
3+
type IconType int
44

55
const (
6+
Empty IconType = -1
67
Notifications IconType = iota
78
AccountCircle
89
Dashboard

templates/materialUI.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -1899,7 +1899,7 @@ function [[ .ID ]]InfinityList({ handleSetAppState }) {
18991899
{alertMessage}
19001900
</Alert>
19011901
</Snackbar>
1902-
<Grid item xs={12} sm={8} md={5} component={Paper} elevation={6} square>
1902+
<Grid item xs={12} sm={12} md={12} component={Paper} elevation={6} square>
19031903
<Box
19041904
sx={{
19051905
my: 8,
@@ -1909,6 +1909,7 @@ function [[ .ID ]]InfinityList({ handleSetAppState }) {
19091909
alignItems: 'center',
19101910
}}
19111911
>
1912+
[[ if gt .Icon.Type -1 ]]
19121913
<Avatar sx={{ m: 1, bgcolor: 'secondary.main' }}>
19131914
[[ if eq .Icon.Type 7 ]]
19141915
<LockOutlinedIcon />
@@ -1917,6 +1918,7 @@ function [[ .ID ]]InfinityList({ handleSetAppState }) {
19171918
<EmailIcon />
19181919
[[ end ]]
19191920
</Avatar>
1921+
[[ end ]]
19201922
<Typography component="h1" variant="h5">
19211923
[[ .Form.Title ]]
19221924
</Typography>

0 commit comments

Comments
 (0)