Skip to content

Commit

Permalink
Add header
Browse files Browse the repository at this point in the history
  • Loading branch information
ChewingGlass committed Oct 24, 2023
1 parent 83cdb46 commit b71cf86
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/AutoGasBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import CloseCircle from '@assets/images/closeCircleFilled.svg'
import Info from '@assets/images/info.svg'
import Warning from '@assets/images/warning.svg'
import {
useMint,
Expand Down Expand Up @@ -38,6 +37,7 @@ import { ReAnimatedBox } from './AnimatedBox'
import Box from './Box'
import Text from './Text'
import TouchableOpacityBox from './TouchableOpacityBox'
import CircleLoader from './CircleLoader'

const MIN_HEIGHT = 52

Expand Down Expand Up @@ -124,6 +124,7 @@ const Banner = ({ onLayout, ...rest }: BannerProps) => {
url: '',
additionalMessage: t('transactions.autoGasConvert', { symbol }),
serializedTxs: [serializedTx],
header: t('transactions.autoGasConvertHeader'),
})
if (decision) {
await sendAndConfirmRawTransaction(
Expand Down Expand Up @@ -185,7 +186,7 @@ const Banner = ({ onLayout, ...rest }: BannerProps) => {
{error ? (
<Warning width={24} height={24} />
) : (
<Info width={24} height={24} />
<CircleLoader loaderSize={24} />
)}
</Box>
<Text
Expand Down
1 change: 1 addition & 0 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1099,5 +1099,6 @@ export default {
'Recipient Account is empty, Double check the address before signing.',
autoGasConvert:
'Sign this transaction to convert {{ symbol }} into 0.02 SOL for gas.',
autoGasConvertHeader: 'Auto Gas Conversion: Low on SOL',
},
}
8 changes: 8 additions & 0 deletions src/solana/WalletSignBottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const WalletSignBottomSheet = forwardRef(
url: '',
additionalMessage: '',
serializedTxs: undefined,
header: undefined,
})

const itemsPerPage = 5
Expand Down Expand Up @@ -140,6 +141,7 @@ const WalletSignBottomSheet = forwardRef(
warning,
additionalMessage,
serializedTxs,
header,
}: WalletSignOpts) => {
bottomSheetModalRef.current?.expand()
setTotalSolFee(0)
Expand All @@ -150,6 +152,7 @@ const WalletSignBottomSheet = forwardRef(
warning,
additionalMessage,
serializedTxs,
header,
})
const p = new Promise<boolean>((resolve) => {
promiseResolve = resolve
Expand Down Expand Up @@ -249,6 +252,11 @@ const WalletSignBottomSheet = forwardRef(
onLayout={handleContentLayout}
>
<Box marginBottom="l">
{walletSignOpts.header && (
<Text variant="body1Medium" color="white" textAlign="center">
{walletSignOpts.header}
</Text>
)}
<Text
variant="body1Medium"
color="secondaryText"
Expand Down
2 changes: 2 additions & 0 deletions src/solana/walletSignBottomSheetTypes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export type WalletSignOpts = {
serializedTxs: Buffer[] | undefined
warning?: string
additionalMessage?: string
header?: string
}

export type WalletSignBottomSheetRef = {
Expand All @@ -27,6 +28,7 @@ export type WalletSignBottomSheetRef = {
url,
additionalMessage,
serializedTxs,
header,
}: WalletSignOpts) => Promise<boolean>
hide: () => void
}
Expand Down

0 comments on commit b71cf86

Please sign in to comment.