-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0a49d79
commit f448ef6
Showing
5 changed files
with
160 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ pub mod post; | |
pub mod post_delete; | ||
pub mod post_edit; | ||
pub mod vote; | ||
pub mod notifications; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
use crate::{icons::icons::BellIcon, store::Store}; | ||
use stylist::Style; | ||
use yew::{function_component, html, use_state, Callback, Html, Properties}; | ||
use yew_router::hooks::use_location; | ||
use yewdux::use_store_value; | ||
|
||
const STYLE: &str = include_str!("styles/notifications.css"); | ||
|
||
#[derive(Properties, PartialEq)] | ||
pub struct Props { | ||
pub bell_display: String, | ||
pub bell_clicked: bool, | ||
pub menu_clicked: bool, | ||
} | ||
|
||
#[function_component(Notifications)] | ||
pub fn notifications() -> Html { | ||
let style = Style::new(STYLE).unwrap(); | ||
let store = use_store_value::<Store>(); | ||
let menu_clicked = use_state(|| false); | ||
let bell_display = use_state(|| "none".to_string()); | ||
let location = use_location(); | ||
|
||
let on_menu_click = || Callback::from(move |_| {}); | ||
|
||
let on_bell_click = || Callback::from(move |_| {}); | ||
|
||
html! { | ||
if store.authenticated { | ||
<div class={style}> | ||
<div class="notification-drop-down"> | ||
|
||
<span> | ||
<BellIcon /> | ||
</span> | ||
|
||
<span class="notification-count">{"length"}</span> | ||
<div class="notifications"> | ||
// notifications map | ||
<div class=""> | ||
<span></span> | ||
<div class="notification-txt"> | ||
<span>{" posted"}</span> | ||
<span>{" dismiss"}</span> | ||
</div> | ||
</div> | ||
// | ||
</div> | ||
</div> | ||
</div> | ||
} | ||
} | ||
} |
96 changes: 96 additions & 0 deletions
96
devblog/devblog/client/src/components/styles/notifications.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
.notification-icon { | ||
opacity: 0.8; | ||
} | ||
|
||
.notification-drop-down { | ||
font-size: 35px; | ||
margin-top: 23px; | ||
margin-right: 10px; | ||
z-index: 21; | ||
} | ||
|
||
.notifications { | ||
display: flex; | ||
font-family: 'Chivo Mono', monospace; | ||
flex-direction: column; | ||
font-size: 15px; | ||
right: 10px; | ||
background-color: rgb(26, 32, 41); | ||
position: absolute; | ||
padding: 10px 4px; | ||
} | ||
|
||
.notification-count { | ||
background-color: red; | ||
font-family: 'Chivo Mono', monospace; | ||
font-size: 13px; | ||
position: absolute; | ||
border-radius: 50%; | ||
padding: 5px; | ||
line-height: 8px; | ||
right: 118px; | ||
} | ||
|
||
.notifications img { | ||
height: 50px; | ||
width: 60px; | ||
border-radius: 0%; | ||
} | ||
|
||
.notifications>div { | ||
border-top: 1px solid gray; | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
|
||
.notification-txt { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.notification-txt>span:last-child { | ||
font-size: 12px; | ||
opacity: 0.8; | ||
margin-left: 10px; | ||
} | ||
|
||
.notification-txt span:first-child { | ||
padding: 4px; | ||
opacity: 0.8; | ||
text-decoration: none; | ||
} | ||
|
||
|
||
.notification-icon:hover, | ||
.notification-txt>span:last-child:hover, | ||
.notification-txt span:hover { | ||
opacity: 1.0; | ||
cursor: pointer; | ||
} | ||
|
||
.notification-item { | ||
transition: all 0.3s ease-in; | ||
} | ||
|
||
.dismissed { | ||
transform: translateX(100%); | ||
opacity: 0; | ||
} | ||
|
||
/* @media(max-width: 450px) { | ||
.notifications { | ||
right: 1px; | ||
} | ||
.notification-drop-down { | ||
font-size: 25px; | ||
margin-top: 19px; | ||
} | ||
.notification-count { | ||
right: 92px; | ||
font-size: 10px; | ||
line-height: 6px; | ||
padding: 4px; | ||
} | ||
} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters