Skip to content

Commit

Permalink
Publish stage (osmosis-labs#2138)
Browse files Browse the repository at this point in the history
* feat: Bump Cosmos-Kit and Use Wallet Client As Preferred Signer (osmosis-labs#2107)

* Update Pool Creation Fee to 1000 OSMO (osmosis-labs#2126)

* mattupham/staking mobile (osmosis-labs#2120)

* Clean up whitespace

* Cleanup on mobile

* validator next step modal

* Clean up table

* Clean up 2

* Remove comment

* Asset Integrations: Add USDC.wh and WETH.wh (osmosis-labs#2116)

* add USDC.wh and WETH.wh

* Update source-chain-infos.ts

* Asset Integrations: Add DGL token (osmosis-labs#2114)

* add DGL token

* Update source-chain-infos.ts

* Update ibc-assets.ts

* yarn

* [Notifi] notification popover integration V2 + V3 (osmosis-labs#2035)

* Notifi integration: feat: target verify/ discard modal/ major refactor/ other fixes

* Notification integration: feat: unread count badge

---------

Co-authored-by: Eric Lee <[email protected]>

* fix: Swap Memory Leak (osmosis-labs#2129)

* add YieldETH (osmosis-labs#2026)

* Notification integration: fix: unread count badge prevents hovering the bell button (osmosis-labs#2131)

Co-authored-by: Eric Lee <[email protected]>

* Notifi integration: fix: email regex mismatch (osmosis-labs#2132)

Co-authored-by: Eric Lee <[email protected]>

* mattupham/table performance + sorting (osmosis-labs#2125)

* remove virtualizer

* Clean up comments

* Clean up rows

* Uncomment confirmed non-perf issue

* Uncomment confirmed non-perf issue 2

* Add useCallback for formatted voting power

* Clean up myStake

* Optimize comissions

* Clean up performance issues

* Remove accessor key

* Memoize table

* Remove cells

* Clean up types

* Rename files

* Justify all left

* Add validator names

* Move handle button click

* Remove logs

* Clean up commissions sort

* Clean up types

* Clean up

* add todo

* update recommended assets (osmosis-labs#2135)

* Asset Integrations: Re-order Assets Page (osmosis-labs#2128)

* reorder assets

* Update ibc-assets.ts

* Update ibc-assets.ts

* Asset Integrations: Add noble.USDC (osmosis-labs#2133)

* Add noble.USDC

* fix noble USDC changes

* update noble rest

* prettier

---------

Co-authored-by: Jose Felix <[email protected]>
Co-authored-by: JeremyParish69 <[email protected]>
Co-authored-by: Matt Upham <[email protected]>
Co-authored-by: eric-notifi <[email protected]>
Co-authored-by: Eric Lee <[email protected]>
  • Loading branch information
6 people authored Sep 13, 2023
1 parent ae89fe2 commit 20f335f
Show file tree
Hide file tree
Showing 49 changed files with 2,460 additions and 1,414 deletions.
5 changes: 2 additions & 3 deletions packages/stores/src/ui-config/trade-token-in-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,8 @@ export class ObservableTradeTokenInConfig extends AmountConfig {

@override
get sendCurrency(): AppCurrency {
// Return the initial send currency when pools are not fetched yet.
if (this.sendableCurrencies.length === 0) {
// For the case before pools are initially fetched,

return this.initialSelectCurrencies.send;
}

Expand Down Expand Up @@ -142,8 +141,8 @@ export class ObservableTradeTokenInConfig extends AmountConfig {

@computed
get outCurrency(): AppCurrency {
// Return the initial send currency when pools are not fetched yet.
if (this.sendableCurrencies.length === 0) {
// For the case before pools are initially fetched,
return this.initialSelectCurrencies.out;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/web/components/cards/rewards-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const RewardsCard: React.FC<{
{image}
<div className="relative z-10 flex items-center justify-end p-4">
<span className="text-osmoverse-white text-sm">{title}</span>
<div className="pl-2 text-osmoverse-600">
<div className="pl-2 text-osmoverse-600 sm:hidden">
<Tooltip content={tooltipContent}>
<Icon id="info" height="14px" width="14px" fill="#958FC0" />
</Tooltip>
Expand Down
7 changes: 4 additions & 3 deletions packages/web/components/cards/stake-dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const StakeDashboard: React.FC<{

return (
<GenericMainCard title={t("stake.dashboard")} titleIcon={icon}>
<div className="flex w-full flex-row justify-between py-10">
<div className="flex w-full flex-row justify-between gap-4 py-10 sm:flex-col sm:py-4">
<StakeBalances
title={t("stake.stakeBalanceTitle")}
dollarAmount={String(fiatBalance)}
Expand Down Expand Up @@ -137,11 +137,12 @@ const StakeBalances: React.FC<{
osmoAmount?: string;
}> = ({ title, dollarAmount, osmoAmount }) => {
return (
<div className="flex w-full flex-col justify-center pl-10">
<div className="flex w-full flex-col items-center justify-center text-left">
{/* <div> */}
<span className="caption text-sm text-osmoverse-200 md:text-xs">
{title}
</span>
<h3>{dollarAmount}</h3>
<h3 className="whitespace-nowrap">{dollarAmount}</h3>
<span className="caption text-sm text-osmoverse-200 md:text-xs">
{osmoAmount}
</span>
Expand Down
25 changes: 6 additions & 19 deletions packages/web/components/layouts/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { MainMenu } from "~/components/main-menu";
import { NavBar } from "~/components/navbar";
import NavbarOsmoPrice from "~/components/navbar-osmo-price";
import { MainLayoutMenu } from "~/components/types";
import { useCurrentLanguage, useFeatureFlags, useWindowSize } from "~/hooks";
import { NotifiContextProvider } from "~/integrations/notifi";
import { useCurrentLanguage, useWindowSize } from "~/hooks";

export const MainLayout: FunctionComponent<{
menus: MainLayoutMenu[];
Expand All @@ -28,8 +27,6 @@ export const MainLayout: FunctionComponent<{
({ selectionTest }) => selectionTest?.test(router.pathname) ?? false
);

const featureFlags = useFeatureFlags();

return (
<React.Fragment>
{showFixedLogo && (
Expand All @@ -51,21 +48,11 @@ export const MainLayout: FunctionComponent<{
<NavbarOsmoPrice />
</div>
</article>
{featureFlags.notifications ? (
<NotifiContextProvider>
<NavBar
className="ml-sidebar md:ml-0"
title={selectedMenuItem?.label ?? ""}
menus={menus}
/>
</NotifiContextProvider>
) : (
<NavBar
className="ml-sidebar md:ml-0"
title={selectedMenuItem?.label ?? ""}
menus={menus}
/>
)}
<NavBar
className="ml-sidebar md:ml-0"
title={selectedMenuItem?.label ?? ""}
menus={menus}
/>
<div className="ml-sidebar h-content bg-osmoverse-900 md:ml-0 md:h-content-mobile">
{children}
</div>
Expand Down
19 changes: 9 additions & 10 deletions packages/web/components/navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ import {
} from "~/hooks";
import { useFeatureFlags } from "~/hooks/use-feature-flags";
import { useWalletSelect } from "~/hooks/wallet-select";
import { NotifiModal, NotifiPopover } from "~/integrations/notifi";
import { useNotifiBreadcrumb } from "~/integrations/notifi/hooks";
import {
NotifiContextProvider,
NotifiModal,
NotifiPopover,
} from "~/integrations/notifi";
import { ModalBase, ModalBaseProps, SettingsModal } from "~/modals";
import { ProfileModal } from "~/modals/profile";
import { UserUpgradesModal } from "~/modals/user-upgrades";
Expand Down Expand Up @@ -116,8 +119,6 @@ export const NavBar: FunctionComponent<
const router = useRouter();
const { isLoading: isWalletLoading } = useWalletSelect();

const { hasUnreadNotification } = useNotifiBreadcrumb();

useEffect(() => {
const handler = () => {
closeMobileMenuRef.current();
Expand Down Expand Up @@ -309,16 +310,14 @@ export const NavBar: FunctionComponent<
</div>
)}
{featureFlags.notifications && walletSupportsNotifications && (
<>
<NotifiPopover
hasUnreadNotification={hasUnreadNotification}
className="z-40 px-3 outline-none"
/>
<NotifiContextProvider>
<NotifiPopover className="z-40 px-3 outline-none" />
<NotifiModal
isOpen={isNotifiOpen}
onRequestClose={onCloseNotifi}
onOpenNotifi={onOpenNotifi}
/>
</>
</NotifiContextProvider>
)}
<IconButton
aria-label="Open settings dropdown"
Expand Down
118 changes: 118 additions & 0 deletions packages/web/components/stake/validator-squad-table.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import { Dec } from "@keplr-wallet/unit";
import { flexRender } from "@tanstack/react-table";
import { Table } from "@tanstack/react-table";
import { memo } from "react";
import { useTranslation } from "react-multi-lang";

import { Icon } from "~/components/assets";

export type Validator = {
validatorName: string | undefined;
myStake: Dec;
votingPower: Dec;
commissions: Dec;
website: string | undefined;
imageUrl: string;
operatorAddress: string;
isAPRTooHigh: boolean;
isVotingPowerTooHigh: boolean;
};

export type FormattedValidator = {
validatorName: string;
formattedMyStake: string;
formattedVotingPower: string;
formattedCommissions: string;
formattedWebsite: string;
website: string;
imageUrl: string;
isAPRTooHigh: boolean;
isVotingPowerTooHigh: boolean;
};

interface ValidatorSquadTableProps {
table: Table<FormattedValidator>;
}

export const ValidatorSquadTable = memo(
({ table }: ValidatorSquadTableProps) => {
const t = useTranslation();
const { rows } = table.getRowModel();

return (
<table className="w-full">
<thead className="sticky top-0 z-50 m-0">
{table
.getHeaderGroups()
.slice(1)
.map((headerGroup) => (
<tr key={headerGroup.id} className="!bg-osmoverse-700">
{headerGroup.headers.map((header) => {
return (
<th key={header.id} colSpan={header.colSpan}>
{header.isPlaceholder ? null : (
<div
{...{
className: header.column.getCanSort()
? "cursor-pointer select-none flex items-center gap-2"
: "",
onClick: header.column.getToggleSortingHandler(),
}}
>
{flexRender(
header.column.columnDef.header,
header.getContext()
)}
{{
asc: (
<Icon
id="sort-up"
className="h-[16px] w-[7px] text-osmoverse-300"
/>
),
desc: (
<Icon
id="sort-down"
className="h-[16px] w-[7px] text-osmoverse-300"
/>
),
}[header.column.getIsSorted() as string] ?? null}
</div>
)}
</th>
);
})}
</tr>
))}
</thead>
<tbody>
{rows.length === 0 ? (
<tr>
<td colSpan={4} className="h-32 text-center">
{t("stake.validatorSquad.noResults")}
</td>
</tr>
) : (
rows.map((row) => {
const cells = row?.getVisibleCells();
return (
<tr key={row?.id}>
{cells?.map((cell) => {
return (
<td key={cell.id} className="text-left">
{flexRender(
cell.column.columnDef.cell,
cell.getContext()
)}
</td>
);
})}
</tr>
);
})
)}
</tbody>
</table>
);
}
);
6 changes: 3 additions & 3 deletions packages/web/config/feature-flag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ export const BlacklistedPoolIds: string[] = ["895"];
export const RecommendedSwapDenoms = [
"OSMO",
"USDC",
"USDT",
"ATOM",
"DAI",
"JUNO",
"EVMOS",
"WBTC",
"ETH",
];

export const UnPoolWhitelistedPoolIds: { [poolId: string]: boolean } = {
Expand Down
41 changes: 36 additions & 5 deletions packages/web/config/generate-chain-infos/source-chain-infos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@ export const testnetChainInfos: SimplifiedChainInfo[] = [
isStakeCurrency: true,
},
{
coinDenom: "nUSDC",
coinDenom: "noble.USDC",
coinMinimalDenom: "uusdc",
coinDecimals: 6,
coinImageUrl: "/tokens/usdc.svg",
coinImageUrl: "/tokens/noble.usdc.svg",
coinGeckoId: "usd-coin",
isFeeCurrency: true,
gasPriceStep: {
Expand Down Expand Up @@ -1416,6 +1416,14 @@ export const mainnetChainInfos: SimplifiedChainInfo[] = [
coinGeckoId: "pool:watr",
coinImageUrl: "/tokens/watr.png",
},
{
coinDenom: "DGL",
coinMinimalDenom:
"factory/juno1u805lv20qc6jy7c3ttre7nct6uyl20pfky5r7e/DGL",
coinDecimals: 6,
coinGeckoId: "pool:dgl",
coinImageUrl: "/tokens/dgl.png",
},
],
features: ["ibc-transfer", "ibc-go", "wasmd_0.24+", "cosmwasm"],
explorerUrlToTx: "https://www.mintscan.io/juno/txs/{txHash}",
Expand Down Expand Up @@ -3604,7 +3612,7 @@ export const mainnetChainInfos: SimplifiedChainInfo[] = [
},
{
rpc: "https://rpc.mainnet.noble.strange.love",
rest: "https://noble-api.polkachu.com",
rest: "https://api.mainnet.noble.strange.love",
chainId: "noble-1",
chainName: "Noble",
bip44: {
Expand All @@ -3621,10 +3629,10 @@ export const mainnetChainInfos: SimplifiedChainInfo[] = [
isStakeCurrency: true,
},
{
coinDenom: "nUSDC",
coinDenom: "noble.USDC",
coinMinimalDenom: "uusdc",
coinDecimals: 6,
coinImageUrl: "/tokens/usdc.svg",
coinImageUrl: "/tokens/noble.usdc.svg",
coinGeckoId: "usd-coin",
isFeeCurrency: true,
gasPriceStep: {
Expand Down Expand Up @@ -4129,6 +4137,22 @@ export const mainnetChainInfos: SimplifiedChainInfo[] = [
coinGeckoId: "pool:usdt.wh",
coinImageUrl: "/tokens/usdt.hole.svg",
},
{
coinDenom: "USDC.wh",
coinMinimalDenom:
"factory/wormhole14ejqjyq8um4p3xfqj74yld5waqljf88fz25yxnma0cngspxe3les00fpjx/GGh9Ufn1SeDGrhzEkMyRKt5568VbbxZK2yvWNsd6PbXt",
coinDecimals: 6,
coinGeckoId: "pool:usdc.wh",
coinImageUrl: "/tokens/usdc.hole.svg",
},
{
coinDenom: "wETH.wh",
coinMinimalDenom:
"factory/wormhole14ejqjyq8um4p3xfqj74yld5waqljf88fz25yxnma0cngspxe3les00fpjx/5BWqpR48Lubd55szM5i62zK7TFkddckhbT48yy6mNbDp",
coinDecimals: 8,
coinGeckoId: "pool:weth.wh",
coinImageUrl: "/tokens/weth.hole.svg",
},
],
features: ["ibc-transfer", "ibc-go", "cosmwasm"],
explorerUrlToTx: "https://bigdipper.live/wormhole/transactions/{txHash}",
Expand Down Expand Up @@ -4416,6 +4440,13 @@ chainInfos.push({
coinGeckoId: "pool:wsteth-wei",
coinImageUrl: "/tokens/wsteth.svg",
},
{
coinDenom: "YieldETH",
coinMinimalDenom: "yieldeth-wei",
coinDecimals: 18,
//coinGeckoId: "pool:yieldeth-wei",
coinImageUrl: "/tokens/yieldeth.svg",
},
],
feeCurrencies: [
{
Expand Down
Loading

0 comments on commit 20f335f

Please sign in to comment.