1
1
import * as React from 'react' ;
2
+ import { Box , Tab , TabList , TabPanel , Tabs } from '@mui/joy' ;
2
3
import {
3
4
ChangelogContainer ,
4
5
ChangelogList ,
5
6
useChangelogs ,
7
+ ChangelogListBase ,
8
+ groupChangelogsByComponents ,
9
+ GroupBy ,
6
10
} from '../dist/updatehive-react' ;
7
11
8
12
export const App : React . FC = ( ) => {
@@ -25,35 +29,61 @@ export const App: React.FC = () => {
25
29
}
26
30
27
31
return (
28
- < div >
32
+ < Box >
29
33
< h1 > UpdateHive - React Client Component</ h1 >
30
- < h3 > Example using UpdateHive react hook</ h3 >
31
- < div >
32
- { loading || error || data === undefined ? (
33
- < div > Loading changelogs ...</ div >
34
- ) : (
34
+ < h3 > Examples using UpdateHive react components</ h3 >
35
+ < Tabs >
36
+ < TabList >
37
+ < Tab > Hook</ Tab >
38
+ < Tab > Minimal</ Tab >
39
+ < Tab > ChangelogList</ Tab >
40
+ < Tab > Base</ Tab >
41
+ </ TabList >
42
+ < TabPanel value = { 0 } >
43
+ < h3 > Example using UpdateHive react hook</ h3 >
35
44
< div >
36
- < div className = "hook table" key = { 'header' } >
37
- < div className = "hook div" > Version</ div >
38
- < div className = "hook div" > Description</ div >
39
- </ div >
40
- { data . map ( ( changelog , index ) => (
41
- < div className = "hook table" key = { `changelog-${ index } ` } >
42
- < div className = "hook div" > { changelog . version } </ div >
43
- < div className = "hook div" > { changelog . description } </ div >
45
+ { loading || error || data === undefined ? (
46
+ < div > Loading changelogs ...</ div >
47
+ ) : (
48
+ < div >
49
+ < div className = "hook table" key = { 'header' } >
50
+ < div className = "hook div" > Version</ div >
51
+ < div className = "hook div" > Description</ div >
52
+ </ div >
53
+ { data . map ( ( changelog , index ) => (
54
+ < div className = "hook table" key = { `changelog-${ index } ` } >
55
+ < div className = "hook div" > { changelog . version } </ div >
56
+ < div className = "hook div" > { changelog . description } </ div >
57
+ </ div >
58
+ ) ) }
44
59
</ div >
45
- ) ) }
60
+ ) }
46
61
</ div >
47
- ) }
48
- </ div >
49
- < h3 > Example using UpdateHive react components</ h3 >
50
- < ChangelogContainer
51
- API_KEY = { API_KEY }
52
- product = { PRODUCT }
53
- config = { { url : serviceURL } }
54
- >
55
- < ChangelogList />
56
- </ ChangelogContainer >
57
- </ div >
62
+ </ TabPanel >
63
+ < TabPanel value = { 1 } >
64
+ < ChangelogContainer
65
+ API_KEY = { API_KEY }
66
+ product = { PRODUCT }
67
+ config = { { url : serviceURL } }
68
+ >
69
+ < ChangelogList groupBy = { GroupBy . NONE } hideEntryType />
70
+ </ ChangelogContainer >
71
+ </ TabPanel >
72
+ < TabPanel value = { 2 } >
73
+ < ChangelogContainer
74
+ API_KEY = { API_KEY }
75
+ product = { PRODUCT }
76
+ config = { { url : serviceURL } }
77
+ >
78
+ < ChangelogList />
79
+ </ ChangelogContainer >
80
+ </ TabPanel >
81
+ < TabPanel value = { 3 } >
82
+ < ChangelogListBase
83
+ changelogs = { data && groupChangelogsByComponents ( data ) }
84
+ />
85
+ </ TabPanel >
86
+ </ Tabs >
87
+ </ Box >
58
88
) ;
59
89
} ;
0 commit comments