initial commit (frontend)
This commit is contained in:
@@ -0,0 +1,248 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { useLanguage } from '../../i18n/LanguageContext';
|
||||
import { radius } from '../../styles/theme';
|
||||
|
||||
interface AppsModalProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
const AppsModal: React.FC<AppsModalProps> = ({ isOpen, onClose }) => {
|
||||
const { t } = useLanguage();
|
||||
const scrollRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const accentColor = '#4FA9E8';
|
||||
const textColor = '#1A1A2E';
|
||||
const subColor = '#6B7280';
|
||||
const cardBg = 'rgba(255,255,255,0.55)';
|
||||
|
||||
const glass = (extra: React.CSSProperties = {}): React.CSSProperties => ({
|
||||
background: cardBg,
|
||||
backdropFilter: 'blur(24px) saturate(180%)',
|
||||
WebkitBackdropFilter: 'blur(24px) saturate(180%)',
|
||||
border: '1px solid rgba(255,255,255,0.7)',
|
||||
boxShadow: '0 8px 32px rgba(31,38,73,0.10), inset 0 1px 0 rgba(255,255,255,0.85)',
|
||||
...extra,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpen && scrollRef.current) {
|
||||
scrollRef.current.scrollTop = 0;
|
||||
}
|
||||
}, [isOpen]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isOpen) return;
|
||||
const handleKey = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape') onClose();
|
||||
};
|
||||
window.addEventListener('keydown', handleKey);
|
||||
return () => window.removeEventListener('keydown', handleKey);
|
||||
}, [isOpen, onClose]);
|
||||
|
||||
if (!isOpen) return null;
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
position: 'fixed',
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
background: 'rgba(20,22,35,0.35)',
|
||||
zIndex: 1000,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
padding: '20px',
|
||||
backdropFilter: 'blur(6px)',
|
||||
WebkitBackdropFilter: 'blur(6px)',
|
||||
animation: 'appsFadeIn 0.2s ease',
|
||||
}}
|
||||
onClick={(e) => {
|
||||
if (e.target === e.currentTarget) onClose();
|
||||
}}
|
||||
>
|
||||
<style>{`
|
||||
@keyframes appsFadeIn {
|
||||
0% { opacity: 0; }
|
||||
100% { opacity: 1; }
|
||||
}
|
||||
@keyframes appsSlideUp {
|
||||
0% { transform: translateY(20px); opacity: 0; }
|
||||
100% { transform: translateY(0); opacity: 1; }
|
||||
}
|
||||
@keyframes appsPopIn {
|
||||
0% { transform: scale(0.4); opacity: 0; }
|
||||
60% { transform: scale(1.1); opacity: 1; }
|
||||
100% { transform: scale(1); opacity: 1; }
|
||||
}
|
||||
@keyframes appsFloat {
|
||||
0%, 100% { transform: translateY(0); }
|
||||
50% { transform: translateY(-6px); }
|
||||
}
|
||||
`}</style>
|
||||
|
||||
<div
|
||||
ref={scrollRef}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
style={{
|
||||
...glass({
|
||||
borderRadius: radius.lg,
|
||||
padding: '24px',
|
||||
width: '100%',
|
||||
maxWidth: '400px',
|
||||
maxHeight: '80vh',
|
||||
overflowY: 'auto',
|
||||
boxShadow: '0 24px 60px rgba(31,38,73,0.25), inset 0 1px 0 rgba(255,255,255,0.85)',
|
||||
}),
|
||||
animation: 'appsSlideUp 0.3s ease',
|
||||
}}
|
||||
>
|
||||
{/* ============ Заголовок ============ */}
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
marginBottom: '20px',
|
||||
paddingBottom: '14px',
|
||||
borderBottom: '1px solid rgba(0,0,0,0.06)',
|
||||
}}
|
||||
>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
|
||||
{/* 🔧 ФИКС iOS 27: lineHeight 1.2 для эмодзи в заголовке */}
|
||||
<span style={{ fontSize: '24px', lineHeight: '1.2', display: 'inline-block' }}>📱</span>
|
||||
<h3
|
||||
style={{
|
||||
margin: 0,
|
||||
fontSize: '18px',
|
||||
fontWeight: 800,
|
||||
color: textColor,
|
||||
letterSpacing: '-0.2px',
|
||||
}}
|
||||
>
|
||||
{t('appsModalTitle')}
|
||||
</h3>
|
||||
</div>
|
||||
<button
|
||||
onClick={onClose}
|
||||
aria-label="Close"
|
||||
style={{
|
||||
...glass({
|
||||
padding: '8px 14px',
|
||||
borderRadius: radius.sm,
|
||||
}),
|
||||
color: textColor,
|
||||
fontSize: '14px',
|
||||
fontWeight: 600,
|
||||
cursor: 'pointer',
|
||||
WebkitTapHighlightColor: 'transparent',
|
||||
}}
|
||||
onTouchStart={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(0.9)';
|
||||
}}
|
||||
onTouchEnd={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(1)';
|
||||
}}
|
||||
>
|
||||
✕
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* ============ Пустое состояние ============ */}
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
padding: '32px 16px',
|
||||
textAlign: 'center',
|
||||
}}
|
||||
>
|
||||
{/* 🔧 ФИКС iOS 27: lineHeight 1.2 + padding для большого эмодзи */}
|
||||
<div
|
||||
style={{
|
||||
fontSize: '64px',
|
||||
lineHeight: '1.2',
|
||||
padding: '8px 0',
|
||||
marginBottom: '20px',
|
||||
animation: 'appsPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), appsFloat 3s ease-in-out 0.5s infinite',
|
||||
filter: `drop-shadow(0 8px 20px ${accentColor}40)`,
|
||||
userSelect: 'none',
|
||||
display: 'inline-block',
|
||||
}}
|
||||
>
|
||||
📱
|
||||
</div>
|
||||
|
||||
<p
|
||||
style={{
|
||||
margin: 0,
|
||||
fontSize: '15px',
|
||||
fontWeight: 500,
|
||||
color: subColor,
|
||||
lineHeight: '1.5',
|
||||
maxWidth: '280px',
|
||||
}}
|
||||
>
|
||||
{t('appsModalEmpty')}
|
||||
</p>
|
||||
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
gap: '6px',
|
||||
marginTop: '24px',
|
||||
}}
|
||||
>
|
||||
{[0, 1, 2].map((i) => (
|
||||
<div
|
||||
key={i}
|
||||
style={{
|
||||
width: '6px',
|
||||
height: '6px',
|
||||
borderRadius: '50%',
|
||||
background: accentColor,
|
||||
opacity: 0.3 + i * 0.2,
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* ============ Кнопка "Понятно" ============ */}
|
||||
<button
|
||||
onClick={onClose}
|
||||
style={{
|
||||
width: '100%',
|
||||
marginTop: '16px',
|
||||
padding: '14px 20px',
|
||||
borderRadius: radius.md,
|
||||
border: 'none',
|
||||
background: `linear-gradient(135deg, ${accentColor}, #3E9BE0)`,
|
||||
color: '#FFFFFF',
|
||||
fontSize: '15px',
|
||||
fontWeight: 700,
|
||||
cursor: 'pointer',
|
||||
boxShadow: `0 6px 20px ${accentColor}40`,
|
||||
WebkitTapHighlightColor: 'transparent',
|
||||
letterSpacing: '0.2px',
|
||||
}}
|
||||
onTouchStart={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(0.97)';
|
||||
}}
|
||||
onTouchEnd={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(1)';
|
||||
}}
|
||||
>
|
||||
{t('modalGotIt')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default AppsModal;
|
||||
@@ -0,0 +1,248 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { useLanguage } from '../../i18n/LanguageContext';
|
||||
import { radius } from '../../styles/theme';
|
||||
|
||||
interface ContactsModalProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
const ContactsModal: React.FC<ContactsModalProps> = ({ isOpen, onClose }) => {
|
||||
const { t } = useLanguage();
|
||||
const scrollRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const accentColor = '#8B5CF6';
|
||||
const textColor = '#1A1A2E';
|
||||
const subColor = '#6B7280';
|
||||
const cardBg = 'rgba(255,255,255,0.55)';
|
||||
|
||||
const glass = (extra: React.CSSProperties = {}): React.CSSProperties => ({
|
||||
background: cardBg,
|
||||
backdropFilter: 'blur(24px) saturate(180%)',
|
||||
WebkitBackdropFilter: 'blur(24px) saturate(180%)',
|
||||
border: '1px solid rgba(255,255,255,0.7)',
|
||||
boxShadow: '0 8px 32px rgba(31,38,73,0.10), inset 0 1px 0 rgba(255,255,255,0.85)',
|
||||
...extra,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpen && scrollRef.current) {
|
||||
scrollRef.current.scrollTop = 0;
|
||||
}
|
||||
}, [isOpen]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isOpen) return;
|
||||
const handleKey = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape') onClose();
|
||||
};
|
||||
window.addEventListener('keydown', handleKey);
|
||||
return () => window.removeEventListener('keydown', handleKey);
|
||||
}, [isOpen, onClose]);
|
||||
|
||||
if (!isOpen) return null;
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
position: 'fixed',
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
background: 'rgba(20,22,35,0.35)',
|
||||
zIndex: 1000,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
padding: '20px',
|
||||
backdropFilter: 'blur(6px)',
|
||||
WebkitBackdropFilter: 'blur(6px)',
|
||||
animation: 'contactsFadeIn 0.2s ease',
|
||||
}}
|
||||
onClick={(e) => {
|
||||
if (e.target === e.currentTarget) onClose();
|
||||
}}
|
||||
>
|
||||
<style>{`
|
||||
@keyframes contactsFadeIn {
|
||||
0% { opacity: 0; }
|
||||
100% { opacity: 1; }
|
||||
}
|
||||
@keyframes contactsSlideUp {
|
||||
0% { transform: translateY(20px); opacity: 0; }
|
||||
100% { transform: translateY(0); opacity: 1; }
|
||||
}
|
||||
@keyframes contactsPopIn {
|
||||
0% { transform: scale(0.4); opacity: 0; }
|
||||
60% { transform: scale(1.1); opacity: 1; }
|
||||
100% { transform: scale(1); opacity: 1; }
|
||||
}
|
||||
@keyframes contactsFloat {
|
||||
0%, 100% { transform: translateY(0); }
|
||||
50% { transform: translateY(-6px); }
|
||||
}
|
||||
`}</style>
|
||||
|
||||
<div
|
||||
ref={scrollRef}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
style={{
|
||||
...glass({
|
||||
borderRadius: radius.lg,
|
||||
padding: '24px',
|
||||
width: '100%',
|
||||
maxWidth: '400px',
|
||||
maxHeight: '80vh',
|
||||
overflowY: 'auto',
|
||||
boxShadow: '0 24px 60px rgba(31,38,73,0.25), inset 0 1px 0 rgba(255,255,255,0.85)',
|
||||
}),
|
||||
animation: 'contactsSlideUp 0.3s ease',
|
||||
}}
|
||||
>
|
||||
{/* ============ Заголовок ============ */}
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
marginBottom: '20px',
|
||||
paddingBottom: '14px',
|
||||
borderBottom: '1px solid rgba(0,0,0,0.06)',
|
||||
}}
|
||||
>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
|
||||
{/* 🔧 ФИКС iOS 27: lineHeight 1.2 для эмодзи в заголовке */}
|
||||
<span style={{ fontSize: '24px', lineHeight: '1.2', display: 'inline-block' }}>📞</span>
|
||||
<h3
|
||||
style={{
|
||||
margin: 0,
|
||||
fontSize: '18px',
|
||||
fontWeight: 800,
|
||||
color: textColor,
|
||||
letterSpacing: '-0.2px',
|
||||
}}
|
||||
>
|
||||
{t('contactsModalTitle')}
|
||||
</h3>
|
||||
</div>
|
||||
<button
|
||||
onClick={onClose}
|
||||
aria-label="Close"
|
||||
style={{
|
||||
...glass({
|
||||
padding: '8px 14px',
|
||||
borderRadius: radius.sm,
|
||||
}),
|
||||
color: textColor,
|
||||
fontSize: '14px',
|
||||
fontWeight: 600,
|
||||
cursor: 'pointer',
|
||||
WebkitTapHighlightColor: 'transparent',
|
||||
}}
|
||||
onTouchStart={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(0.9)';
|
||||
}}
|
||||
onTouchEnd={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(1)';
|
||||
}}
|
||||
>
|
||||
✕
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* ============ Пустое состояние ============ */}
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
padding: '32px 16px',
|
||||
textAlign: 'center',
|
||||
}}
|
||||
>
|
||||
{/* 🔧 ФИКС iOS 27: lineHeight 1.2 + padding для большого эмодзи */}
|
||||
<div
|
||||
style={{
|
||||
fontSize: '64px',
|
||||
lineHeight: '1.2',
|
||||
padding: '8px 0',
|
||||
marginBottom: '20px',
|
||||
animation: 'contactsPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), contactsFloat 3s ease-in-out 0.5s infinite',
|
||||
filter: `drop-shadow(0 8px 20px ${accentColor}40)`,
|
||||
userSelect: 'none',
|
||||
display: 'inline-block',
|
||||
}}
|
||||
>
|
||||
📞
|
||||
</div>
|
||||
|
||||
<p
|
||||
style={{
|
||||
margin: 0,
|
||||
fontSize: '15px',
|
||||
fontWeight: 500,
|
||||
color: subColor,
|
||||
lineHeight: '1.5',
|
||||
maxWidth: '280px',
|
||||
}}
|
||||
>
|
||||
{t('contactsModalEmpty')}
|
||||
</p>
|
||||
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
gap: '6px',
|
||||
marginTop: '24px',
|
||||
}}
|
||||
>
|
||||
{[0, 1, 2].map((i) => (
|
||||
<div
|
||||
key={i}
|
||||
style={{
|
||||
width: '6px',
|
||||
height: '6px',
|
||||
borderRadius: '50%',
|
||||
background: accentColor,
|
||||
opacity: 0.3 + i * 0.2,
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* ============ Кнопка "Понятно" ============ */}
|
||||
<button
|
||||
onClick={onClose}
|
||||
style={{
|
||||
width: '100%',
|
||||
marginTop: '16px',
|
||||
padding: '14px 20px',
|
||||
borderRadius: radius.md,
|
||||
border: 'none',
|
||||
background: `linear-gradient(135deg, ${accentColor}, #6B46C1)`,
|
||||
color: '#FFFFFF',
|
||||
fontSize: '15px',
|
||||
fontWeight: 700,
|
||||
cursor: 'pointer',
|
||||
boxShadow: `0 6px 20px ${accentColor}40`,
|
||||
WebkitTapHighlightColor: 'transparent',
|
||||
letterSpacing: '0.2px',
|
||||
}}
|
||||
onTouchStart={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(0.97)';
|
||||
}}
|
||||
onTouchEnd={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(1)';
|
||||
}}
|
||||
>
|
||||
{t('modalGotIt')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ContactsModal;
|
||||
@@ -0,0 +1,378 @@
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { useLanguage } from '../../i18n/LanguageContext';
|
||||
import { radius } from '../../styles/theme';
|
||||
|
||||
interface NewsModalProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
/** Флаг админа — приходит из MenuPage (уже есть в MenuPage) */
|
||||
isAdmin?: boolean;
|
||||
}
|
||||
|
||||
const NewsModal: React.FC<NewsModalProps> = ({ isOpen, onClose, isAdmin = false }) => {
|
||||
const { t } = useLanguage();
|
||||
const scrollRef = useRef<HTMLDivElement>(null);
|
||||
const [showAdminStub, setShowAdminStub] = useState(false);
|
||||
|
||||
const accentColor = '#E8B93F';
|
||||
const accentDark = '#CE9A1E';
|
||||
const textColor = '#1A1A2E';
|
||||
const subColor = '#6B7280';
|
||||
const cardBg = 'rgba(255,255,255,0.55)';
|
||||
|
||||
const glass = (extra: React.CSSProperties = {}): React.CSSProperties => ({
|
||||
background: cardBg,
|
||||
backdropFilter: 'blur(24px) saturate(180%)',
|
||||
WebkitBackdropFilter: 'blur(24px) saturate(180%)',
|
||||
border: '1px solid rgba(255,255,255,0.7)',
|
||||
boxShadow: '0 8px 32px rgba(31,38,73,0.10), inset 0 1px 0 rgba(255,255,255,0.85)',
|
||||
...extra,
|
||||
});
|
||||
|
||||
// Сброс скролла и админ-заглушки при каждом открытии
|
||||
useEffect(() => {
|
||||
if (isOpen) {
|
||||
if (scrollRef.current) scrollRef.current.scrollTop = 0;
|
||||
setShowAdminStub(false);
|
||||
}
|
||||
}, [isOpen]);
|
||||
|
||||
// Escape
|
||||
useEffect(() => {
|
||||
if (!isOpen) return;
|
||||
const handleKey = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape') onClose();
|
||||
};
|
||||
window.addEventListener('keydown', handleKey);
|
||||
return () => window.removeEventListener('keydown', handleKey);
|
||||
}, [isOpen, onClose]);
|
||||
|
||||
if (!isOpen) return null;
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
position: 'fixed',
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
background: 'rgba(20,22,35,0.35)',
|
||||
zIndex: 1000,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
padding: '20px',
|
||||
backdropFilter: 'blur(6px)',
|
||||
WebkitBackdropFilter: 'blur(6px)',
|
||||
animation: 'newsFadeIn 0.2s ease',
|
||||
}}
|
||||
onClick={(e) => {
|
||||
if (e.target === e.currentTarget) onClose();
|
||||
}}
|
||||
>
|
||||
<style>{`
|
||||
@keyframes newsFadeIn {
|
||||
0% { opacity: 0; }
|
||||
100% { opacity: 1; }
|
||||
}
|
||||
@keyframes newsSlideUp {
|
||||
0% { transform: translateY(20px); opacity: 0; }
|
||||
100% { transform: translateY(0); opacity: 1; }
|
||||
}
|
||||
@keyframes newsPopIn {
|
||||
0% { transform: scale(0.4); opacity: 0; }
|
||||
60% { transform: scale(1.1); opacity: 1; }
|
||||
100% { transform: scale(1); opacity: 1; }
|
||||
}
|
||||
@keyframes newsFloat {
|
||||
0%, 100% { transform: translateY(0); }
|
||||
50% { transform: translateY(-6px); }
|
||||
}
|
||||
`}</style>
|
||||
|
||||
<div
|
||||
ref={scrollRef}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
style={{
|
||||
...glass({
|
||||
borderRadius: radius.lg,
|
||||
padding: '24px',
|
||||
width: '100%',
|
||||
maxWidth: '400px',
|
||||
maxHeight: '80vh',
|
||||
overflowY: 'auto',
|
||||
boxShadow: '0 24px 60px rgba(31,38,73,0.25), inset 0 1px 0 rgba(255,255,255,0.85)',
|
||||
}),
|
||||
animation: 'newsSlideUp 0.3s ease',
|
||||
}}
|
||||
>
|
||||
{/* ============ Заголовок ============ */}
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
marginBottom: '20px',
|
||||
paddingBottom: '14px',
|
||||
borderBottom: '1px solid rgba(0,0,0,0.06)',
|
||||
gap: '8px',
|
||||
}}
|
||||
>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: '10px', minWidth: 0 }}>
|
||||
{/* 🔧 ФИКС iOS 27: lineHeight 1.2 для эмодзи в заголовке */}
|
||||
<span style={{ fontSize: '24px', flexShrink: 0, lineHeight: '1.2', display: 'inline-block' }}>📰</span>
|
||||
<h3
|
||||
style={{
|
||||
margin: 0,
|
||||
fontSize: '18px',
|
||||
fontWeight: 800,
|
||||
color: textColor,
|
||||
letterSpacing: '-0.2px',
|
||||
whiteSpace: 'nowrap',
|
||||
overflow: 'hidden',
|
||||
textOverflow: 'ellipsis',
|
||||
}}
|
||||
>
|
||||
{t('newsModalTitle')}
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div style={{ display: 'flex', gap: '6px', flexShrink: 0 }}>
|
||||
{/* ➕ Кнопка добавления — только админу */}
|
||||
{isAdmin && !showAdminStub && (
|
||||
<button
|
||||
onClick={() => setShowAdminStub(true)}
|
||||
aria-label="Add news"
|
||||
title="Add news"
|
||||
style={{
|
||||
...glass({
|
||||
padding: '8px 12px',
|
||||
borderRadius: radius.sm,
|
||||
}),
|
||||
color: accentDark,
|
||||
fontSize: '16px',
|
||||
fontWeight: 800,
|
||||
cursor: 'pointer',
|
||||
WebkitTapHighlightColor: 'transparent',
|
||||
lineHeight: '1.2', // 🔧 ФИКС iOS 27
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
minHeight: '36px',
|
||||
}}
|
||||
onTouchStart={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(0.9)';
|
||||
}}
|
||||
onTouchEnd={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(1)';
|
||||
}}
|
||||
>
|
||||
➕
|
||||
</button>
|
||||
)}
|
||||
|
||||
{/* Кнопка закрытия */}
|
||||
<button
|
||||
onClick={onClose}
|
||||
aria-label="Close"
|
||||
style={{
|
||||
...glass({
|
||||
padding: '8px 14px',
|
||||
borderRadius: radius.sm,
|
||||
}),
|
||||
color: textColor,
|
||||
fontSize: '14px',
|
||||
fontWeight: 600,
|
||||
cursor: 'pointer',
|
||||
WebkitTapHighlightColor: 'transparent',
|
||||
}}
|
||||
onTouchStart={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(0.9)';
|
||||
}}
|
||||
onTouchEnd={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(1)';
|
||||
}}
|
||||
>
|
||||
✕
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* ============ Админ-заглушка (по кнопке ➕) ============ */}
|
||||
{showAdminStub ? (
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
padding: '32px 16px',
|
||||
textAlign: 'center',
|
||||
animation: 'newsPopIn 0.3s ease',
|
||||
}}
|
||||
>
|
||||
{/* 🔧 ФИКС iOS 27: lineHeight 1.2 + padding для эмодзи 56px */}
|
||||
<div
|
||||
style={{
|
||||
fontSize: '56px',
|
||||
lineHeight: '1.2',
|
||||
padding: '8px 0',
|
||||
marginBottom: '16px',
|
||||
filter: `drop-shadow(0 8px 20px ${accentColor}40)`,
|
||||
userSelect: 'none',
|
||||
display: 'inline-block',
|
||||
}}
|
||||
>
|
||||
🛠️
|
||||
</div>
|
||||
|
||||
<div
|
||||
style={{
|
||||
fontSize: '14px',
|
||||
fontWeight: 700,
|
||||
color: accentDark,
|
||||
marginBottom: '8px',
|
||||
textTransform: 'uppercase',
|
||||
letterSpacing: '0.5px',
|
||||
}}
|
||||
>
|
||||
Admin mode
|
||||
</div>
|
||||
|
||||
<p
|
||||
style={{
|
||||
margin: 0,
|
||||
fontSize: '14px',
|
||||
fontWeight: 500,
|
||||
color: subColor,
|
||||
lineHeight: '1.5',
|
||||
maxWidth: '280px',
|
||||
}}
|
||||
>
|
||||
News management is coming soon.
|
||||
</p>
|
||||
|
||||
<button
|
||||
onClick={() => setShowAdminStub(false)}
|
||||
style={{
|
||||
marginTop: '20px',
|
||||
padding: '10px 20px',
|
||||
borderRadius: radius.md,
|
||||
border: `1px solid ${accentColor}40`,
|
||||
background: `${accentColor}15`,
|
||||
color: accentDark,
|
||||
fontSize: '13px',
|
||||
fontWeight: 700,
|
||||
cursor: 'pointer',
|
||||
WebkitTapHighlightColor: 'transparent',
|
||||
}}
|
||||
onTouchStart={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(0.96)';
|
||||
}}
|
||||
onTouchEnd={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(1)';
|
||||
}}
|
||||
>
|
||||
← {t('back')}
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
/* ============ Пустое состояние для всех ============ */
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
padding: '32px 16px',
|
||||
textAlign: 'center',
|
||||
}}
|
||||
>
|
||||
{/* 🔧 ФИКС iOS 27: lineHeight 1.2 + padding для большого эмодзи */}
|
||||
<div
|
||||
style={{
|
||||
fontSize: '64px',
|
||||
lineHeight: '1.2',
|
||||
padding: '8px 0',
|
||||
marginBottom: '20px',
|
||||
animation: 'newsPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), newsFloat 3s ease-in-out 0.5s infinite',
|
||||
filter: `drop-shadow(0 8px 20px ${accentColor}40)`,
|
||||
userSelect: 'none',
|
||||
display: 'inline-block',
|
||||
}}
|
||||
>
|
||||
📰
|
||||
</div>
|
||||
|
||||
<p
|
||||
style={{
|
||||
margin: 0,
|
||||
fontSize: '15px',
|
||||
fontWeight: 500,
|
||||
color: subColor,
|
||||
lineHeight: '1.5',
|
||||
maxWidth: '280px',
|
||||
}}
|
||||
>
|
||||
{t('newsModalEmpty')}
|
||||
</p>
|
||||
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
gap: '6px',
|
||||
marginTop: '24px',
|
||||
}}
|
||||
>
|
||||
{[0, 1, 2].map((i) => (
|
||||
<div
|
||||
key={i}
|
||||
style={{
|
||||
width: '6px',
|
||||
height: '6px',
|
||||
borderRadius: '50%',
|
||||
background: accentColor,
|
||||
opacity: 0.3 + i * 0.2,
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* ============ Кнопка "Понятно" — только когда не админ-заглушка ============ */}
|
||||
{!showAdminStub && (
|
||||
<button
|
||||
onClick={onClose}
|
||||
style={{
|
||||
width: '100%',
|
||||
marginTop: '16px',
|
||||
padding: '14px 20px',
|
||||
borderRadius: radius.md,
|
||||
border: 'none',
|
||||
background: `linear-gradient(135deg, ${accentColor}, ${accentDark})`,
|
||||
color: '#FFFFFF',
|
||||
fontSize: '15px',
|
||||
fontWeight: 700,
|
||||
cursor: 'pointer',
|
||||
boxShadow: `0 6px 20px ${accentColor}40`,
|
||||
WebkitTapHighlightColor: 'transparent',
|
||||
letterSpacing: '0.2px',
|
||||
}}
|
||||
onTouchStart={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(0.97)';
|
||||
}}
|
||||
onTouchEnd={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(1)';
|
||||
}}
|
||||
>
|
||||
{t('modalGotIt')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default NewsModal;
|
||||
@@ -0,0 +1,248 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { useLanguage } from '../../i18n/LanguageContext';
|
||||
import { radius } from '../../styles/theme';
|
||||
|
||||
interface PartnersModalProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
const PartnersModal: React.FC<PartnersModalProps> = ({ isOpen, onClose }) => {
|
||||
const { t } = useLanguage();
|
||||
const scrollRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const brandColor = '#2ECC71';
|
||||
const textColor = '#1A1A2E';
|
||||
const subColor = '#6B7280';
|
||||
const cardBg = 'rgba(255,255,255,0.55)';
|
||||
|
||||
const glass = (extra: React.CSSProperties = {}): React.CSSProperties => ({
|
||||
background: cardBg,
|
||||
backdropFilter: 'blur(24px) saturate(180%)',
|
||||
WebkitBackdropFilter: 'blur(24px) saturate(180%)',
|
||||
border: '1px solid rgba(255,255,255,0.7)',
|
||||
boxShadow: '0 8px 32px rgba(31,38,73,0.10), inset 0 1px 0 rgba(255,255,255,0.85)',
|
||||
...extra,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpen && scrollRef.current) {
|
||||
scrollRef.current.scrollTop = 0;
|
||||
}
|
||||
}, [isOpen]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isOpen) return;
|
||||
const handleKey = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape') onClose();
|
||||
};
|
||||
window.addEventListener('keydown', handleKey);
|
||||
return () => window.removeEventListener('keydown', handleKey);
|
||||
}, [isOpen, onClose]);
|
||||
|
||||
if (!isOpen) return null;
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
position: 'fixed',
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
background: 'rgba(20,22,35,0.35)',
|
||||
zIndex: 1000,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
padding: '20px',
|
||||
backdropFilter: 'blur(6px)',
|
||||
WebkitBackdropFilter: 'blur(6px)',
|
||||
animation: 'partnersFadeIn 0.2s ease',
|
||||
}}
|
||||
onClick={(e) => {
|
||||
if (e.target === e.currentTarget) onClose();
|
||||
}}
|
||||
>
|
||||
<style>{`
|
||||
@keyframes partnersFadeIn {
|
||||
0% { opacity: 0; }
|
||||
100% { opacity: 1; }
|
||||
}
|
||||
@keyframes partnersSlideUp {
|
||||
0% { transform: translateY(20px); opacity: 0; }
|
||||
100% { transform: translateY(0); opacity: 1; }
|
||||
}
|
||||
@keyframes partnersPopIn {
|
||||
0% { transform: scale(0.4); opacity: 0; }
|
||||
60% { transform: scale(1.1); opacity: 1; }
|
||||
100% { transform: scale(1); opacity: 1; }
|
||||
}
|
||||
@keyframes partnersFloat {
|
||||
0%, 100% { transform: translateY(0); }
|
||||
50% { transform: translateY(-6px); }
|
||||
}
|
||||
`}</style>
|
||||
|
||||
<div
|
||||
ref={scrollRef}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
style={{
|
||||
...glass({
|
||||
borderRadius: radius.lg,
|
||||
padding: '24px',
|
||||
width: '100%',
|
||||
maxWidth: '400px',
|
||||
maxHeight: '80vh',
|
||||
overflowY: 'auto',
|
||||
boxShadow: '0 24px 60px rgba(31,38,73,0.25), inset 0 1px 0 rgba(255,255,255,0.85)',
|
||||
}),
|
||||
animation: 'partnersSlideUp 0.3s ease',
|
||||
}}
|
||||
>
|
||||
{/* ============ Заголовок ============ */}
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
marginBottom: '20px',
|
||||
paddingBottom: '14px',
|
||||
borderBottom: '1px solid rgba(0,0,0,0.06)',
|
||||
}}
|
||||
>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
|
||||
{/* 🔧 ФИКС iOS 27: lineHeight 1.2 для эмодзи в заголовке */}
|
||||
<span style={{ fontSize: '24px', lineHeight: '1.2', display: 'inline-block' }}>🤝</span>
|
||||
<h3
|
||||
style={{
|
||||
margin: 0,
|
||||
fontSize: '18px',
|
||||
fontWeight: 800,
|
||||
color: textColor,
|
||||
letterSpacing: '-0.2px',
|
||||
}}
|
||||
>
|
||||
{t('partnersModalTitle')}
|
||||
</h3>
|
||||
</div>
|
||||
<button
|
||||
onClick={onClose}
|
||||
aria-label="Close"
|
||||
style={{
|
||||
...glass({
|
||||
padding: '8px 14px',
|
||||
borderRadius: radius.sm,
|
||||
}),
|
||||
color: textColor,
|
||||
fontSize: '14px',
|
||||
fontWeight: 600,
|
||||
cursor: 'pointer',
|
||||
WebkitTapHighlightColor: 'transparent',
|
||||
}}
|
||||
onTouchStart={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(0.9)';
|
||||
}}
|
||||
onTouchEnd={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(1)';
|
||||
}}
|
||||
>
|
||||
✕
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* ============ Пустое состояние ============ */}
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
padding: '32px 16px',
|
||||
textAlign: 'center',
|
||||
}}
|
||||
>
|
||||
{/* 🔧 ФИКС iOS 27: lineHeight 1.2 + padding для большого эмодзи */}
|
||||
<div
|
||||
style={{
|
||||
fontSize: '64px',
|
||||
lineHeight: '1.2',
|
||||
padding: '8px 0',
|
||||
marginBottom: '20px',
|
||||
animation: 'partnersPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), partnersFloat 3s ease-in-out 0.5s infinite',
|
||||
filter: `drop-shadow(0 8px 20px ${brandColor}40)`,
|
||||
userSelect: 'none',
|
||||
display: 'inline-block',
|
||||
}}
|
||||
>
|
||||
🤝
|
||||
</div>
|
||||
|
||||
<p
|
||||
style={{
|
||||
margin: 0,
|
||||
fontSize: '15px',
|
||||
fontWeight: 500,
|
||||
color: subColor,
|
||||
lineHeight: '1.5',
|
||||
maxWidth: '280px',
|
||||
}}
|
||||
>
|
||||
{t('partnersModalEmpty')}
|
||||
</p>
|
||||
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
gap: '6px',
|
||||
marginTop: '24px',
|
||||
}}
|
||||
>
|
||||
{[0, 1, 2].map((i) => (
|
||||
<div
|
||||
key={i}
|
||||
style={{
|
||||
width: '6px',
|
||||
height: '6px',
|
||||
borderRadius: '50%',
|
||||
background: brandColor,
|
||||
opacity: 0.3 + i * 0.2,
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* ============ Кнопка "Понятно" ============ */}
|
||||
<button
|
||||
onClick={onClose}
|
||||
style={{
|
||||
width: '100%',
|
||||
marginTop: '16px',
|
||||
padding: '14px 20px',
|
||||
borderRadius: radius.md,
|
||||
border: 'none',
|
||||
background: `linear-gradient(135deg, ${brandColor}, #27AE60)`,
|
||||
color: '#FFFFFF',
|
||||
fontSize: '15px',
|
||||
fontWeight: 700,
|
||||
cursor: 'pointer',
|
||||
boxShadow: `0 6px 20px ${brandColor}40`,
|
||||
WebkitTapHighlightColor: 'transparent',
|
||||
letterSpacing: '0.2px',
|
||||
}}
|
||||
onTouchStart={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(0.97)';
|
||||
}}
|
||||
onTouchEnd={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(1)';
|
||||
}}
|
||||
>
|
||||
{t('modalGotIt')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PartnersModal;
|
||||
Reference in New Issue
Block a user