From b4a66ee5c096ba6c114857351cd116e326ba371f Mon Sep 17 00:00:00 2001 From: GRayHook Date: Sun, 24 Aug 2025 22:43:24 +0700 Subject: [PATCH] placeholder utill we loaded up --- src/components/Reactions.tsx | 16 +++++++- src/content.tsx | 91 +++++++++++++++++++++++++++----------------- 2 files changed, 70 insertions(+), 37 deletions(-) diff --git a/src/components/Reactions.tsx b/src/components/Reactions.tsx index 62f9341..2356b07 100644 --- a/src/components/Reactions.tsx +++ b/src/components/Reactions.tsx @@ -80,7 +80,17 @@ const Reactions: React.FC = ({ issueId, commentId }) => { handleReactionClick(emojiData.emoji); }; - if (isLoading || !myUserId) return null; + if (isLoading) { + return ( +
+
+
+
+
+ ); + } + + if (!myUserId) return null; return (
@@ -109,7 +119,7 @@ const Reactions: React.FC = ({ issueId, commentId }) => { }; const styles: { [key: string]: React.CSSProperties } = { - container: { display: 'flex', alignItems: 'center', flexWrap: 'wrap', gap: '6px', marginTop: '8px', marginBottom: '8px', paddingLeft: '10px', fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif', fontSize: '13px' }, + container: { display: 'flex', alignItems: 'center', flexWrap: 'wrap', gap: '6px', marginTop: '8px', marginBottom: '8px', paddingLeft: '10px', fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif', fontSize: '13px', minHeight: '36px' }, badge: { display: 'flex', alignItems: 'center', padding: '2px 8px', border: '1px solid #dcdcdc', borderRadius: '12px', cursor: 'pointer', transition: 'background-color 0.2s', backgroundColor: '#f7f7f7' }, badgeSelected: { backgroundColor: '#e6f2ff', borderColor: '#99ccff' }, emoji: { marginRight: '4px', fontSize: '15px', lineHeight: '1' }, @@ -117,6 +127,8 @@ const styles: { [key: string]: React.CSSProperties } = { countSelected: { color: '#005cc5' }, addButton: { display: 'flex', alignItems: 'center', padding: '2px 8px', border: '1px dashed #ccc', borderRadius: '12px', backgroundColor: 'transparent', cursor: 'pointer', color: '#555', fontFamily: 'inherit', fontSize: '13px' }, pickerWrapper: { position: 'absolute', bottom: '100%', left: 0, marginBottom: '10px', zIndex: 1000 }, + skeleton: { height: '26px', backgroundColor: '#eef0f2', borderRadius: '12px', animation: 'reactions-pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite' }, + addButtonSkeleton: { height: '26px', width: '42px', backgroundColor: 'transparent', border: '1px dashed #e0e0e0', borderRadius: '12px' }, }; export default Reactions; diff --git a/src/content.tsx b/src/content.tsx index 487dbb3..8cff8d6 100644 --- a/src/content.tsx +++ b/src/content.tsx @@ -2,40 +2,61 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; import Reactions from './components/Reactions'; -console.log('Redmine Reactions Extension Loaded!'); - -// Функция для извлечения ID задачи из URL -function getIssueId(): number | null { - const match = window.location.pathname.match(/\/issues\/(\d+)/); - return match && match[1] ? parseInt(match[1], 10) : null; +// --- Подготовка --- +// Создаем элемент