mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 19:16:41 +07:00
stickers: implemented click-adding
This commit is contained in:
parent
93e05b7efe
commit
4ea56aa43c
4 changed files with 60 additions and 43 deletions
|
@ -2,7 +2,6 @@
|
|||
import React from 'react';
|
||||
|
||||
import { STICKERS } from '$constants/stickers';
|
||||
import sprite from '$sprites/stickers.svg';
|
||||
|
||||
type Props = {
|
||||
setActiveSticker: Function
|
||||
|
@ -12,14 +11,15 @@ export const StickersDialog = ({ setActiveSticker }: Props) => (
|
|||
<div className="helper stickers-helper">
|
||||
{
|
||||
Object.keys(STICKERS).map(set => (
|
||||
STICKERS[set].layers.map((sticker, i) => (
|
||||
Object.keys(STICKERS[set].layers).map(sticker => (
|
||||
<div
|
||||
style={{
|
||||
backgroundImage: `url(${STICKERS[set].url})`,
|
||||
backgroundPosition: `${-sticker.off * 48}px 50%`,
|
||||
backgroundPosition: `${-STICKERS[set].layers[sticker].off * 48}px 50%`,
|
||||
}}
|
||||
className="sticker-preview"
|
||||
key={`${set}-${i}`}
|
||||
key={`${set}-${sticker}`}
|
||||
onClick={() => setActiveSticker({ set, sticker })}
|
||||
/>
|
||||
))
|
||||
))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue