mirror of
https://github.com/selfxyz/self.git
synced 2026-04-05 03:00:53 -04:00
Simplify alias tooling and relax export sorting (#867)
* Simplify alias config * Restore export sorting overrides * save migration pattern * alias last minute updates * fix tests * improved import sorting * Implement typed event emitter (#869) * Implement typed event emitter * cr suggestion
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import React from 'react';
|
||||
import { StyleSheet, View } from 'react-native';
|
||||
|
||||
import { shouldShowAesopRedesign } from '@src/hooks/useAesopRedesign';
|
||||
import { shouldShowAesopRedesign } from '@/hooks/useAesopRedesign';
|
||||
|
||||
interface ButtonsContainerProps {
|
||||
children: React.ReactNode;
|
||||
|
||||
@@ -7,9 +7,9 @@ import type { Country3LetterCode } from '@selfxyz/common/constants';
|
||||
import { countryCodes } from '@selfxyz/common/constants';
|
||||
import type { SelfAppDisclosureConfig } from '@selfxyz/common/utils';
|
||||
|
||||
import { BodyText } from '@src/components/typography/BodyText';
|
||||
import CheckMark from '@src/images/icons/checkmark.svg';
|
||||
import { slate200, slate500 } from '@src/utils/colors';
|
||||
import { BodyText } from '@/components/typography/BodyText';
|
||||
import CheckMark from '@/images/icons/checkmark.svg';
|
||||
import { slate200, slate500 } from '@/utils/colors';
|
||||
|
||||
interface DisclosureProps {
|
||||
disclosures: SelfAppDisclosureConfig;
|
||||
|
||||
@@ -4,8 +4,8 @@ import type { ErrorInfo } from 'react';
|
||||
import React, { Component } from 'react';
|
||||
import { Text, View } from 'react-native';
|
||||
|
||||
import { captureException } from '@src/Sentry';
|
||||
import analytics from '@src/utils/analytics';
|
||||
import { captureException } from '@/Sentry';
|
||||
import analytics from '@/utils/analytics';
|
||||
|
||||
const { flush: flushAnalytics } = analytics();
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
import React, { useCallback, useState } from 'react';
|
||||
import { Button, Text, XStack, YStack } from 'tamagui';
|
||||
|
||||
import Clipboard from '@react-native-clipboard/clipboard';
|
||||
import { useSettingStore } from '@src/stores/settingStore';
|
||||
|
||||
import { useSettingStore } from '@/stores/settingStore';
|
||||
import {
|
||||
black,
|
||||
slate50,
|
||||
@@ -13,8 +13,8 @@ import {
|
||||
slate500,
|
||||
teal500,
|
||||
white,
|
||||
} from '@src/utils/colors';
|
||||
import { confirmTap } from '@src/utils/haptic';
|
||||
} from '@/utils/colors';
|
||||
import { confirmTap } from '@/utils/haptic';
|
||||
|
||||
interface MnemonicProps {
|
||||
words?: string[];
|
||||
|
||||
@@ -5,10 +5,10 @@ import type { SystemBarStyle } from 'react-native-edge-to-edge';
|
||||
import { SystemBars } from 'react-native-edge-to-edge';
|
||||
import type { TextProps, ViewProps, XStackProps } from 'tamagui';
|
||||
import { Button, View, XStack } from 'tamagui';
|
||||
|
||||
import { Title } from '@src/components/typography/Title';
|
||||
import { ChevronLeft, X } from '@tamagui/lucide-icons';
|
||||
|
||||
import { Title } from '@/components/typography/Title';
|
||||
|
||||
interface NavBarProps extends XStackProps {
|
||||
children: React.ReactNode;
|
||||
backgroundColor?: string;
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
import React from 'react';
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
import type { TextStyle, ViewStyle } from 'tamagui';
|
||||
|
||||
import type { NativeStackHeaderProps } from '@react-navigation/native-stack';
|
||||
import { NavBar } from '@src/components/NavBar/BaseNavBar';
|
||||
import { white } from '@src/utils/colors';
|
||||
import { extraYPadding } from '@src/utils/constants';
|
||||
import { buttonTap } from '@src/utils/haptic';
|
||||
|
||||
import { NavBar } from '@/components/NavBar/BaseNavBar';
|
||||
import { white } from '@/utils/colors';
|
||||
import { extraYPadding } from '@/utils/constants';
|
||||
import { buttonTap } from '@/utils/haptic';
|
||||
|
||||
export const DefaultNavBar = (props: NativeStackHeaderProps) => {
|
||||
const { goBack, canGoBack } = props.navigation;
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
import React from 'react';
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
import { Button } from 'tamagui';
|
||||
|
||||
import type { NativeStackHeaderProps } from '@react-navigation/native-stack';
|
||||
import { NavBar } from '@src/components/NavBar/BaseNavBar';
|
||||
import ActivityIcon from '@src/images/icons/activity.svg';
|
||||
import SettingsIcon from '@src/images/icons/settings.svg';
|
||||
import { black, neutral400, white } from '@src/utils/colors';
|
||||
import { extraYPadding } from '@src/utils/constants';
|
||||
import { buttonTap } from '@src/utils/haptic';
|
||||
|
||||
import { NavBar } from '@/components/NavBar/BaseNavBar';
|
||||
import ActivityIcon from '@/images/icons/activity.svg';
|
||||
import SettingsIcon from '@/images/icons/settings.svg';
|
||||
import { black, neutral400, white } from '@/utils/colors';
|
||||
import { extraYPadding } from '@/utils/constants';
|
||||
import { buttonTap } from '@/utils/haptic';
|
||||
|
||||
export const HomeNavBar = (props: NativeStackHeaderProps) => {
|
||||
const insets = useSafeAreaInsets();
|
||||
|
||||
@@ -4,14 +4,14 @@ import React from 'react';
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
import type { TextStyle, ViewStyle } from 'tamagui';
|
||||
import { XStack, YStack } from 'tamagui';
|
||||
|
||||
import type {
|
||||
NativeStackHeaderProps,
|
||||
NativeStackNavigationOptions,
|
||||
} from '@react-navigation/native-stack';
|
||||
import { NavBar } from '@src/components/NavBar/BaseNavBar';
|
||||
import { cyan300, slate200, white } from '@src/utils/colors';
|
||||
import { buttonTap } from '@src/utils/haptic';
|
||||
|
||||
import { NavBar } from '@/components/NavBar/BaseNavBar';
|
||||
import { cyan300, slate200, white } from '@/utils/colors';
|
||||
import { buttonTap } from '@/utils/haptic';
|
||||
|
||||
interface ProgressNavBarProps extends NativeStackHeaderProps {
|
||||
currentStep?: number;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
|
||||
|
||||
export { DefaultNavBar } from '@src/components/NavBar/DefaultNavBar';
|
||||
export { HomeNavBar } from '@src/components/NavBar/HomeNavBar';
|
||||
export { ProgressNavBar } from '@src/components/NavBar/ProgressNavBar';
|
||||
export { DefaultNavBar } from '@/components/NavBar/DefaultNavBar';
|
||||
export { HomeNavBar } from '@/components/NavBar/HomeNavBar';
|
||||
export { ProgressNavBar } from '@/components/NavBar/ProgressNavBar';
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
import React from 'react';
|
||||
import { Text, View } from 'tamagui';
|
||||
|
||||
import { Caption } from '@src/components/typography/Caption';
|
||||
import { slate500 } from '@src/utils/colors';
|
||||
import { Caption } from '@/components/typography/Caption';
|
||||
import { slate500 } from '@/utils/colors';
|
||||
|
||||
export interface TipProps {
|
||||
title: string;
|
||||
|
||||
@@ -6,10 +6,10 @@ import { Platform, StyleSheet } from 'react-native';
|
||||
import type { ViewProps } from 'tamagui';
|
||||
import { Button, Text } from 'tamagui';
|
||||
|
||||
import { pressedStyle } from '@src/components/buttons/pressedStyle';
|
||||
import { shouldShowAesopRedesign } from '@src/hooks/useAesopRedesign';
|
||||
import analytics from '@src/utils/analytics';
|
||||
import { dinot } from '@src/utils/fonts';
|
||||
import { pressedStyle } from '@/components/buttons/pressedStyle';
|
||||
import { shouldShowAesopRedesign } from '@/hooks/useAesopRedesign';
|
||||
import analytics from '@/utils/analytics';
|
||||
import { dinot } from '@/utils/fonts';
|
||||
|
||||
export interface ButtonProps extends ViewProps {
|
||||
children: React.ReactNode;
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { ActivityIndicator, View } from 'react-native';
|
||||
import { assign, createMachine } from 'xstate';
|
||||
|
||||
import { HeldPrimaryButton } from '@src/components/buttons/PrimaryButtonLongHold';
|
||||
import Description from '@src/components/typography/Description';
|
||||
import { ProofEvents } from '@src/consts/analytics';
|
||||
import { black } from '@src/utils/colors';
|
||||
import { useMachine } from '@xstate/react';
|
||||
|
||||
import { HeldPrimaryButton } from '@/components/buttons/PrimaryButtonLongHold';
|
||||
import Description from '@/components/typography/Description';
|
||||
import { ProofEvents } from '@/consts/analytics';
|
||||
import { black } from '@/utils/colors';
|
||||
|
||||
interface HeldPrimaryButtonProveScreenProps {
|
||||
onVerify: () => void;
|
||||
selectedAppSessionId: string | undefined | null;
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import type { ButtonProps } from '@src/components/buttons/AbstractButton';
|
||||
import AbstractButton from '@src/components/buttons/AbstractButton';
|
||||
import { amber50, black, slate300, white } from '@src/utils/colors';
|
||||
import { normalizeBorderWidth } from '@src/utils/styleUtils';
|
||||
import type { ButtonProps } from '@/components/buttons/AbstractButton';
|
||||
import AbstractButton from '@/components/buttons/AbstractButton';
|
||||
import { amber50, black, slate300, white } from '@/utils/colors';
|
||||
import { normalizeBorderWidth } from '@/utils/styleUtils';
|
||||
|
||||
export function PrimaryButton({ children, ...props }: ButtonProps) {
|
||||
const { borderWidth, ...restProps } = props;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
|
||||
|
||||
import type { ButtonProps } from '@src/components/buttons/AbstractButton';
|
||||
import type { ButtonProps } from '@/components/buttons/AbstractButton';
|
||||
|
||||
export interface HeldPrimaryButtonProps extends ButtonProps {
|
||||
onLongPress: () => void;
|
||||
|
||||
@@ -4,12 +4,12 @@ import React, { useEffect, useState } from 'react';
|
||||
import type { LayoutChangeEvent } from 'react-native';
|
||||
import { Animated, StyleSheet, useAnimatedValue } from 'react-native';
|
||||
|
||||
import { PrimaryButton } from '@src/components/buttons/PrimaryButton';
|
||||
import type { HeldPrimaryButtonProps } from '@src/components/buttons/PrimaryButtonLongHold.shared';
|
||||
import { PrimaryButton } from '@/components/buttons/PrimaryButton';
|
||||
import type { HeldPrimaryButtonProps } from '@/components/buttons/PrimaryButtonLongHold.shared';
|
||||
import {
|
||||
ACTION_TIMER,
|
||||
COLORS,
|
||||
} from '@src/components/buttons/PrimaryButtonLongHold.shared';
|
||||
} from '@/components/buttons/PrimaryButtonLongHold.shared';
|
||||
|
||||
export function HeldPrimaryButton({
|
||||
children,
|
||||
|
||||
@@ -5,12 +5,12 @@ import type { LayoutChangeEvent } from 'react-native';
|
||||
// Tamagui imports for web
|
||||
import { AnimatePresence, YStack } from 'tamagui';
|
||||
|
||||
import { PrimaryButton } from '@src/components/buttons/PrimaryButton';
|
||||
import type { HeldPrimaryButtonProps } from '@src/components/buttons/PrimaryButtonLongHold.shared';
|
||||
import { PrimaryButton } from '@/components/buttons/PrimaryButton';
|
||||
import type { HeldPrimaryButtonProps } from '@/components/buttons/PrimaryButtonLongHold.shared';
|
||||
import {
|
||||
ACTION_TIMER,
|
||||
COLORS,
|
||||
} from '@src/components/buttons/PrimaryButtonLongHold.shared';
|
||||
} from '@/components/buttons/PrimaryButtonLongHold.shared';
|
||||
|
||||
export function HeldPrimaryButton({
|
||||
children,
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import type { ButtonProps } from '@src/components/buttons/AbstractButton';
|
||||
import AbstractButton from '@src/components/buttons/AbstractButton';
|
||||
import { slate200, slate300, slate500, white } from '@src/utils/colors';
|
||||
import { normalizeBorderWidth } from '@src/utils/styleUtils';
|
||||
import type { ButtonProps } from '@/components/buttons/AbstractButton';
|
||||
import AbstractButton from '@/components/buttons/AbstractButton';
|
||||
import { slate200, slate300, slate500, white } from '@/utils/colors';
|
||||
import { normalizeBorderWidth } from '@/utils/styleUtils';
|
||||
|
||||
export function SecondaryButton({ children, ...props }: ButtonProps) {
|
||||
const { borderWidth, ...restProps } = props;
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
|
||||
import { extractMRZInfo } from '@selfxyz/mobile-sdk-alpha';
|
||||
|
||||
import { RCTFragment } from '@src/components/native/RCTFragment';
|
||||
import { RCTFragment } from '@/components/native/RCTFragment';
|
||||
|
||||
interface NativePassportOCRViewProps {
|
||||
onPassportRead: (
|
||||
|
||||
@@ -4,7 +4,7 @@ import React, { useCallback } from 'react';
|
||||
import type { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';
|
||||
import { PixelRatio, Platform, requireNativeComponent } from 'react-native';
|
||||
|
||||
import { RCTFragment } from '@src/components/native/RCTFragment';
|
||||
import { RCTFragment } from '@/components/native/RCTFragment';
|
||||
|
||||
interface NativeQRCodeScannerViewProps {
|
||||
onQRData: (event: NativeSyntheticEvent<{ data: string }>) => void;
|
||||
|
||||
@@ -4,9 +4,9 @@ import React from 'react';
|
||||
import type { TextProps } from 'react-native';
|
||||
import { StyleSheet, Text } from 'react-native';
|
||||
|
||||
import { shouldShowAesopRedesign } from '@src/hooks/useAesopRedesign';
|
||||
import { slate400 } from '@src/utils/colors';
|
||||
import { dinot } from '@src/utils/fonts';
|
||||
import { shouldShowAesopRedesign } from '@/hooks/useAesopRedesign';
|
||||
import { slate400 } from '@/utils/colors';
|
||||
import { dinot } from '@/utils/fonts';
|
||||
|
||||
interface AdditionalProps extends TextProps {}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { styled, Text } from 'tamagui';
|
||||
|
||||
import { dinot } from '@src/utils/fonts';
|
||||
import { dinot } from '@/utils/fonts';
|
||||
|
||||
export const BodyText = styled(Text, {
|
||||
fontFamily: dinot,
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
import { styled } from 'tamagui';
|
||||
|
||||
import { BodyText } from '@src/components/typography/BodyText';
|
||||
import { slate400 } from '@src/utils/colors';
|
||||
import { BodyText } from '@/components/typography/BodyText';
|
||||
import { slate400 } from '@/utils/colors';
|
||||
|
||||
export const Caption = styled(BodyText, {
|
||||
fontSize: 15,
|
||||
|
||||
@@ -4,8 +4,8 @@ import React from 'react';
|
||||
import type { TextProps } from 'react-native';
|
||||
import { StyleSheet, Text } from 'react-native';
|
||||
|
||||
import { slate700 } from '@src/utils/colors';
|
||||
import { dinot } from '@src/utils/fonts';
|
||||
import { slate700 } from '@/utils/colors';
|
||||
import { dinot } from '@/utils/fonts';
|
||||
|
||||
interface CautionProps extends TextProps {}
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ import { StyleSheet } from 'react-native';
|
||||
import type { TextProps } from 'tamagui';
|
||||
import { Text } from 'tamagui';
|
||||
|
||||
import { shouldShowAesopRedesign } from '@src/hooks/useAesopRedesign';
|
||||
import { slate500 } from '@src/utils/colors';
|
||||
import { dinot } from '@src/utils/fonts';
|
||||
import { shouldShowAesopRedesign } from '@/hooks/useAesopRedesign';
|
||||
import { slate500 } from '@/utils/colors';
|
||||
import { dinot } from '@/utils/fonts';
|
||||
|
||||
interface DescriptionProps extends TextProps {}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { styled, Text } from 'tamagui';
|
||||
|
||||
import { dinot } from '@src/utils/fonts';
|
||||
import { dinot } from '@/utils/fonts';
|
||||
|
||||
export const DescriptionTitle = styled(Text, {
|
||||
fontSize: 18,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { styled, Text } from 'tamagui';
|
||||
|
||||
import { dinot } from '@src/utils/fonts';
|
||||
import { dinot } from '@/utils/fonts';
|
||||
|
||||
export const SubHeader = styled(Text, {
|
||||
fontFamily: dinot,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import type { StyleProp, TextStyle } from 'react-native';
|
||||
import { styled, Text } from 'tamagui';
|
||||
|
||||
import { advercase } from '@src/utils/fonts';
|
||||
import { advercase } from '@/utils/fonts';
|
||||
|
||||
export const Title = styled(
|
||||
Text,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { StyleSheet } from 'react-native';
|
||||
|
||||
import { black } from '@src/utils/colors';
|
||||
import { black } from '@/utils/colors';
|
||||
|
||||
export const typography = StyleSheet.create({
|
||||
strong: {
|
||||
|
||||
Reference in New Issue
Block a user