Port StickerPreviewModal to storybook
This commit is contained in:
parent
6b094e1514
commit
2f2d027161
5 changed files with 99 additions and 70 deletions
|
@ -6,25 +6,24 @@ import png from '../../fixtures/freepngs-2cd43b_bed7d1327e88454487397574d87b64dc
|
|||
import landscapeGreen from '../../fixtures/1000x50-green.jpeg';
|
||||
// @ts-ignore
|
||||
import landscapePurple from '../../fixtures/200x50-purple.png';
|
||||
|
||||
function makeObjectUrl(data: ArrayBuffer, contentType: string): string {
|
||||
const blob = new Blob([data], {
|
||||
type: contentType,
|
||||
});
|
||||
|
||||
return URL.createObjectURL(blob);
|
||||
}
|
||||
// @ts-ignore
|
||||
import portraitTeal from '../../fixtures/50x1000-teal.jpeg';
|
||||
// @ts-ignore
|
||||
import squareSticker from '../../fixtures/512x515-thumbs-up-lincoln.webp';
|
||||
|
||||
// 320x240
|
||||
export const gifObjectUrl = makeObjectUrl(gif, 'image/gif');
|
||||
export const gifUrl = `/${gif}`;
|
||||
|
||||
// 800×1200
|
||||
export const pngObjectUrl = makeObjectUrl(png, 'image/png');
|
||||
export const landscapeGreenObjectUrl = makeObjectUrl(
|
||||
landscapeGreen,
|
||||
'image/jpeg'
|
||||
);
|
||||
export const landscapePurpleObjectUrl = makeObjectUrl(
|
||||
landscapePurple,
|
||||
'image/png'
|
||||
);
|
||||
export const pngUrl = `/${png}`;
|
||||
|
||||
// 1000x50
|
||||
export const landscapeGreenUrl = `/${landscapeGreen}`;
|
||||
|
||||
// 200x50
|
||||
export const landscapePurpleUrl = `/${landscapePurple}`;
|
||||
|
||||
// 50x1000
|
||||
export const portraitTealUrl = `/${portraitTeal}`;
|
||||
|
||||
export const squareStickerUrl = `/${squareSticker}`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue