Skip to content

Commit

Permalink
chore: more UI tweaks (#103)
Browse files Browse the repository at this point in the history
* chore: animate the refresh button rendering

* chore: fix double scroll bars

* chore: fix typo

* chore: adjust width of account activity tabs

* chore: make table column headers more obvious

* chore: use ipfs gateway for asset link href if applicable

* chore: animation adjustments

* chore: fix snapshots

* chore: nav padding tweak

* chore: override ws dependency

* chore: more tweaks
  • Loading branch information
neilcampbell authored Jun 18, 2024
1 parent 59dc025 commit 5872cc9
Show file tree
Hide file tree
Showing 24 changed files with 70 additions and 86 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,8 @@
],
"semantic-release-export-data"
]
},
"overrides": {
"ws@>7.0.0 <7.5.9": "7.5.10"
}
}
2 changes: 1 addition & 1 deletion src/features/app-studio/pages/app-studio-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function AppStudioPage() {
<PageTitle title={appStudioPageTitle} />
<div>
<p>
Comming soon!
Coming soon!
<br />
In the meantime, we recommend{' '}
<a href="https://app.dappflow.org/beaker-studio/" className="text-primary underline" rel="nofollow" target="_blank">
Expand Down
4 changes: 2 additions & 2 deletions src/features/applications/components/application-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ export function ApplicationDetails({ application }: Props) {
<h2>{applicationTransactionsLabel}</h2>
<Tabs defaultValue={applicationLiveTransactionsTabId}>
<TabsList aria-label={applicationTransactionsLabel}>
<TabsTrigger className="w-48" value={applicationLiveTransactionsTabId}>
<TabsTrigger className="w-56" value={applicationLiveTransactionsTabId}>
{applicationLiveTransactionsTabLabel}
</TabsTrigger>
<TabsTrigger className="w-48" value={applicationHistoricalTransactionsTabId}>
<TabsTrigger className="w-56" value={applicationHistoricalTransactionsTabId}>
{applicationHistoricalTransactionsTabLabel}
</TabsTrigger>
</TabsList>
Expand Down
3 changes: 2 additions & 1 deletion src/features/assets/components/asset-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { AssetTransactionHistory } from './asset-transaction-history'
import { AssetLiveTransactions } from './asset-live-transactions'
import { OverflowAutoTabsContent, Tabs, TabsList, TabsTrigger } from '@/features/common/components/tabs'
import { OpenJsonViewDialogButton } from '@/features/common/components/json-view-dialog-button'
import { replaceIpfsWithGatewayIfNeeded } from '../utils/replace-ipfs-with-gateway-if-needed'

type Props = {
asset: Asset
Expand Down Expand Up @@ -90,7 +91,7 @@ export function AssetDetails({ asset }: Props) {
? {
dt: assetUrlLabel,
dd: (
<a href={asset.url} className={cn('text-primary underline')} rel="nofollow" target="_blank">
<a href={replaceIpfsWithGatewayIfNeeded(asset.url)} className={cn('text-primary underline')} rel="nofollow" target="_blank">
{asset.url}
</a>
),
Expand Down
2 changes: 1 addition & 1 deletion src/features/blocks/components/latest-blocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function LatestBlocks() {
<ul>
{latestBlocks.map((block) => (
<li key={block.round} className="border-b last:border-0">
<BlockLink round={block.round} className="flex p-3.5 text-sm animate-in fade-in-0 zoom-in-90 hover:bg-accent">
<BlockLink round={block.round} className="flex p-3.5 text-sm animate-in fade-in-20 hover:bg-accent">
<Box className="hidden text-primary sm:max-lg:block xl:block" />
<div className={cn('mx-2')}>
<h3 className={cn('leading-none mb-2')}>{block.round}</h3>
Expand Down
2 changes: 1 addition & 1 deletion src/features/common/components/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { cva, type VariantProps } from 'class-variance-authority'
import { cn } from '@/features/common/utils'

const buttonVariants = cva(
'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
'relative inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
{
variants: {
variant: {
Expand Down
6 changes: 3 additions & 3 deletions src/features/common/components/data-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ export function DataTable<TData, TValue>({ columns, data, getSubRows, subRowsExp

return (
<div>
<div className="grid border-y">
<Table>
<div className="grid">
<Table className="border-b">
<TableHeader>
{table.getHeaderGroups().map((headerGroup) => (
<TableRow key={headerGroup.id}>
<TableRow key={headerGroup.id} className="border-t bg-muted/50">
{headerGroup.headers.map((header) => {
return (
<TableHead key={header.id}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ export function LazyLoadDataTable<TData, TValue>({ columns, createLoadablePage,

return (
<div>
<div className="grid border-y">
<Table>
<div className="grid">
<Table className="border-b">
<TableHeader>
{table.getHeaderGroups().map((headerGroup) => (
<TableRow key={headerGroup.id}>
<TableRow key={headerGroup.id} className="border-t bg-muted/50">
{headerGroup.headers.map((header) => {
return (
<TableHead key={header.id}>
Expand Down
10 changes: 8 additions & 2 deletions src/features/common/components/refresh-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ export const refreshButtonLabel = 'Refresh'

export function RefreshButton({ onClick }: Props) {
return (
<Button onClick={onClick} variant="outline" size="icon" aria-label={refreshButtonLabel} className="ml-auto">
<RefreshCw className="size-[1.2rem]" />
<Button
onClick={onClick}
variant="outline"
size="icon"
aria-label={refreshButtonLabel}
className="ml-auto animate-in fade-in-0 zoom-in-90"
>
<span className="sr-only">{refreshButtonLabel}</span>
<RefreshCw className="size-[1.2rem]" />
</Button>
)
}
2 changes: 1 addition & 1 deletion src/features/common/components/render-loadable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type RenderLoadableProps<T> = {

export function RenderLoadable<T>({ loadable, children, fallback, transformError }: RenderLoadableProps<T>) {
if (loadable.state === 'hasData') {
return <div className="animate-in fade-in-40">{children(loadable.data)}</div>
return <div>{children(loadable.data)}</div>
} else if (loadable.state === 'loading') {
return <>{fallback ?? <Loader className="size-10 animate-spin" />}</>
}
Expand Down
2 changes: 1 addition & 1 deletion src/features/common/components/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const TableHead = React.forwardRef<HTMLTableCellElement, React.ThHTMLAttributes<
<th
ref={ref}
className={cn(
'h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
'h-10 px-2 text-left align-middle font-medium text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
className
)}
{...props}
Expand Down
15 changes: 6 additions & 9 deletions src/features/layout/components/left-side-bar-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ type Props = {
className?: string
}

const navIconClassName = cn('border rounded-md p-2 ml-1')
const navIconClassName = cn('border rounded-md p-2 ml-2')
const navLinkClassName = cn(
'[&.active]:border-border [&.active]:bg-accent [&.active]:text-primary border border-card rounded-r-md p-[0.34rem] mr-2 gap-2 flex items-center whitespace-nowrap'
)

export function LeftSideBarMenu({ className }: Props) {
const [selectedNetwork] = useSelectedNetwork()
Expand All @@ -28,23 +31,17 @@ export function LeftSideBarMenu({ className }: Props) {
[setLayout]
)

const navLinkClassName = cn(
layout.isLeftSideBarExpanded && 'mr-2',
!layout.isLeftSideBarExpanded && 'mr-1',
'[&.active]:border-border [&.active]:bg-accent [&.active]:text-primary border border-card rounded-r-md p-1 gap-2 flex items-center whitespace-nowrap'
)

const navTextClassName = cn(layout.isLeftSideBarExpanded ? 'visible delay-100' : 'invisible w-0 delay-100')

return (
<aside
className={cn(
'flex flex-col bg-card border-r transition-[width] duration-300',
className,
layout.isLeftSideBarExpanded ? 'w-56' : 'w-[3.8rem]'
layout.isLeftSideBarExpanded ? 'w-56' : 'w-[4.5rem]'
)}
>
<Button className="ml-auto size-9 text-muted-foreground" variant="no-style" size="icon" onClick={toggleLeftSideBar}>
<Button className="ml-auto text-muted-foreground" variant="no-style" size="icon" onClick={toggleLeftSideBar}>
{layout.isLeftSideBarExpanded ? <PanelLeftClose /> : <PanelLeftOpen />}
</Button>
<NavigationMenu>
Expand Down
6 changes: 5 additions & 1 deletion src/features/search/components/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ export function Search() {
}, [setTerm])

return (
<Command className={cn('bg-popover text-popover-foreground w-80 h-auto z-20 border border-input')} shouldFilter={false} loop>
<Command
className={cn('bg-popover text-popover-foreground w-80 h-auto z-20 border border-input', term && 'shadow-md')}
shouldFilter={false}
loop
>
<CommandInput
placeholder={searchPlaceholderLabel}
value={term}
Expand Down
4 changes: 2 additions & 2 deletions src/features/settings/components/theme-toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export function ThemeToggle({ navTextClassName }: Props) {
<Button
variant="no-style"
aria-label={themeTogglelabel}
className="flex h-12 items-center gap-2 whitespace-nowrap p-1 text-base font-normal"
className="my-1.5 flex items-center gap-2 whitespace-nowrap px-2 text-base font-normal"
>
<div className="ml-[0.28rem] flex rounded-md border p-2">
<div className="ml-[0.4rem] flex rounded-md border p-2">
<Sun className="rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
<Moon className="absolute rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -717,9 +717,7 @@
<div
class=""
>
<div
class="animate-in fade-in-40"
>
<div>
<div
class="flex items-center gap-1"
>
Expand Down Expand Up @@ -843,9 +841,7 @@
<div
class=""
>
<div
class="animate-in fade-in-40"
>
<div>
<div
class="flex items-center gap-1"
>
Expand Down Expand Up @@ -1076,9 +1072,7 @@
<div
class=""
>
<div
class="animate-in fade-in-40"
>
<div>
<div
class="flex items-center gap-1"
>
Expand Down Expand Up @@ -1202,9 +1196,7 @@
<div
class=""
>
<div
class="animate-in fade-in-40"
>
<div>
<div
class="flex items-center gap-1"
>
Expand Down Expand Up @@ -1434,9 +1426,7 @@
<div
class=""
>
<div
class="animate-in fade-in-40"
>
<div>
<div
class="flex items-center gap-1"
>
Expand Down Expand Up @@ -1560,9 +1550,7 @@
<div
class=""
>
<div
class="animate-in fade-in-40"
>
<div>
<div
class="flex items-center gap-1"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -731,9 +731,7 @@
<div
class=""
>
<div
class="animate-in fade-in-40"
>
<div>
<div
class="flex items-center gap-1"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@
<div
class="w-min pl-1 pr-1 bg-card"
>
<div
class="animate-in fade-in-40"
>
<div>
<div
class="flex items-center gap-1"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,7 @@
<div
class=""
>
<div
class="animate-in fade-in-40"
>
<div>
<div
class="flex items-center gap-1"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -717,9 +717,7 @@
<div
class=""
>
<div
class="animate-in fade-in-40"
>
<div>
<div
class="flex items-center gap-1"
>
Expand Down Expand Up @@ -843,9 +841,7 @@
<div
class=""
>
<div
class="animate-in fade-in-40"
>
<div>
<div
class="flex items-center gap-1"
>
Expand Down Expand Up @@ -1076,9 +1072,7 @@
<div
class=""
>
<div
class="animate-in fade-in-40"
>
<div>
<div
class="flex items-center gap-1"
>
Expand Down Expand Up @@ -1202,9 +1196,7 @@
<div
class=""
>
<div
class="animate-in fade-in-40"
>
<div>
<div
class="flex items-center gap-1"
>
Expand Down Expand Up @@ -1434,9 +1426,7 @@
<div
class=""
>
<div
class="animate-in fade-in-40"
>
<div>
<div
class="flex items-center gap-1"
>
Expand Down Expand Up @@ -1560,9 +1550,7 @@
<div
class=""
>
<div
class="animate-in fade-in-40"
>
<div>
<div
class="flex items-center gap-1"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { AssetIdAndNameLink } from '@/features/assets/components/asset-link'
import Decimal from 'decimal.js'
import { useAtomValue } from 'jotai'
import { transactionSenderLabel } from './labels'
import { replaceIpfsWithGatewayIfNeeded } from '@/features/assets/utils/replace-ipfs-with-gateway-if-needed'

type Props = {
transaction: AssetConfigTransaction | InnerAssetConfigTransaction
Expand Down Expand Up @@ -41,7 +42,12 @@ export function AssetConfigTransactionInfo({ transaction }: Props) {
? {
dt: assetUrlLabel,
dd: (
<a href={transaction.url} className={cn('text-primary underline')} rel="nofollow" target="_blank">
<a
href={replaceIpfsWithGatewayIfNeeded(transaction.url)}
className={cn('text-primary underline')}
rel="nofollow"
target="_blank"
>
{transaction.url}
</a>
),
Expand Down
Loading

0 comments on commit 5872cc9

Please sign in to comment.