From 5f27d7d2f8a88826d8d842d27366c1f24f43ab16 Mon Sep 17 00:00:00 2001 From: Ivana Andersson Date: Wed, 27 Sep 2023 11:40:33 +0300 Subject: [PATCH] feat: add alerts and logs components on right sidebar --- .../Dashboard/RightSideBar/RightSidebar.tsx | 71 +++++++++++++++++-- .../RightSideBar/ValidatorListItem.tsx | 38 +++++----- 2 files changed, 83 insertions(+), 26 deletions(-) diff --git a/src/pages/Dashboard/RightSideBar/RightSidebar.tsx b/src/pages/Dashboard/RightSideBar/RightSidebar.tsx index e9e35aa3..7ba6a713 100644 --- a/src/pages/Dashboard/RightSideBar/RightSidebar.tsx +++ b/src/pages/Dashboard/RightSideBar/RightSidebar.tsx @@ -1,8 +1,8 @@ -import { Avatar, Tabs, Text } from '@status-im/components' +import { Avatar, InformationBox, Tabs, Text } from '@status-im/components' import { XStack, YStack } from 'tamagui' import ValidatorListItem from './ValidatorListItem' import InputSearch from './SearchInput' -// import { NodeIcon } from '@status-im/icons' +import { CloseCircleIcon, ChevronRightIcon } from '@status-im/icons' const RightSidebar = () => { return ( @@ -34,18 +34,77 @@ const RightSidebar = () => { Inactive - + - + - - + + + + + + + + + + + Alerts + +
+ +
+
+ } + variant="default" + onClosePress={() => alert('dismissed')} + /> + } + variant="information" + onClosePress={() => alert('dismissed')} + /> + } + variant="error" + onClosePress={() => alert('dismissed')} + /> +
+ + + + + Logs + +
+ +
+
+ } + variant="default" + /> + } + variant="default" + /> + } + variant="default" + /> +
) } diff --git a/src/pages/Dashboard/RightSideBar/ValidatorListItem.tsx b/src/pages/Dashboard/RightSideBar/ValidatorListItem.tsx index 17e78ff7..60737660 100644 --- a/src/pages/Dashboard/RightSideBar/ValidatorListItem.tsx +++ b/src/pages/Dashboard/RightSideBar/ValidatorListItem.tsx @@ -1,23 +1,23 @@ -import { useState } from 'react'; -import { XStack, YStack } from 'tamagui'; -import { Avatar, Checkbox, Text } from '@status-im/components'; -import { VerifiedIcon, ContactIcon } from '@status-im/icons'; +import { useState } from 'react' +import { XStack, YStack } from 'tamagui' +import { Avatar, Checkbox, Text } from '@status-im/components' +import { VerifiedIcon, ContactIcon } from '@status-im/icons' type ValidatorListItemProps = { - name: string; - avatarKey: string; - selected?: boolean; -}; + name: string + avatarKey: string + selected?: boolean +} const ValidatorListItem = ({ name, avatarKey, selected }: ValidatorListItemProps) => { - const [hovered, setHovered] = useState(false); - const [isSelected, setIsSelected] = useState(selected); + const [hovered, setHovered] = useState(false) + const [isSelected, setIsSelected] = useState(selected) - const handleMouseEnter = () => setHovered(true); - const handleMouseLeave = () => setHovered(false); - const handleClick = () => setIsSelected(!isSelected); + const handleMouseEnter = () => setHovered(true) + const handleMouseLeave = () => setHovered(false) + const handleClick = () => setIsSelected(!isSelected) - const backgroundColor = isSelected || hovered ? 'rgba(42, 74, 245, 0.05)' : 'transparent'; + const backgroundColor = isSelected || hovered ? 'rgba(42, 74, 245, 0.05)' : 'transparent' return ( {avatarKey} - {isSelected && - - } + {isSelected && } - ); + ) } -export default ValidatorListItem; +export default ValidatorListItem