Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const generatePinDetails = (pin: IMapPin): IMapPinDetail => {
const randomDate = new Date()
randomDate.setSeconds(randomDate.getSeconds() - Math.random() * 10000)
const lastActive = randomDate.toISOString()
return {
name: loremIpsum({ count: 2, units: 'words' })
.split(' ')
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(' '),
shortDescription: loremIpsum({ count: 2, units: 'sentences' }),
lastActive,
profilePicUrl: 'https://picsum.photos/50/50',
profileUrl: '/testing',
heroImageUrl: `https://picsum.photos/seed/${lastActive}/285/175`,
}
}
export const generatePinDetails = (pin: IMapPin): IMapPinDetail => {
const randomDate = new Date()
randomDate.setSeconds(randomDate.getSeconds() - Math.random() * 10000)
const lastActive = randomDate.toISOString()
return {
name: loremIpsum({ count: 2, units: 'words' })
.split(' ')
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(' '),
shortDescription: loremIpsum({ count: 2, units: 'sentences' }),
lastActive,
profilePicUrl: 'https://picsum.photos/50/50',
profileUrl: '/testing',
heroImageUrl: `https://picsum.photos/seed/${lastActive}/285/175`,
}
}
setTimeout(() => {
resolve(
loremIpsum({
count: 5,
format: 'html',
units: 'paragraph'
})
)
}, 1000)
},
import { loremIpsum } from 'lorem-ipsum';
import centered from '@storybook/addon-centered/react';
import { withKnobs, boolean } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/react';
import { MessageBubble } from '.';
const text = loremIpsum({ count: 1, units: 'sentences' });
storiesOf('Messages|MessageBubble', module)
.addDecorator(centered)
.addDecorator(withKnobs)
.add('default', () => (
{text}
))
.add('inverse', () => (
setTimeout(() => {
resolve(
loremIpsum({
count: 5,
format: 'html',
units: 'paragraph'
})
)
}, 1000)
},
} from '../constants';
import { Message } from '.';
const messageTypes = {
NULL: null,
ROOM_NAME_CHANGED: MESSAGE_TYPE_ROOM_NAME_CHANGED,
USER_ADDED: MESSAGE_TYPE_USER_ADDED,
USER_REMOVED: MESSAGE_TYPE_USER_REMOVED,
USER_JOINED: MESSAGE_TYPE_USER_JOINED,
USER_LEFT: MESSAGE_TYPE_USER_LEFT,
WELCOME: MESSAGE_TYPE_WELCOME,
LIVECHAT_CLOSED: MESSAGE_TYPE_LIVECHAT_CLOSED,
};
const defaultMessage = loremIpsum({ count: 1, units: 'sentences' });
const defaultMessageExtra = loremIpsum({ count: 1, units: 'sentences' });
const defaultMarkdownMessage = `
# h1 Heading
## h2 Heading
### h3 Heading
#### h4 Heading
##### h5 Heading
###### h6 Heading
___
*This is bold text*
_This is italic text_
const randomDetail = () => {
return {
name: loremIpsum({
count: 1,
format: "plain",
units: "words",
}),
description: loremIpsum({
count: 1,
format: "plain",
sentenceLowerBound: 5,
sentenceUpperBound: 8,
units: "sentences",
}).slice(0, -1),
} as Detail;
};
const randomDetail = () => {
return {
name: loremIpsum({
count: 1,
format: "plain",
units: "words",
}),
description: loremIpsum({
count: 1,
format: "plain",
sentenceLowerBound: 5,
sentenceUpperBound: 8,
units: "sentences",
}).slice(0, -1),
} as Detail;
};
setTimeout(() => {
resolve(
loremIpsum({
count: 5,
format: 'html',
units: 'paragraph'
})
)
}, 1000)
},
import { Message } from '.';
const messageTypes = {
NULL: null,
ROOM_NAME_CHANGED: MESSAGE_TYPE_ROOM_NAME_CHANGED,
USER_ADDED: MESSAGE_TYPE_USER_ADDED,
USER_REMOVED: MESSAGE_TYPE_USER_REMOVED,
USER_JOINED: MESSAGE_TYPE_USER_JOINED,
USER_LEFT: MESSAGE_TYPE_USER_LEFT,
WELCOME: MESSAGE_TYPE_WELCOME,
LIVECHAT_CLOSED: MESSAGE_TYPE_LIVECHAT_CLOSED,
};
const defaultMessage = loremIpsum({ count: 1, units: 'sentences' });
const defaultMessageExtra = loremIpsum({ count: 1, units: 'sentences' });
const defaultMarkdownMessage = `
# h1 Heading
## h2 Heading
### h3 Heading
#### h4 Heading
##### h5 Heading
###### h6 Heading
___
*This is bold text*
_This is italic text_
~~Strikethrough~~