mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
moved components to TypeScript
This commit is contained in:
parent
85b8860862
commit
0a01c91271
54 changed files with 2771 additions and 5134 deletions
39
src/components/dialogs/StickersDialog.tsx
Normal file
39
src/components/dialogs/StickersDialog.tsx
Normal file
|
@ -0,0 +1,39 @@
|
|||
// @flow
|
||||
import * as React from 'react';
|
||||
|
||||
import { STICKERS } from '$constants/stickers';
|
||||
import { setActiveSticker as setActiveStickerAction } from "$redux/user/actions";
|
||||
|
||||
interface Props {
|
||||
setActiveSticker: typeof setActiveStickerAction,
|
||||
width: number,
|
||||
}
|
||||
|
||||
export const StickersDialog = ({ setActiveSticker, width }: Props) => (
|
||||
<div className="control-dialog control-dialog-big" style={{ width }}>
|
||||
<div className="helper stickers-helper">
|
||||
{
|
||||
Object.keys(STICKERS).map(set => (
|
||||
<div key={set}>
|
||||
<div className="stickers-set-title">{STICKERS[set].title || null}</div>
|
||||
<div className="stickers-grid">
|
||||
{
|
||||
Object.keys(STICKERS[set].layers).map(sticker => (
|
||||
<div
|
||||
style={{
|
||||
backgroundImage: `url(${STICKERS[set].url})`,
|
||||
backgroundPosition: `${-STICKERS[set].layers[sticker].off * 48}px 50%`,
|
||||
}}
|
||||
className="sticker-preview"
|
||||
key={`${set}-${sticker}`}
|
||||
onClick={() => setActiveSticker({ set, sticker })}
|
||||
/>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue