Skip to content

Base template for transactions#12

Merged
ev-d merged 9 commits intofeature/si-1797-create-vault-pagefrom
feature/si-1836-base-tamplate-for-transactions
Apr 9, 2025
Merged

Base template for transactions#12
ev-d merged 9 commits intofeature/si-1797-create-vault-pagefrom
feature/si-1836-base-tamplate-for-transactions

Conversation

@ev-d
Copy link
Copy Markdown
Contributor

@ev-d ev-d commented Mar 26, 2025

Description

Fund, withdraw, mint, repay and claim forms

Checklist:

  • Checked the changes locally.
  • Created / updated analytics events.
  • Created / updated the technical documentation (README.md / docs / etc.).
  • Affects / requires changes in other services (Matomo / Sentry / CloudFlare / etc.).

@ev-d ev-d marked this pull request as ready for review April 3, 2025 11:58
@ev-d ev-d requested a review from a team as a code owner April 3, 2025 11:58
@ev-d ev-d requested a review from Jeday April 3, 2025 11:59
@preview-stands
Copy link
Copy Markdown

preview-stands bot commented Apr 3, 2025

Preview stand status

Stand was demolished

@ev-d ev-d changed the title [WIP] base template for transactions Base template for transactions Apr 3, 2025
@ev-d ev-d changed the base branch from develop to feature/si-1797-create-vault-page April 3, 2025 12:09
Comment thread consts/vault-hub.ts Outdated
@@ -5,7 +5,7 @@ export const VAULT_HUB_BY_NETWORK: {
[key in CHAINS]?: Address;
} = {
[CHAINS.Mainnet]: '0x',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better delete than have invalid value

Comment thread features/adjustment/adjustment-tabs.tsx Outdated
<ToggleSwitch
options={adjustmentToggleList}
defaultActive={initialPath}
onToggleCb={({ value }) => handleToggleCb(value as AdjustmentPaths)}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cb? callback? just onToggle is clear

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is complicated system for just two value. Consider 'mint' | 'repay' type.

Comment thread features/adjustment/mint/form/form.tsx Outdated
import { FeatureTxInfo } from './feature-tx-info';
import { FormContainer } from './styles';

export const Form = () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider naming MintForm for easier codebase nav

import { useVaultInfo } from 'features/overview/contexts';

export const useMintWithDelegation = (onMutate = () => {}) => {
const { chainId } = useDappStatus();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to vault ui not having to support multiple set of supported chains (like stake widget). You don't need dappStatus. Wagmi will get chain from wagmi context.
Also you don't need to pass wagmiConfig, but you might need to use global type https://wagmi.sh/react/typescript#declaration-merging

Comment thread shared/components/layout/layout.tsx Outdated
<LayoutStyles>
<Header />
<Navigation />
<Navigation address={address} />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drilling?


export const Navigation: FC = memo(() => {
type NavigationProps = {
address?: Address;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what is address here? Vault? User?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If user - bad, delete . NEVER user address in routeing for better privacy
if vault, better naming, but also consider nested navigation and layout for vault managment and outside. Those are separate componentns.

Comment thread test/consts.ts Outdated
export const GET_REQUESTS: GetRequest[] = [
{
uri: '/api/rewards?address=0x87c0e047F4e4D3e289A56a36570D4CB957A37Ef1&currency=usd&onlyRewards=false&archiveRate=true&skip=0&limit=10',
uri: '/api/rewards?address-field=0x87c0e047F4e4D3e289A56a36570D4CB957A37Ef1&currency=usd&onlyRewards=false&archiveRate=true&skip=0&limit=10',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wut is this????

return {
props: { address },
};
} catch (error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just 404 why redirect. Don't smooth out errors - it's bad ux

// Check if address is address
// Check if address is deployed contract
// Check if address is vault contract
export const getDefaultServerSideProps: GetServerSideProps<
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ABSOLUTLY zero sense for us to do this on server side. Develop like this is SPA.

@ev-d ev-d requested a review from Jeday April 8, 2025 22:46
Comment thread consts/weth.ts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧠 🧠 🧠 🧠

Comment thread test/consts.ts Outdated
@@ -15,7 +15,7 @@ export interface PostRequest {

export const GET_REQUESTS: GetRequest[] = [
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this, this is leftover from widget, not actual

const pathname = useRouterPath();
const { isWalletConnected } = useDappStatus();
const router = useRouter();
const { address: vaultAddress } = router.query as { address: Address };
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider change in next file to avoid confusion

Comment thread providers/vaults.tsx Outdated
} else {
setError(`Vault with address ${address} not found`);
void router.push(AppPaths.main);
void router.push(AppPaths.notFound);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.replace is correct behavior for this

@ev-d ev-d requested a review from Jeday April 9, 2025 14:59
@ev-d ev-d merged commit 01846dd into feature/si-1797-create-vault-page Apr 9, 2025
2 of 5 checks passed
@ev-d ev-d deleted the feature/si-1836-base-tamplate-for-transactions branch April 9, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants