-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdata.js
99 lines (87 loc) · 3.59 KB
/
data.js
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import { v4 as uuid } from 'uuid'
export const defaultUser = {
id: uuid(),
username: 'username',
name: 'name',
profile_image:
'https://scontent-ort2-2.cdninstagram.com/v/t51.2885-19/s150x150/82559664_3161307737426774_8687807477812559872_n.jpg?_nc_ht=scontent-ort2-2.cdninstagram.com&_nc_ohc=llb3VCRb-mkAX_XTEi3&oh=64f0323db646c01299e513e3337b83ff&oe=5E8620BF',
// profile_image:
// "https://instagram.com/static/images/anonymousUser.jpg/23e7b3b2a737.jpg"
}
export function getDefaultUser() {
return {
id: uuid(),
username: 'username',
name: 'name',
profile_image:
'https://scontent-ort2-2.cdninstagram.com/v/t51.2885-19/s150x150/82559664_3161307737426774_8687807477812559872_n.jpg?_nc_ht=scontent-ort2-2.cdninstagram.com&_nc_ohc=llb3VCRb-mkAX_XTEi3&oh=64f0323db646c01299e513e3337b83ff&oe=5E8620BF',
}
}
export const defaultPost = {
id: uuid(),
likes: 10,
caption: `<span class="">Do you know the 10 JavaScript concepts you need to learn React? 🤔⚛️👇<br>•<br>•<br>👉 Get the FREE cheatsheet to learn them now: bit.ly/10-js-tips 🔥</span>`,
user: defaultUser,
media:
'https://scontent-ort2-2.cdninstagram.com/v/t51.2885-15/sh0.08/e35/s640x640/80126161_2456912044637768_8188145638093587415_n.jpg?_nc_ht=scontent-ort2-2.cdninstagram.com&_nc_cat=108&_nc_ohc=GAkCBeSLLnwAX_Xn25U&oh=58af570f5ad051b24583c388b946784a&oe=5EA44484',
comments: [],
created_at: '2020-02-28T03:08:14.522421+00:00',
}
function shuffle(array) {
var currentIndex = array.length,
temporaryValue,
randomIndex
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
randomIndex = Math.floor(Math.random() * currentIndex)
currentIndex -= 1
// And swap it with the current element.
temporaryValue = array[currentIndex]
array[currentIndex] = array[randomIndex]
array[randomIndex] = temporaryValue
}
return array
}
export function getDefaultPost() {
let imgArr = ['tech', 'nature', 'people', 'animals']
let num = shuffle(imgArr)
return {
id: uuid(),
likes: 10,
caption: `<span class="">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy.🔥</span>`,
user: defaultUser,
media: `http://placeimg.com/640/480/${num}`,
comments: [],
created_at: '2020-02-28T03:08:14.522421+00:00',
}
}
export const defaultNotifications = [
{
id: uuid(),
type: 'follow',
user: defaultUser,
created_at: '2020-02-29T03:08:14.522421+00:00',
},
{
id: uuid(),
type: 'like',
user: defaultUser,
post: defaultPost,
created_at: '2020-02-29T03:08:14.522421+00:00',
},
]
export const defaultCurrentUser = {
id: uuid(),
username: 'me',
name: 'myself',
profile_image:
'https://scontent-ort2-2.cdninstagram.com/v/t51.2885-19/s150x150/82559664_3161307737426774_8687807477812559872_n.jpg?_nc_ht=scontent-ort2-2.cdninstagram.com&_nc_ohc=llb3VCRb-mkAX_XTEi3&oh=64f0323db646c01299e513e3337b83ff&oe=5E8620BF',
website: 'https://react12.io',
email: '[email protected]',
bio: 'This is my bio',
phone_number: '555-555-5555',
posts: Array.from({ length: 10 }, () => getDefaultPost()),
followers: [defaultUser],
following: [defaultUser],
}