Skip to content

Commit

Permalink
chore: move colors out into a fn
Browse files Browse the repository at this point in the history
  • Loading branch information
infiniteflower committed May 16, 2024
1 parent 1c117ac commit aefbadd
Showing 1 changed file with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import TransactionBackgroundBottom from '../../../images/transaction-background-
import LoopingScrollAnimation from './LoopingScrollAnimation';
import { hexToDecimal } from '../../../util/conversions';
import useRemainingTime from './useRemainingTime';
import { ThemeColors } from '@metamask/design-tokens/dist/types/js/themes/types';

const getPortfolioStxLink = (chainId: Hex, uuid: string) => {
const chainIdDec = hexToDecimal(chainId);
Expand Down Expand Up @@ -195,19 +196,8 @@ const getDisplayValuesAndHandlers = ({
};
};

const SmartTransactionStatus = ({
requestState: { smartTransaction, isDapp, isInSwapFlow },
origin,
onConfirm,
}: Props) => {
const { status, creationTime, uuid } = smartTransaction;
const providerConfig = useSelector(selectProviderConfig);

const navigation = useNavigation();
const { colors } = useTheme();

// Setup styles
const styles = StyleSheet.create({
const createStyles = (colors: ThemeColors) =>
StyleSheet.create({
wrapper: {
height: '82%',
display: 'flex',
Expand Down Expand Up @@ -257,6 +247,18 @@ const SmartTransactionStatus = ({
},
});

const SmartTransactionStatus = ({
requestState: { smartTransaction, isDapp, isInSwapFlow },
origin,
onConfirm,
}: Props) => {
const { status, creationTime, uuid } = smartTransaction;
const providerConfig = useSelector(selectProviderConfig);

const navigation = useNavigation();
const { colors } = useTheme();
const styles = createStyles(colors);

const isStxPending = status === SmartTransactionStatuses.PENDING;

const {
Expand Down

0 comments on commit aefbadd

Please sign in to comment.