-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Notifications view, routing, system monitor view, and node setu…
…p flow (#172) and Modal manager (#175) * added notification icon * added shadow and checked * added notification item * notifications view * added notifications wrapper to handle data * check if notifications are read, change button state * localStorage notifications working * added various notification methods * disabled notification api for now * add route files, reset package.json to start fresh * RN modules now working, but issue parsing TS in JS files in RN deps * revert all changes * react-router-dom working * fixed containers, buttons, prepping for splash * fixed button * clean, added step * added no node view, moved NodeScreen * added NodeSetup route, modified modal for initial and during app * removed displayNotification for now * moved logs into route * feat: Modal manager (#175) * modalManager working using context * added modal state using react-redux * moved modals into modalManager * additional adjustments on tabs, to support new modal * modal save preferences working * decouple nodeDir window and saving new nodeDir, start work on modal config manager * moved view related logic into modal for easier testing * add disableButton * node stepper finally working * added alert style, converted removenode * disable done button until docker is complete * AddEthereumNode now works for both modal and initial setup * fixed node select and remove node display * improved initial render * capture all settings on initial render so they can be saved when button is pressed * now only adds keys if not found, wont overwrite * fixes onChange input behavior on initial render of the screen * moved backend calls into modal components * moved common const, type, func into modalUtils * added min height/width to electron, moved modal files * modified modal layouts * adjusted modal, added scroll bar dark/light mode * added node reqs to add node modal flow * differentiate modalOnClose and modalOnCancel --------- Co-authored-by: Johns Gresham <[email protected]>
- Loading branch information
1 parent
2aa3e5d
commit 84e8358
Showing
98 changed files
with
2,728 additions
and
1,018 deletions.
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
export const NOTIFICATIONS = Object.freeze({ | ||
info: { | ||
SYNC_COMMITTEE: { | ||
title: 'Scheduled for Sync Commitee Duty', | ||
description: 'Validator', | ||
}, | ||
SLASH_REWARD: { | ||
title: 'Reward for slashing another validator', | ||
description: 'Validator', | ||
}, | ||
}, | ||
completed: { | ||
CLIENT_UPDATED: { | ||
title: 'Client successfuly updated', | ||
description: 'consensus client', | ||
}, | ||
}, | ||
download: { | ||
UPDATE_AVAILABLE: { | ||
title: 'Client successfuly updated', | ||
description: 'consensus client', | ||
}, | ||
}, | ||
}); |
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
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,57 @@ | ||
// import { Notification } from 'electron'; | ||
|
||
export type NotificationType = { | ||
unread: boolean; | ||
status: string; | ||
title: string; | ||
description: string; | ||
timestamp: number; | ||
}; | ||
|
||
export const displayNotification = () => { | ||
// new Notification({ | ||
// title, | ||
// body, | ||
// }).show(); | ||
}; | ||
|
||
export const getNotifications = () => { | ||
if (!localStorage.getItem('notifications')) { | ||
localStorage.setItem('notifications', JSON.stringify([])); | ||
} | ||
return JSON.parse(localStorage.getItem('notifications') || ''); | ||
}; | ||
|
||
export const removeNotifications = () => { | ||
localStorage.setItem('notifications', JSON.stringify([])); | ||
return []; | ||
}; | ||
|
||
export const addNotification = (notification: NotificationType) => { | ||
const notifications = getNotifications(); | ||
notifications.push(notification); | ||
|
||
localStorage.setItem('notifications', JSON.stringify(notifications)); | ||
}; | ||
|
||
export const addNotifications = (notifications: NotificationType[]) => { | ||
notifications.forEach((notification: NotificationType) => { | ||
addNotification(notification); | ||
}); | ||
}; | ||
|
||
export const markAllAsRead = () => { | ||
const notifications = JSON.parse(localStorage.getItem('notifications') || ''); | ||
|
||
notifications.forEach((notification: NotificationType) => { | ||
notification.unread = false; | ||
}); | ||
|
||
localStorage.setItem('notifications', JSON.stringify(notifications)); | ||
|
||
return notifications; | ||
}; | ||
|
||
export const initialize = async () => { | ||
console.log('test initialize'); | ||
}; |
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
Oops, something went wrong.