-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDiscoverGroups.tsx
More file actions
45 lines (39 loc) · 1.03 KB
/
DiscoverGroups.tsx
File metadata and controls
45 lines (39 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { useEffect, useState } from 'react';
import { BsMegaphoneFill } from 'react-icons/bs';
import Skeleton from '../../common/Skeleton';
import { GROUPS } from '../../constants/dummy';
import Async from '../../containers/Async';
import GroupsContainer from '../../containers/Groups';
function DiscoverGroups() {
const [state, setState] = useState({
loading: true,
fulfilled: false,
error: null,
});
const onSearchFormSubmit = (values: { query: string }) => {
console.log(values);
};
useEffect(() => {
const TimerId = setTimeout(() => {
setState({
loading: false,
fulfilled: true,
error: null,
});
}, 2000);
return () => {
clearTimeout(TimerId);
};
}, []);
return (
<Async {...state} skeleton={<Skeleton variant='post' repeat={6} />}>
<GroupsContainer
onSearchFormSubmit={onSearchFormSubmit}
title='Discover Groups'
groups={GROUPS}
icon={BsMegaphoneFill}
/>
</Async>
);
}
export default DiscoverGroups;