133 lines
5.8 KiB
Rust
133 lines
5.8 KiB
Rust
use yew::prelude::*;
|
|
use crate::components::{Inbox, ResidenceCard, ResidenceStatus};
|
|
use crate::routing::ViewContext;
|
|
|
|
#[derive(Properties, PartialEq)]
|
|
pub struct HomeViewProps {
|
|
pub context: ViewContext,
|
|
}
|
|
|
|
#[function_component(HomeView)]
|
|
pub fn home_view(props: &HomeViewProps) -> Html {
|
|
// Mock user data - in a real app this would come from authentication/user context
|
|
let user_name = "Timur Gordon".to_string();
|
|
let user_email = Some("timur@example.com".to_string());
|
|
|
|
html! {
|
|
<>
|
|
<style>
|
|
{r#"
|
|
.welcome-section {
|
|
background: linear-gradient(135deg, rgba(0,153,255,0.05) 0%, rgba(0,204,102,0.05) 100%);
|
|
border-radius: 16px;
|
|
border: 1px solid rgba(0,153,255,0.1);
|
|
}
|
|
.greeting-card {
|
|
border: 1px solid #e9ecef;
|
|
border-radius: 12px;
|
|
transition: all 0.2s ease;
|
|
}
|
|
.greeting-card:hover {
|
|
border-color: #dee2e6;
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
|
|
}
|
|
.time-badge {
|
|
background: linear-gradient(135deg, #0099FF 0%, #00CC66 100%);
|
|
color: white;
|
|
padding: 4px 12px;
|
|
border-radius: 20px;
|
|
font-size: 0.8rem;
|
|
font-weight: 500;
|
|
}
|
|
.stats-item {
|
|
text-align: center;
|
|
padding: 1rem;
|
|
border-radius: 8px;
|
|
background: #f8f9fa;
|
|
transition: all 0.2s ease;
|
|
}
|
|
.stats-item:hover {
|
|
background: #e9ecef;
|
|
transform: translateY(-2px);
|
|
}
|
|
.stats-number {
|
|
font-size: 1.5rem;
|
|
font-weight: 700;
|
|
color: #0d6efd;
|
|
}
|
|
.stats-label {
|
|
font-size: 0.8rem;
|
|
color: #6c757d;
|
|
font-weight: 500;
|
|
}
|
|
"#}
|
|
</style>
|
|
|
|
<div class="container-fluid py-4 px-3 px-md-4 px-lg-5 px-xl-6">
|
|
<div class="row g-4">
|
|
// Left Column: Greeting and Inbox
|
|
<div class="col-lg-6">
|
|
// Welcome Section
|
|
<div class="welcome-section p-4 mb-4">
|
|
<div class="d-flex align-items-center justify-content-between mb-3">
|
|
<div>
|
|
<h1 class="h3 mb-1 fw-bold text-dark">
|
|
{"Hello, "}{&user_name}{"! 👋"}
|
|
</h1>
|
|
<p class="text-muted mb-0">
|
|
{"Welcome back to your Digital Freezone dashboard"}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
// Quick Actions
|
|
<div class="row g-3 mb-3">
|
|
<div class="col-4">
|
|
<a href="/companies/register" class="text-decoration-none">
|
|
<div class="stats-item">
|
|
<i class="bi bi-building-add text-primary mb-2" style="font-size: 1.5rem;"></i>
|
|
<div class="stats-label">{"Register Company"}</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
<div class="col-4">
|
|
<a href="/governance" class="text-decoration-none">
|
|
<div class="stats-item">
|
|
<i class="bi bi-hand-thumbs-up text-success mb-2" style="font-size: 1.5rem;"></i>
|
|
<div class="stats-label">{"Vote on Proposals"}</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
<div class="col-4">
|
|
<a href="/treasury" class="text-decoration-none">
|
|
<div class="stats-item">
|
|
<i class="bi bi-wallet2 text-info mb-2" style="font-size: 1.5rem;"></i>
|
|
<div class="stats-label">{"Manage Wallet"}</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
// Inbox Component
|
|
<Inbox />
|
|
</div>
|
|
|
|
// Right Column: Residence Card
|
|
<div class="col-lg-6">
|
|
<div class="d-flex align-items-center justify-content-center h-100">
|
|
<ResidenceCard
|
|
user_name={user_name}
|
|
email={user_email}
|
|
public_key={Some("zdf1qxy2mlyjkjkpskpsw9fxtpugs450add72nyktmzqau...".to_string())}
|
|
resident_id={Some("ZDF-2025-0001".to_string())}
|
|
status={ResidenceStatus::Active}
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</>
|
|
}
|
|
} |