feat: modal windows
This commit is contained in:
@@ -11,6 +11,7 @@ import { StatStrip } from '../components/StatStrip';
|
||||
import { DeviceCard } from '../components/DeviceCard';
|
||||
import { Modal } from '../components/Modal';
|
||||
import { SubscriptionQrModal } from '../components/SubscriptionQrModal';
|
||||
import { ClientLinksModal } from '../components/ClientLinksModal';
|
||||
import type { Device, SubscriptionData, UserInfo } from '../types';
|
||||
|
||||
export function AccountPage() {
|
||||
@@ -25,6 +26,7 @@ export function AccountPage() {
|
||||
const [pending, setPending] = useState<Device | null>(null);
|
||||
const [isQrOpen, setIsQrOpen] = useState(false);
|
||||
const [isReferralQrOpen, setIsReferralQrOpen] = useState(false);
|
||||
const [isClientLinksOpen, setIsClientLinksOpen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isAuthenticated) {
|
||||
@@ -114,7 +116,7 @@ export function AccountPage() {
|
||||
|
||||
{loadingMeta ? (
|
||||
<div className="profile">
|
||||
{Array.from({ length: 4 }).map((_, i) => (
|
||||
{Array.from({ length: 5 }).map((_, i) => (
|
||||
<div className="stat" key={i}>
|
||||
<Skeleton width="34px" height="34px" radius="50%" />
|
||||
<Skeleton width="80px" height="10px" />
|
||||
@@ -234,9 +236,14 @@ export function AccountPage() {
|
||||
</svg>
|
||||
</div>
|
||||
<div className="devices-empty-title">Нет подключённых устройств</div>
|
||||
<div className="devices-empty-sub">
|
||||
Установите Malenia на устройство и подключите его к этому аккаунту.
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
className="devices-empty-help"
|
||||
aria-label="Показать клиенты для подключения"
|
||||
onClick={() => setIsClientLinksOpen(true)}
|
||||
>
|
||||
?
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
<div className="device-grid">
|
||||
@@ -278,6 +285,7 @@ export function AccountPage() {
|
||||
imageAlt="QR-код реферальной ссылки"
|
||||
onClose={() => setIsReferralQrOpen(false)}
|
||||
/>
|
||||
<ClientLinksModal open={isClientLinksOpen} onClose={() => setIsClientLinksOpen(false)} />
|
||||
</Shell>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user