Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
209 changes: 209 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@
border-radius: 4px;
}

.navigating-emoji {
font-size: 1.5rem;
line-height: 1;
}

.navigating-text {
font-size: 1.3rem;
opacity: 0.6;
Expand Down Expand Up @@ -201,6 +206,14 @@
border-radius: 3px;
}

.search-dropdown-emoji {
flex-shrink: 0;
font-size: 1rem;
line-height: 1;
width: 16px;
text-align: center;
}

.search-dropdown-label {
font-size: 0.95rem;
}
Expand Down Expand Up @@ -266,6 +279,14 @@
border-radius: 4px;
}

.link-item-emoji {
flex-shrink: 0;
font-size: 1.15rem;
line-height: 1;
width: 20px;
text-align: center;
}

.link-item-label {
font-size: 0.95rem;
}
Expand Down Expand Up @@ -1026,6 +1047,194 @@
background: rgba(var(--fg), 0.18);
}

/* Emoji Picker */
.emoji-picker {
width: 90%;
max-width: 380px;
max-height: 420px;
background: rgba(var(--dropdown-bg), 0.97);
border: 1px solid rgba(var(--fg), 0.1);
border-radius: 14px;
padding: 16px;
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
display: flex;
flex-direction: column;
}

.emoji-picker-header {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 12px;
}

.emoji-picker-search {
flex: 1;
}

.emoji-picker-tabs {
display: flex;
gap: 2px;
margin-bottom: 12px;
overflow-x: auto;
padding-bottom: 4px;
}

.emoji-picker-tab {
padding: 5px 10px;
font-size: 0.75rem;
font-family: inherit;
border: none;
border-radius: 6px;
background: rgba(var(--fg), 0.05);
color: rgba(var(--fg), 0.45);
cursor: pointer;
transition: background 150ms, color 150ms;
white-space: nowrap;
flex-shrink: 0;
}

.emoji-picker-tab:hover {
background: rgba(var(--fg), 0.1);
color: rgba(var(--fg), 0.7);
}

.emoji-picker-tab.active {
background: rgba(var(--fg), 0.12);
color: rgb(var(--fg));
}

.emoji-picker-grid {
overflow-y: auto;
flex: 1;
}

.emoji-picker-category-label {
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.04em;
opacity: 0.4;
margin-bottom: 6px;
margin-top: 8px;
}

.emoji-picker-category-label:first-child {
margin-top: 0;
}

.emoji-picker-emojis {
display: flex;
flex-wrap: wrap;
gap: 2px;
}

.emoji-picker-emoji {
display: flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
font-size: 1.3rem;
border: none;
border-radius: 6px;
background: none;
cursor: pointer;
transition: background 150ms;
}

.emoji-picker-emoji:hover {
background: rgba(var(--fg), 0.1);
}

.emoji-picker-empty {
text-align: center;
padding: 24px;
opacity: 0.4;
font-size: 0.9rem;
}

/* Link Icon Selector */
.config-editor-icon-row {
display: flex;
align-items: center;
gap: 6px;
margin-top: 4px;
}

.config-editor-icon-type-select {
padding: 6px 10px;
font-size: 0.8rem;
font-family: inherit;
color: rgb(var(--fg));
background: rgba(var(--fg), 0.08);
border: 1px solid rgba(var(--fg), 0.1);
border-radius: 6px;
outline: none;
cursor: pointer;
flex-shrink: 0;
}

.config-editor-icon-type-select option {
background: rgb(var(--dropdown-bg));
color: rgb(var(--fg));
}

.config-editor-icon-value {
flex: 1;
min-width: 0;
}

.config-editor-emoji-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
height: 36px;
padding: 0 12px;
font-size: 0.85rem;
font-family: inherit;
border: 1px solid rgba(var(--fg), 0.1);
border-radius: 8px;
background: rgba(var(--fg), 0.08);
color: rgba(var(--fg), 0.6);
cursor: pointer;
transition: background 150ms, border-color 150ms;
flex: 1;
min-width: 0;
}

.config-editor-emoji-btn:hover {
background: rgba(var(--fg), 0.12);
border-color: rgba(var(--fg), 0.2);
}

.config-editor-emoji-preview {
font-size: 1.1rem;
line-height: 1;
}

.config-editor-icon-clear {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
padding: 0;
border: 1px solid rgba(var(--fg), 0.08);
border-radius: 6px;
background: rgba(var(--fg), 0.05);
color: rgba(var(--fg), 0.4);
cursor: pointer;
transition: background 150ms, color 150ms;
flex-shrink: 0;
}

.config-editor-icon-clear:hover {
background: rgba(220, 50, 50, 0.15);
color: rgba(255, 120, 120, 0.9);
}

/* Responsive */
@media (max-width: 600px) {
.content {
Expand Down
111 changes: 111 additions & 0 deletions src/screens/ConfigEditorScreen/components/EmojiPicker.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import { useState } from 'react';

const EMOJI_CATEGORIES: { label: string; emojis: string[] }[] = [
{
label: 'Smileys',
emojis: ['😀', '😃', '😄', '😁', '😆', '😅', '🤣', '😂', '🙂', '😉', '😊', '😇', '🥰', '😍', '😎', '🤩', '🥳', '😤', '🤯', '🥺', '😱', '💀', '👻', '🤖', '👽', '💩'],
},
{
label: 'Hands',
emojis: ['👍', '👎', '👊', '✊', '🤞', '✌️', '🤟', '👋', '🤚', '🖐️', '✋', '👏', '🙌', '🤝', '🙏', '💪', '🫶'],
},
{
label: 'Objects',
emojis: ['💻', '🖥️', '📱', '📧', '📝', '📁', '📂', '📌', '📎', '🔗', '🔒', '🔑', '🔧', '🔨', '⚙️', '🛠️', '📊', '📈', '📉', '💡', '🔔', '📦', '🗂️', '🏷️', '💾', '🖨️'],
},
{
label: 'Symbols',
emojis: ['❤️', '🧡', '💛', '💚', '💙', '💜', '⭐', '🌟', '✨', '💥', '🔥', '⚡', '❗', '❓', '✅', '❌', '⬆️', '➡️', '⬇️', '⬅️', '🔴', '🟠', '🟡', '🟢', '🔵', '🟣'],
},
{
label: 'Nature',
emojis: ['🌍', '🌎', '🌏', '🌞', '🌙', '⛅', '🌈', '🌊', '🌸', '🌺', '🌻', '🍀', '🌲', '🌴', '🍄', '🐶', '🐱', '🐸', '🦊', '🐻', '🐼', '🐨', '🦁', '🐯', '🐵'],
},
{
label: 'Food',
emojis: ['🍎', '🍊', '🍋', '🍇', '🍓', '🍕', '🍔', '🌮', '🍣', '🍩', '🍪', '🎂', '🍰', '☕', '🍵', '🧃', '🍺', '🍷', '🥤', '🧁'],
},
{
label: 'Travel',
emojis: ['🏠', '🏢', '🏫', '🏥', '🏪', '🚗', '🚕', '🚌', '🚀', '✈️', '🚢', '🚲', '🏖️', '🏔️', '⛺', '🗼', '🗽', '🎡'],
},
{
label: 'Activities',
emojis: ['⚽', '🏀', '🏈', '⚾', '🎾', '🎮', '🎲', '🎯', '🎨', '🎬', '🎤', '🎧', '🎵', '🎹', '📚', '🎓', '🏆', '🥇', '🎪', '🎭'],
},
];

interface EmojiPickerProps {
onSelect: (emoji: string) => void;
onClose: () => void;
}

export function EmojiPicker({ onSelect, onClose }: EmojiPickerProps) {
const [search, setSearch] = useState('');
const [activeCategory, setActiveCategory] = useState(0);

const filteredCategories = search
? EMOJI_CATEGORIES.map((cat) => ({
...cat,
emojis: cat.emojis.filter((e) => e.includes(search)),
})).filter((cat) => cat.emojis.length > 0)
: EMOJI_CATEGORIES;

return (
<div className="config-editor-modal-overlay" onClick={onClose}>
<div className="emoji-picker" onClick={(e) => e.stopPropagation()}>
<div className="emoji-picker-header">
<input
className="config-editor-input emoji-picker-search"
type="text"
placeholder="Search emojis..."
value={search}
onChange={(e) => setSearch(e.target.value)}
autoFocus
/>
<button className="config-editor-back" onClick={onClose}>
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<line x1="18" y1="6" x2="6" y2="18" />
<line x1="6" y1="6" x2="18" y2="18" />
</svg>
</button>
</div>
{!search && (
<div className="emoji-picker-tabs">
{EMOJI_CATEGORIES.map((cat, i) => (
<button
key={cat.label}
className={`emoji-picker-tab${i === activeCategory ? ' active' : ''}`}
onClick={() => setActiveCategory(i)}
>
{cat.label}
</button>
))}
</div>
)}
<div className="emoji-picker-grid">
{(search ? filteredCategories : [EMOJI_CATEGORIES[activeCategory]]).map((cat) => (
<div key={cat.label}>
{search && <div className="emoji-picker-category-label">{cat.label}</div>}
<div className="emoji-picker-emojis">
{cat.emojis.map((emoji) => (
<button
key={emoji}
className="emoji-picker-emoji"
onClick={() => onSelect(emoji)}
type="button"
>
{emoji}
</button>
))}
</div>
</div>
))}
{search && filteredCategories.length === 0 && (
<div className="emoji-picker-empty">No emojis found</div>
)}
</div>
</div>
</div>
);
}
Loading