Skip to content

Commit 90c38ed

Browse files
committed
feat(samples): add recents components to samples
1 parent 7c6c2de commit 90c38ed

File tree

4 files changed

+131
-1
lines changed

4 files changed

+131
-1
lines changed

samples/Main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import React from 'react';
22

3+
import RecentsComponents from './recents-components';
4+
35
function Main() {
46
return (
57
<div>
6-
React Samples
8+
<h1>React Samples</h1>
9+
<h2>Recents Components</h2>
10+
<RecentsComponents />
711
</div>
812
);
913
}

samples/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
<title>Widget Samples</title>
55
<style>
66
body {
7+
padding: 25px;
78
margin: 0;
9+
font-family: CiscoSans, Helvetica, Arial, sans-serif;
810
}
911
</style>
1012
</head>

samples/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import React from 'react';
33
import ReactDOM from 'react-dom';
44

5+
import '@ciscospark/react-component-spark-fonts';
6+
57
import Main from './Main';
68

79
ReactDOM.render(

samples/recents-components/index.js

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
import React from 'react';
2+
3+
import JoinCallButton from '@ciscospark/react-component-join-call-button';
4+
import SpaceItem from '@ciscospark/react-component-space-item';
5+
import SpacesList from '@ciscospark/react-component-spaces-list';
6+
7+
function RecentsComponents() {
8+
function onCallClick(id) {
9+
// eslint-disable-next-line no-alert
10+
window.alert(`onCallClick: ${id}`);
11+
}
12+
13+
function onClick(id) {
14+
// eslint-disable-next-line no-alert
15+
window.alert(`onClick: ${id}`);
16+
}
17+
18+
function onJoinClick() {
19+
// eslint-disable-next-line no-alert
20+
window.alert('onJoinClick');
21+
}
22+
23+
const currentUser = {
24+
id: 'abc-123'
25+
};
26+
27+
const spacesListSpaces = [
28+
{
29+
id: 'decrypting-space',
30+
isDecrypting: true,
31+
name: 'Webex User'
32+
},
33+
{
34+
activityText: 'Hey there!',
35+
callStartTime: Date.now(),
36+
id: 'jane-doe-space',
37+
lastActivityTime: '9:05 PM',
38+
latestActivity: {
39+
actorName: 'Jane Doe',
40+
type: 'post'
41+
},
42+
isUnread: true,
43+
name: 'Webex User',
44+
teamColor: 'blue',
45+
teamName: 'Best Team'
46+
}
47+
];
48+
49+
return (
50+
<div>
51+
<h3>JoinCallButton</h3>
52+
<JoinCallButton
53+
callStartTime={Date.now()}
54+
onJoinClick={onJoinClick}
55+
/>
56+
<h3>SpaceItem</h3>
57+
<SpaceItem
58+
currentUser={currentUser}
59+
formatMessage={(a) => a}
60+
id="decrypting-space"
61+
isDecrypting
62+
name="Webex User"
63+
onClick={onClick}
64+
/>
65+
<SpaceItem
66+
activityText="Hi there!"
67+
currentUser={currentUser}
68+
formatMessage={(a) => a}
69+
id="jane-doe-space"
70+
lastActivityTime="9:05 PM"
71+
latestActivity={{
72+
actorName: 'Jane Doe',
73+
type: 'post'
74+
}}
75+
isUnread
76+
hasCalling
77+
onCallClick={onCallClick}
78+
onClick={onClick}
79+
name="Webex User"
80+
teamColor="blue"
81+
teamName="Best Team"
82+
/>
83+
<SpaceItem
84+
activityText="Calling!"
85+
callStartTime={Date.now()}
86+
currentUser={currentUser}
87+
formatMessage={(a) => a}
88+
id="jane-doe-space"
89+
lastActivityTime="9:05 PM"
90+
latestActivity={{
91+
actorName: 'Jane Doe',
92+
type: 'post'
93+
}}
94+
isUnread
95+
hasCalling
96+
onCallClick={onCallClick}
97+
onClick={onClick}
98+
name="Webex User"
99+
teamColor="blue"
100+
teamName="Best Team"
101+
/>
102+
<h3>SpaceList</h3>
103+
<SpacesList
104+
currentUser={currentUser}
105+
formatMessage={(a) => a}
106+
hasCalling
107+
onCallClick={onCallClick}
108+
onClick={onClick}
109+
spaces={spacesListSpaces}
110+
/>
111+
<SpacesList
112+
currentUser={currentUser}
113+
formatMessage={(a) => a}
114+
onCallClick={onCallClick}
115+
onClick={onClick}
116+
spaces={spacesListSpaces}
117+
/>
118+
</div>
119+
);
120+
}
121+
122+
export default RecentsComponents;

0 commit comments

Comments
 (0)