Skip to content

Commit e625b84

Browse files
committed
feat(web): table improvements
1 parent ec17e70 commit e625b84

File tree

24 files changed

+146
-90
lines changed

24 files changed

+146
-90
lines changed

apps/web/app/components/icons/bitcoin-icon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import { HTMLStyledProps, styled } from 'leather-styles/jsx';
33
interface BitcoinIconProps extends HTMLStyledProps<'img'> {
44
size?: number;
55
}
6-
export function BitcoinIcon({ size = 24 }: BitcoinIconProps) {
6+
export function BitcoinIcon({ size = 20 }: BitcoinIconProps) {
77
return <styled.img width={size} height={size} src="icons/bitcoin.svg" />;
88
}

apps/web/app/components/icons/stacks-icon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import { HTMLStyledProps, styled } from 'leather-styles/jsx';
33
interface StacksIconProps extends HTMLStyledProps<'img'> {
44
size?: number;
55
}
6-
export function StacksIcon({ size = 24 }: StacksIconProps) {
6+
export function StacksIcon({ size = 20 }: StacksIconProps) {
77
return <styled.img width={size} height={size} src="icons/stacks.svg" />;
88
}

apps/web/app/components/table.tsx

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,43 @@ export const theadBorderBottom = css({
1616
},
1717
});
1818

19-
export function SortableHeader(props: HTMLStyledProps<'div'>) {
20-
return <styled.div _hover={{ textDecoration: 'underline' }} {...props} />;
19+
export const rowPadding = css({
20+
'& td:first-child': { pl: 'space.05' },
21+
'& td:last-child': { pr: 'space.05' },
22+
'& th:first-child': { pl: 'space.05' },
23+
'& th:last-child': { pr: 'space.05' },
24+
});
25+
26+
export function SortableHeader({ children, ...props }: HTMLStyledProps<'div'>) {
27+
return (
28+
<styled.div {...props}>
29+
<styled.span zIndex={99} _hover={{ textDecoration: 'underline' }}>
30+
{children}
31+
</styled.span>
32+
</styled.div>
33+
);
2134
}
2235

23-
export const TableContainer = forwardRef<HTMLDivElement, HTMLStyledProps<'div'>>((props, ref) => (
36+
export const TableRoot = forwardRef<HTMLDivElement, HTMLStyledProps<'div'>>((props, ref) => (
2437
<styled.div border="default" borderRadius="sm" ref={ref} {...props} />
2538
));
2639

2740
export const StyledTable = forwardRef<HTMLTableElement, HTMLStyledProps<'table'>>((props, ref) => (
2841
<styled.table
2942
borderCollapse="separate"
43+
borderSpacing={0}
3044
overflow="hidden"
3145
w="100%"
32-
px="space.05"
3346
pos="relative"
3447
ref={ref}
3548
{...props}
3649
/>
3750
));
3851

3952
export const TableHead = forwardRef<HTMLTableSectionElement, HTMLStyledProps<'thead'>>(
40-
(props, ref) => <styled.thead height="40px" className={theadBorderBottom} ref={ref} {...props} />
53+
(props, ref) => (
54+
<styled.thead height="40px" className={theadBorderBottom} mx="space.05" ref={ref} {...props} />
55+
)
4156
);
4257

4358
export const TableHeader = forwardRef<HTMLTableCellElement, HTMLStyledProps<'th'>>((props, ref) => (
@@ -53,7 +68,7 @@ export const TableBody = forwardRef<HTMLTableSectionElement, HTMLStyledProps<'tb
5368
);
5469

5570
export const Table = {
56-
Root: TableContainer,
71+
Root: TableRoot,
5772
Table: StyledTable,
5873
Head: TableHead,
5974
Header: TableHeader,

apps/web/app/constants.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

apps/web/app/constants/app.ts renamed to apps/web/app/constants/constants.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { stxToMicroStx } from '@leather.io/utils';
22

3+
import packageJson from '../../package.json';
4+
35
export const EXPLORER_URL = 'https://explorer.stacks.co';
46

57
export const STACKING_ADDRESS_FORMAT_HELP_URL =
@@ -24,3 +26,10 @@ export const FEE_RATE = 400;
2426
export const SEND_MANY_CONTACT_ID = 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.send-many-memo';
2527

2628
export const BUY_STACKS_URL = 'https://coinmarketcap.com/currencies/stacks/markets/';
29+
30+
export const DEFAULT_DEVNET_SERVER = 'http://localhost:3999';
31+
32+
export const VERSION = packageJson.version;
33+
34+
export const GITHUB_ORG = 'leather-io';
35+
export const GITHUB_REPO = 'mono';

apps/web/app/features/sign-in-button/sign-in-button.layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function SignInButtonContainer({ children }: HasChildren) {
2121
}
2222

2323
export function SignInButtonLayout(props: ButtonProps) {
24-
return <Button variant="outline" fullWidth {...props} />;
24+
return <Button variant="outline" size="xs" fullWidth {...props} />;
2525
}
2626

2727
interface ActiveAccountButtonLayoutProps {

apps/web/app/features/stacking/components/preset-pools.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// import { IconEdit } from '@tabler/icons-react';
2-
import { MIN_DELEGATED_STACKING_AMOUNT_USTX } from '~/constants/app';
2+
import { MIN_DELEGATED_STACKING_AMOUNT_USTX } from '~/constants/constants';
33

44
import { NetworkInstanceToPoxContractMap, Pool, PoolName } from '../utils/types-preset-pools';
55
import { PoolIcon } from './pool-icon';

apps/web/app/features/stacking/utils/utils-delegate-stx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
uintCV,
1313
} from '@stacks/transactions';
1414
import { z } from 'zod';
15-
import { UI_IMPOSED_MAX_STACKING_AMOUNT_USTX } from '~/constants/app';
15+
import { UI_IMPOSED_MAX_STACKING_AMOUNT_USTX } from '~/constants/constants';
1616
import { StxCallContractParams, leather } from '~/helpers/leather-sdk';
1717
import { cyclesToBurnChainHeight } from '~/utils/calculate-burn-height';
1818
import { toHumanReadableStx } from '~/utils/unit-convert';

apps/web/app/features/stacking/utils/utils-preset-pools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ChainId, StacksNetwork, StacksNetworkName } from '@stacks/network';
2-
import { DEFAULT_DEVNET_SERVER } from '~/constants';
2+
import { DEFAULT_DEVNET_SERVER } from '~/constants/constants';
33

44
import { pools } from '../components/preset-pools';
55
import {

apps/web/app/layouts/nav/nav.tsx

Lines changed: 7 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ import { styled } from 'leather-styles/jsx';
22
import { WhenClient } from '~/components/client-only';
33
import { SignInButton } from '~/features/sign-in-button/sign-in-button';
44

5+
import { LEATHER_EXTENSION_CHROME_STORE_URL } from '@leather.io/constants';
56
import {
67
BitcoinIcon,
78
GlassesIcon,
89
HouseIcon,
910
Hr,
11+
MobileIcon,
1012
NewspaperIcon,
13+
PuzzleIcon,
1114
StacksIcon,
1215
SupportIcon,
1316
TerminalIcon,
@@ -61,7 +64,7 @@ export function Nav() {
6164
<Hr mx="space.04" my="space.04" width="132px" />
6265
</styled.div>
6366

64-
<styled.div>
67+
<styled.div mt="space.01">
6568
<styled.h3 textStyle="label.03" mx="space.04" mb="space.03" color="ink.text-subdued">
6669
Learn
6770
</styled.h3>
@@ -88,56 +91,11 @@ export function Nav() {
8891
Install
8992
</styled.h3>
9093

91-
<NavItem
92-
href="https://chromewebstore.google.com/detail/leather/ldinpeekobnhjjdofggfgjlcehhmanlj?hl=en&pli=1"
93-
icon={
94-
<svg
95-
xmlns="http://www.w3.org/2000/svg"
96-
width="17"
97-
height="17"
98-
viewBox="0 0 17 17"
99-
fill="none"
100-
>
101-
<path
102-
d="M3.20703 7.66667V4C3.20703 3.44772 3.65475 3 4.20703 3H13.207C13.7593 3 14.207 3.44771 14.207 4V7.66667M3.20703 7.66667V13C3.20703 13.5523 3.65475 14 4.20703 14H13.207C13.7593 14 14.207 13.5523 14.207 13V7.66667M3.20703 7.66667H14.207M7.8737 5.33333H12.207M6.20703 5.33333C6.20703 5.60948 5.98317 5.83333 5.70703 5.83333C5.43089 5.83333 5.20703 5.60948 5.20703 5.33333C5.20703 5.05719 5.43089 4.83333 5.70703 4.83333C5.98317 4.83333 6.20703 5.05719 6.20703 5.33333Z"
103-
stroke="#12100F"
104-
strokeWidth="1.5"
105-
strokeLinecap="round"
106-
strokeLinejoin="round"
107-
/>
108-
</svg>
109-
}
110-
>
111-
Browser
94+
<NavItem href={LEATHER_EXTENSION_CHROME_STORE_URL} icon={<PuzzleIcon variant="small" />}>
95+
Extension
11296
</NavItem>
11397

114-
<NavItem
115-
href="/sbtc-rewards"
116-
icon={
117-
<svg
118-
xmlns="http://www.w3.org/2000/svg"
119-
width="17"
120-
height="17"
121-
viewBox="0 0 17 17"
122-
fill="none"
123-
>
124-
<g clipPath="url(#clip0_3940_1038)">
125-
<path
126-
d="M7.20671 13.3346H10.2067M5.20671 15.3346H12.2067C12.5749 15.3346 12.8734 15.0362 12.8734 14.668V2.33464C12.8734 1.96645 12.5749 1.66797 12.2067 1.66797H5.20671C4.83852 1.66797 4.54004 1.96645 4.54004 2.33464V14.668C4.54004 15.0362 4.83852 15.3346 5.20671 15.3346Z"
127-
stroke="#12100F"
128-
strokeWidth="1.5"
129-
strokeLinecap="round"
130-
strokeLinejoin="round"
131-
/>
132-
</g>
133-
<defs>
134-
<clipPath id="clip0_3940_1038">
135-
<rect width="16" height="16" fill="white" transform="translate(0.707031 0.5)" />
136-
</clipPath>
137-
</defs>
138-
</svg>
139-
}
140-
>
98+
<NavItem href="/sbtc-rewards" icon={<MobileIcon variant="small" />}>
14199
Mobile
142100
</NavItem>
143101
</styled.div>

0 commit comments

Comments
 (0)