Skip to content

Commit

Permalink
fix: stonks related issues found by qa
Browse files Browse the repository at this point in the history
  • Loading branch information
katamarinaki committed Apr 1, 2024
1 parent 1e4352f commit 4adff5a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
5 changes: 5 additions & 0 deletions modules/stonks/ui/StonksGrid/StonksGridStyle.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { BREAKPOINT_MOBILE } from 'modules/globalStyles'
import { Text } from 'modules/shared/ui/Common/Text'
import styled from 'styled-components'

export const Grid = styled.div`
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 24px;
@media (max-width: ${BREAKPOINT_MOBILE}) {
grid-template-columns: 1fr;
}
`

export const Card = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ export function StonksOrderProgressSafe({ safeTxHash }: Props) {
</MessageBox>
<MessageBox>
<Text size={14} weight={500}>
Once the transaction is signed and transaction has is obtained, you
can proceed with the order. Click the button below to open up the
order form.
Once the transaction has been signed and executed, return to the
Stonks page and enter the tx hash to continue order creation.
</Text>
<Button size="sm" onClick={() => router.push(stonks)}>
Back to Stonks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { getOrderByPlaceTxReceipt } from 'modules/stonks/utils/getOrderByPlaceTx
import { Fieldset } from './StonksOrderResolverFormStyle'
import { Form } from 'modules/shared/ui/Controls/Form'
import { InputControl } from 'modules/shared/ui/Controls/Input'
import { validateAddress } from 'modules/motions/utils/validateAddress'

type FormData = {
txHashOrAddress: string
Expand Down Expand Up @@ -71,8 +72,23 @@ export function StonksOrderResolverForm() {
fullwidth
name="txHashOrAddress"
placeholder="Order creation tx hash or order address"
rules={{
required: 'Field is required',
validate: value => {
const addressErr = validateAddress(value)
const isValidTxHash = /^0x[a-fA-F0-9]{64}$/.test(value)
if (addressErr && !isValidTxHash) {
return 'Invalid tx hash or address'
}
},
}}
/>
<Button fullwidth type="submit" loading={isSubmitting}>
<Button
fullwidth
type="submit"
loading={isSubmitting}
disabled={!formMethods.formState.isValid}
>
Go to order
</Button>
</Fieldset>
Expand Down
2 changes: 1 addition & 1 deletion pages/stonks/orders/[orderAddress].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function StonksOrderDetailsPage() {
<StonksOrderCard
order={order}
isDataValidating={isValidating}
onInvalidate={mutate}
onInvalidate={() => mutate(undefined, { revalidate: true })}
/>
</ContentContainer>
)
Expand Down

0 comments on commit 4adff5a

Please sign in to comment.