Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Identity page #327

Draft
wants to merge 82 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
4ec86e5
Initializing the Identity page update
alexeyandreevsky Nov 26, 2024
a506a84
Create AliasList and add new fields to IdentityTotalCard
alexeyandreevsky Nov 26, 2024
b6521c9
Merge branch 'develop' into feat/identity-page
alexeyandreevsky Dec 2, 2024
33ff1b3
Create IdentityDigestCard component
alexeyandreevsky Dec 3, 2024
24f1123
Create AliasesList component
alexeyandreevsky Dec 3, 2024
6855c5a
Update IdentityDigestCard styles
alexeyandreevsky Dec 3, 2024
4a898f2
Update lists paddings on Identity page
alexeyandreevsky Dec 3, 2024
4ceb243
Fix tabs content
alexeyandreevsky Dec 3, 2024
cbaa4bf
Update Data contracts list
alexeyandreevsky Dec 4, 2024
df93ede
Update DateBlock format
alexeyandreevsky Dec 4, 2024
826b8ea
Update size of avatar in lists
alexeyandreevsky Dec 4, 2024
86d0658
Update IdentityDigestCard
alexeyandreevsky Dec 4, 2024
72c3413
Initialize PublicKeysList component
alexeyandreevsky Dec 4, 2024
10fd09d
Update PublicKeysList titles styles
alexeyandreevsky Dec 4, 2024
f99228a
Implement the colorScheme property in the ValueContainer component
alexeyandreevsky Dec 5, 2024
e440e7d
Update DateBlock styles in ValidatorPage to fit new DateBlock compone…
alexeyandreevsky Dec 5, 2024
dd26ac0
Update PublicKeysList styles
alexeyandreevsky Dec 5, 2024
df7c773
Fix linter error
alexeyandreevsky Dec 5, 2024
731eee1
Update IdentityDigestCard nested styles
alexeyandreevsky Dec 5, 2024
7980455
Implement the size property to the ValueContainer component
alexeyandreevsky Dec 5, 2024
8b29c9d
Implement the size and color properties to the ValueCard component
alexeyandreevsky Dec 5, 2024
1db5f85
Update PublicKeysListItem styles
alexeyandreevsky Dec 5, 2024
05bafe9
Add link properties and LightGray colorScheme to ValueContainer compo…
alexeyandreevsky Dec 5, 2024
4cb59b2
Create PublicKeyBoundCard component and separate PublicKeysListItem t…
alexeyandreevsky Dec 5, 2024
20e6bed
Update publicKeys index file exports
alexeyandreevsky Dec 5, 2024
a749625
Update of mock data in Identity.js
alexeyandreevsky Dec 5, 2024
638e581
Update AliasesList show more button
alexeyandreevsky Dec 5, 2024
3c73a6e
Update show/hide button of public keys in Identity page
alexeyandreevsky Dec 5, 2024
f7d0fdd
Update IdentityTotalCard layout offsets
alexeyandreevsky Dec 5, 2024
7134162
Update chakra button variants
alexeyandreevsky Dec 5, 2024
197a7f5
Update public keys show/hide button in IdentityDigestCard
alexeyandreevsky Dec 5, 2024
0cb1b77
Update IdentityDigestCard styles
alexeyandreevsky Dec 6, 2024
38b2ed1
Update button styles on Identity page
alexeyandreevsky Dec 6, 2024
d658520
Update AliasesList styles
alexeyandreevsky Dec 6, 2024
3b5923d
Merge branch 'develop' into feat/identity-page
alexeyandreevsky Dec 9, 2024
cc34489
Update column size
alexeyandreevsky Dec 10, 2024
23fbca3
Update paddings of navigation and pageDataC mixins
alexeyandreevsky Dec 10, 2024
f79108a
Update responsive styles of IdentityDigestCard
alexeyandreevsky Dec 10, 2024
7e73b91
Update responsive styles of IdentityTotalCard
alexeyandreevsky Dec 10, 2024
af56047
Improve mixins of paddings: add $invert property
alexeyandreevsky Dec 10, 2024
e730034
Update PageDataContainer styles
alexeyandreevsky Dec 10, 2024
b1857b7
Add scroll to PublicKeysList for small resolution
alexeyandreevsky Dec 10, 2024
1a34a9a
Add ChevronIcon to show more buttons
alexeyandreevsky Dec 11, 2024
b15a418
Create a Smooth Size container to smoothly animate the size of child …
alexeyandreevsky Dec 11, 2024
48614b7
Implement SmoothSize container to index.js container file
alexeyandreevsky Dec 11, 2024
872a278
Create smooth animation of PublicKeysList on Identity page
alexeyandreevsky Dec 11, 2024
195ced2
Improve PublicKeysList show/hide animation
alexeyandreevsky Dec 11, 2024
2cc9abc
Fix AliasesList size animation
alexeyandreevsky Dec 11, 2024
37bbac8
Update responsive view of PublicKeys on Identity page
alexeyandreevsky Dec 11, 2024
4bff883
Implement it to PublicKeysList
alexeyandreevsky Dec 11, 2024
250b58e
Restore scss variable
alexeyandreevsky Dec 11, 2024
88c8d7e
Implement breadcrumbs on specific Identity and Transaction pages
alexeyandreevsky Dec 11, 2024
991d0c3
Update AliasesList responsive styles
alexeyandreevsky Dec 11, 2024
03b3a5f
Update locked Alias styles
alexeyandreevsky Dec 11, 2024
0aedf76
Implement brand scroll to tabs list in InfoContainer
alexeyandreevsky Dec 12, 2024
eed2128
Stylize Tabs on Identity page
alexeyandreevsky Dec 12, 2024
d915509
Update Tabs responsive styles
alexeyandreevsky Dec 12, 2024
1148c8d
Update InfoLine offsets and fix ValidatorPage layout
alexeyandreevsky Dec 12, 2024
3e7e714
Update IdentityTotalCard loading styles
alexeyandreevsky Dec 12, 2024
2688fac
Update IdentityTotalCard responsive styles
alexeyandreevsky Dec 12, 2024
c6d0185
Update loading state of IdentityTotalCard
alexeyandreevsky Dec 12, 2024
ea78796
Update responsive styles of separator on IdentityTotalCard
alexeyandreevsky Dec 12, 2024
2601d39
Remove comments
alexeyandreevsky Dec 12, 2024
2e4f435
Update IdentityDigestCard error state render
alexeyandreevsky Dec 12, 2024
dd243a7
Error state on identity page
alexeyandreevsky Dec 12, 2024
18de5c4
Code architecture optimization
alexeyandreevsky Dec 12, 2024
f60fe2f
Fix linter error
alexeyandreevsky Dec 12, 2024
1747558
Set 'use client' to SmoothSize.js
alexeyandreevsky Dec 12, 2024
3c54f4c
Fix breadcrumbs key prop warning
alexeyandreevsky Dec 12, 2024
04ecd17
remove debug logs
alexeyandreevsky Dec 12, 2024
bd6ac8a
Fix route setting from tabs on Identity page
alexeyandreevsky Dec 12, 2024
e35d76a
remove debug log
alexeyandreevsky Dec 12, 2024
b8f13fd
Update back icon in PageDataContainer
alexeyandreevsky Dec 12, 2024
223972e
Optimization file architecture: AliasesList
alexeyandreevsky Dec 12, 2024
bf0f9ea
Update DigestCard
alexeyandreevsky Dec 12, 2024
fdea8be
Update chevron icon in PageDataContainer
alexeyandreevsky Dec 12, 2024
65c8ab8
Update useEffect dependencies
alexeyandreevsky Dec 12, 2024
3912ea4
Remove comments
alexeyandreevsky Dec 12, 2024
5f2d4ce
ValueCard code style
alexeyandreevsky Dec 12, 2024
2303789
Remove unused code in styles
alexeyandreevsky Dec 12, 2024
882ccbb
Remove comments from styles
alexeyandreevsky Dec 12, 2024
50c76fb
Theme.js code optimization
alexeyandreevsky Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/frontend/src/app/dataContracts/DataContracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function DataContractsLayout ({ defaultPage = 1, defaultPageSize }) {

{!dataContracts.loading
? !dataContracts.error
? <DataContractsList dataContracts={dataContracts.data.resultSet} size={'l'}/>
? <DataContractsList dataContracts={dataContracts.data.resultSet}/>
: <Container h={20}><ErrorMessageBlock/></Container>
: <LoadingList itemsCount={pageSize}/>}

Expand Down
344 changes: 136 additions & 208 deletions packages/frontend/src/app/identity/[identifier]/Identity.js

Large diffs are not rendered by default.

36 changes: 4 additions & 32 deletions packages/frontend/src/app/identity/[identifier]/Identity.scss
Original file line number Diff line number Diff line change
@@ -1,41 +1,13 @@
@use '../../../styles/mixins.scss';
@import '../../../styles/variables.scss';

.IdentityInfo {
height: min-content;

&__Avatar {
margin-left: auto;
width: 32px;
height: 32px;
}

&__AliasesContainer {
max-height: 110px;
min-height: 21px;
height: 100%;
overflow-y: auto;
.IdentityPage {
&__CommonInfo {
margin-bottom: 24px;
}

&__Alias {
width: max-content;
margin-left: auto;
}
}

.IdentityData {
&__Tabs {
flex-wrap: wrap;
}

@media screen and (max-width: 530px) {
&__Tab {
width: 50%;
}
}

@media screen and (max-width: 320px) {
&__Tab {
width: 100%;
}
}
}
10 changes: 10 additions & 0 deletions packages/frontend/src/app/transaction/[hash]/TransactionPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,26 @@ import { Badge } from '@chakra-ui/react'
import { TypeBadge, FeeMultiplier } from '../../../components/transactions'
import { ErrorMessageBlock } from '../../../components/Errors'
import { networks } from '../../../constants/networks'
import { useBreadcrumbs } from '../../../contexts/BreadcrumbsContext'
import './TransactionPage.scss'

function Transaction ({ hash }) {
const { setBreadcrumbs } = useBreadcrumbs()
const [transaction, setTransaction] = useState({ data: {}, loading: true, error: false })
const [rate, setRate] = useState({ data: {}, loading: true, error: false })
const [decodedST, setDecodedST] = useState({ data: {}, loading: true, error: false })
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL
const activeNetwork = networks.find(network => network.explorerBaseUrl === baseUrl)
const l1explorerBaseUrl = activeNetwork?.l1explorerBaseUrl || null

useEffect(() => {
setBreadcrumbs([
{ label: 'Home', path: '/' },
{ label: 'Transactions', path: '/identities' },
{ label: hash }
])
}, [setBreadcrumbs, hash])

const decodeTx = useCallback((tx) => {
Api.decodeTx(tx)
.then(stateTransition => fetchHandlerSuccess(setDecodedST, stateTransition))
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/app/validator/[hash]/Validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ function Validator ({ hash }) {
{validator.data?.lastProposedBlockHeader?.timestamp &&
<DateBlock
timestamp={validator.data.lastProposedBlockHeader.timestamp}
format={'delta-only'}
format={'deltaOnly'}
/>
}
<Identifier ellipsis={false} styles={['highlight-both']}>
Expand All @@ -279,7 +279,7 @@ function Validator ({ hash }) {
<Link href={`/transaction/${validator.data?.lastWithdrawal}`}>
<ValueContainer className={'ValidatorPage__ValueContainer'} clickable={true}>
{validator.data?.lastWithdrawalTime &&
<DateBlock timestamp={validator.data.lastWithdrawalTime} format={'delta-only'}/>}
<DateBlock timestamp={validator.data.lastWithdrawalTime} format={'deltaOnly'}/>}
<Identifier ellipsis={false} styles={['highlight-both']}>
{validator.data?.lastWithdrawal}
</Identifier>
Expand Down
23 changes: 17 additions & 6 deletions packages/frontend/src/app/validator/[hash]/ValidatorPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@
}
}

&__InfoLine {
margin-bottom: 14px;
&__InfoLine {
margin-bottom: 14px;

.DateBlock {
justify-content: flex-end;
.DateBlock__InfoContainer {
justify-content: flex-end;
}
}
}

&__ValueContainer {
display: flex;
Expand All @@ -129,12 +129,17 @@
}

.PageDataContainer__Content {
padding: 0;
border-radius: 0;
background: transparent;
}
}

@media screen and (min-width: 421px) and (max-width: $breakpoint-lg) {
.PageDataContainer__Content {
padding: 0 !important;
}
}

@media screen and (min-width: $breakpoint-lg) and (max-width: 1100px) {
&__ListPagination {
.PageLink {
Expand All @@ -147,4 +152,10 @@
}
}
}

@media screen and (max-width: 420px) {
.PageDataContainer__Content {
padding-bottom: 0 !important;
}
}
}
17 changes: 8 additions & 9 deletions packages/frontend/src/components/breadcrumbs/Breadcrumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ const Breadcrumbs = () => {
<div className={'Breadcrumbs'}>
<ul className={'Breadcrumbs__LinksContainer'}>
{breadcrumbs.map((link, i) => (
<>
<li className={'Breadcrumbs__Link'}>
<LinkContainer href={i !== breadcrumbs.length - 1 ? link.path : null} key={i}>
{link.avatar &&
<ImageGenerator className={'Breadcrumbs__Avatar'} username={link.label} lightness={50} saturation={50} width={16} height={16} />}
{link.label}
</LinkContainer>
</li>
<li className={'Breadcrumbs__Link'} key={i}>
<LinkContainer href={i !== breadcrumbs.length - 1 ? link.path : null} key={i}>
{link.avatar &&
<ImageGenerator className={'Breadcrumbs__Avatar'} username={link.label} lightness={50} saturation={50} width={16} height={16} />}
{link.label}
</LinkContainer>

{i !== breadcrumbs.length - 1 && <div className={'Breadcrumbs__Separator'}><ChevronIcon color={'brand.normal'}/></div>}
</>
</li>
))}
</ul>
</div>
Expand Down
2 changes: 2 additions & 0 deletions packages/frontend/src/components/breadcrumbs/Breadcrumbs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

&__Link {
margin: 0;
display: flex;
align-items: center;

a, span {
display: flex;
Expand Down
19 changes: 17 additions & 2 deletions packages/frontend/src/components/cards/ValueCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,25 @@ const Wrapper = (props) => {
: <div onMouseMove={props.onMouseMove} className={props.className}>{props.children}</div>
}

export default function ValueCard ({ link, loading, children, className }) {
export default function ValueCard ({ link, loading, colorScheme = 'default', size = 'default', children, className }) {
const colorClasses = {
default: '',
transparent: 'ValueCard--BgTransparent'
}

const sizeClasses = {
default: '',
sm: 'ValueCard--SizeSm'
}

let extraClass = ''
if (link) extraClass += 'ValueCard--Clickable'
extraClass += ' ' + colorClasses?.[colorScheme] || colorClasses.default
extraClass += ' ' + sizeClasses?.[size] || sizeClasses.default

return (
<Wrapper
className={`ValueCard ${className || ''} ${loading ? 'ValueCard--Loading' : ''} ${link ? 'ValueCard--Clickable' : ''}`}
className={`ValueCard ${className || ''} ${loading ? 'ValueCard--Loading' : ''} ${extraClass || ''}`}
link={link}
>
{children}
Expand Down
10 changes: 10 additions & 0 deletions packages/frontend/src/components/cards/ValueCard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
@include mixins.LoadingLine();
}

&--SizeSm {
padding: 5px 10px;
line-height: 14px;
border-radius: 4px;
}

&--BgTransparent {
background: transparent;
}

&--Clickable {
@media (hover: hover) and (pointer: fine) {
&:hover {
Expand Down
5 changes: 4 additions & 1 deletion packages/frontend/src/components/data/Alias.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import './Alias.scss'
import { Tooltip } from '../ui/Tooltips'
import { ErrorIcon } from '../ui/icons'
import './Alias.scss'

export default function Alias ({ alias, status, children, ellipsis = true, className }) {
alias = alias || children
Expand Down Expand Up @@ -29,6 +30,8 @@ export default function Alias ({ alias, status, children, ellipsis = true, class
{alias?.slice(dashIndex)}
</span>
}

{status === 'locked' && <ErrorIcon className={'Alias__LockedIcon'}/>}
</div>
</Container>
)
Expand Down
16 changes: 15 additions & 1 deletion packages/frontend/src/components/data/Alias.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,23 @@

&--Locked {
color: var(--chakra-colors-red-default);
text-decoration: line-through
}

&--Locked & {
&__Domain {
opacity: 1;
}
}

&__Domain {
opacity: .5;
}
}

&__LockedIcon {
display: inline-block;
width: 18px !important;
height: 18px !important;
margin-left: 8px;
}
}
45 changes: 45 additions & 0 deletions packages/frontend/src/components/data/AliasesList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
'use client'

import { useState } from 'react'
import { Alias, DateBlock } from './index'
import { Button } from '@chakra-ui/react'
import { ChevronIcon } from '../ui/icons'
import { SmoothSize } from '../ui/containers'
import './AliasesList.scss'

function AliasesList ({ aliases = [], smallCount = 5 }) {
const [showAll, setShowAll] = useState(false)

const filteredArray = showAll
? aliases
: aliases.filter((item, i) => i < smallCount)

return (
<div className={'AliasesList'}>
<SmoothSize className={'AliasesList__SmoothSize'}>
<div className={'AliasesList__ItemsContainer'}>
{filteredArray?.map((alias, i) => (
<div className={'AliasesList__Item'} key={i}>
<Alias status={i % 2 === 0 ? alias.status : 'locked'} ellipsis={false} key={i}>{alias.alias}</Alias>
<DateBlock timestamp={1233123333332} format={'deltaOnly'}/>
</div>
))}
</div>
</SmoothSize>

{aliases.length > smallCount &&
<Button
onClick={() => setShowAll(!showAll)}
className={'AliasesList__ShowMoreButton'}
size={'sm'}
variant={showAll ? 'gray' : 'blue'}
>
{showAll ? 'Show less' : 'Show more'}
<ChevronIcon ml={'4px'} h={'10px'} w={'10px'} transform={`rotate(${showAll ? '-90deg' : '90deg'})`}/>
</Button>
}
</div>
)
}

export default AliasesList
33 changes: 33 additions & 0 deletions packages/frontend/src/components/data/AliasesList.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@use '../../styles/mixins';
@import '../../styles/variables';

.AliasesList {
&, &__ItemsContainer {
display: flex;
flex-direction: column;
align-items: end;
gap: 0.25rem;
}

&__Item {
display: flex;
align-items: center;
gap: 0.5rem;
justify-content: flex-end;
max-width: 100%;
}

&__ShowMoreButton {
width: max-content;
font-weight: 500 !important;
text-transform: capitalize !important;

svg {
transition: .2s;
}
}

&__SmoothSize {
max-width: 100%;
}
}
Loading
Loading