init profile routing

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2024-10-10 17:20:18 -04:00
parent 54dcbd724b
commit 44948fdff0
9 changed files with 182 additions and 23 deletions

View File

@@ -17,6 +17,7 @@ pub enum Route {
Relays,
ComposeNote,
AddColumn,
Profile(TimelineId),
}
#[derive(Clone)]
@@ -96,6 +97,12 @@ impl Route {
},
Route::ComposeNote => "Compose Note".to_owned(),
Route::AddColumn => "Add Column".to_owned(),
Route::Profile(id) => {
let timeline = columns
.find_timeline(*id)
.expect("expected to find timeline");
timeline.kind.to_title(ndb)
}
};
TitledRoute {
@@ -203,6 +210,7 @@ impl fmt::Display for Route {
Route::ComposeNote => write!(f, "Compose Note"),
Route::AddColumn => write!(f, "Add Column"),
Route::Profile(_) => write!(f, "Profile"),
}
}
}