Skip to content

Commit

Permalink
fix: update imports and delete unused exports code
Browse files Browse the repository at this point in the history
Signed-off-by: clegirar <[email protected]>
  • Loading branch information
clegirar committed Feb 16, 2024
1 parent 8855108 commit 076b73d
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 89 deletions.
2 changes: 1 addition & 1 deletion packages/components/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
ViewStyle,
} from "react-native";

import { useDropdowns } from "../hooks/useDropdowns";
import { useDropdowns } from "@/hooks/useDropdowns";

interface DropdownProps {
children:
Expand Down
9 changes: 5 additions & 4 deletions packages/components/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import { View, TouchableOpacity } from "react-native";

import { BrandText } from "./BrandText";
import { PrimaryBox } from "./boxes/PrimaryBox";
import { useDropdowns } from "../hooks/useDropdowns";
import { neutral33 } from "../utils/style/colors";
import { fontSemibold13 } from "../utils/style/fonts";
import { layout } from "../utils/style/layout";

import { useDropdowns } from "@/hooks/useDropdowns";
import { neutral33 } from "@/utils/style/colors";
import { fontSemibold13 } from "@/utils/style/fonts";
import { layout } from "@/utils/style/layout";

const DEFAULT_WIDTH = 164;

Expand Down
9 changes: 5 additions & 4 deletions packages/components/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ import chevronLeftSVG from "../../assets/icons/chevron-left.svg";
import chevronRightDoubleSVG from "../../assets/icons/chevron-right-double.svg";
import chevronRightSVG from "../../assets/icons/chevron-right.svg";
import chevronUpSVG from "../../assets/icons/chevron-up.svg";
import { useDropdowns } from "../hooks/useDropdowns";

import { useDropdowns } from "@/hooks/useDropdowns";
import {
neutral33,
neutral77,
neutralA3,
secondaryColor,
} from "../utils/style/colors";
import { fontSemibold13, fontSemibold14 } from "../utils/style/fonts";
import { layout } from "../utils/style/layout";
} from "@/utils/style/colors";
import { fontSemibold13, fontSemibold14 } from "@/utils/style/fonts";
import { layout } from "@/utils/style/layout";

interface PaginationProps {
currentPage: number;
Expand Down
2 changes: 1 addition & 1 deletion packages/components/boxes/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
ViewProps,
} from "react-native";

import { useTheme } from "../../hooks/useTheme";
import { useTheme } from "@/hooks/useTheme";

// Be very careful while editing this, try to refrain from adding new props

Expand Down
13 changes: 7 additions & 6 deletions packages/components/buttons/IconButton.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React from "react";
import { StyleProp, TouchableOpacity, ViewStyle } from "react-native";
import { StyleProp, TouchableOpacity } from "react-native";
import { SvgProps } from "react-native-svg";

import { SVG } from "../SVG";
import { BoxStyle } from "../boxes/Box";
import { SecondaryBox } from "../boxes/SecondaryBox";

import {
borderRadiusButton,
ButtonsSize,
heightButton,
} from "../../utils/style/buttons";
import { primaryColor } from "../../utils/style/colors";
import { SVG } from "../SVG";
import { BoxStyle } from "../boxes/Box";
import { SecondaryBox } from "../boxes/SecondaryBox";
} from "@/utils/style/buttons";
import { primaryColor } from "@/utils/style/colors";

export const IconButton: React.FC<{
width?: number;
Expand Down
5 changes: 3 additions & 2 deletions packages/components/buttons/SocialButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import React from "react";
import { ViewStyle, View, StyleProp, TouchableOpacity } from "react-native";
import { SvgProps } from "react-native-svg";

import { neutral22, neutral33, withAlpha } from "../../utils/style/colors";
import { fontMedium14 } from "../../utils/style/fonts";
import { BrandText } from "../BrandText";
import { SVG } from "../SVG";
import { SecondaryBox } from "../boxes/SecondaryBox";

import { neutral22, neutral33, withAlpha } from "@/utils/style/colors";
import { fontMedium14 } from "@/utils/style/fonts";

export const SocialButton: React.FC<{
text: string;
iconSvg: React.FC<SvgProps>;
Expand Down
11 changes: 6 additions & 5 deletions packages/components/buttons/SocialButtonSecondary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ import React from "react";
import { ViewStyle, View, StyleProp, TouchableOpacity } from "react-native";
import { SvgProps } from "react-native-svg";

import { BrandText } from "../BrandText";
import { SVG } from "../SVG";
import { SecondaryBox } from "../boxes/SecondaryBox";

import {
neutral1A,
primaryColor,
primaryTextColor,
withAlpha,
} from "../../utils/style/colors";
import { fontMedium14 } from "../../utils/style/fonts";
import { BrandText } from "../BrandText";
import { SVG } from "../SVG";
import { SecondaryBox } from "../boxes/SecondaryBox";
} from "@/utils/style/colors";
import { fontMedium14 } from "@/utils/style/fonts";

export const SocialButtonSecondary: React.FC<{
text: string;
Expand Down
11 changes: 4 additions & 7 deletions packages/components/buttons/ToggleableButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@ import { StyleProp, TouchableOpacity } from "react-native";

import chevronDownSVG from "../../../assets/icons/chevron-down.svg";
import chevronUpSVG from "../../../assets/icons/chevron-up.svg";
import {
ButtonsSize,
cornerWidthDropdownButton,
heightDropdownButton,
} from "../../utils/style/buttons";
import { neutral33, secondaryColor } from "../../utils/style/colors";
import { fontSemibold12 } from "../../utils/style/fonts";
import { BrandText } from "../BrandText";
import { SVG } from "../SVG";
import { BoxStyle } from "../boxes/Box";
import { SecondaryBox } from "../boxes/SecondaryBox";

import { ButtonsSize } from "@/utils/style/buttons";
import { neutral33, secondaryColor } from "@/utils/style/colors";
import { fontSemibold12 } from "@/utils/style/fonts";

// Same as _PrimaryButtonTest but with customizable color and backgroundColor
export const ToggleableButton: React.FC<{
textExpanded: string;
Expand Down
79 changes: 38 additions & 41 deletions packages/components/socialFeed/NewsFeed/NewsFeedInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,52 @@ import {
import Animated, { useSharedValue } from "react-native-reanimated";
import { useSelector } from "react-redux";

import audioSVG from "../../../../assets/icons/audio.svg";
import cameraSVG from "../../../../assets/icons/camera.svg";
import penSVG from "../../../../assets/icons/pen.svg";
import priceSVG from "../../../../assets/icons/price.svg";
import videoSVG from "../../../../assets/icons/video.svg";
import { useFeedbacks } from "../../../context/FeedbacksProvider";
import { useWalletControl } from "../../../context/WalletControlProvider";
import { useFeedPosting } from "../../../hooks/feed/useFeedPosting";
import { useAppMode } from "../../../hooks/useAppMode";
import { useIpfs } from "../../../hooks/useIpfs";
import { useIsMobile } from "../../../hooks/useIsMobile";
import { useMaxResolution } from "../../../hooks/useMaxResolution";
import { useSelectedNetworkInfo } from "../../../hooks/useSelectedNetwork";
import useSelectedWallet from "../../../hooks/useSelectedWallet";
import { getUserId, NetworkFeature } from "../../../networks";
import { selectNFTStorageAPI } from "../../../store/slices/settings";
import {
generatePostMetadata,
getPostCategory,
} from "../../../utils/feed/queries";
import { generateIpfsKey } from "../../../utils/ipfs";
import audioSVG from "../../../assets/icons/audio.svg";
import { BrandText } from "../../BrandText";
import { FilesPreviewsContainer } from "../../FilePreview/FilesPreviewsContainer";
import FlexRow from "../../FlexRow";
import { IconBox } from "../../IconBox";
import { OmniLink } from "../../OmniLink";
import { SVG } from "../../SVG";
import { PrimaryBox } from "../../boxes/PrimaryBox";
import { PrimaryButton } from "../../buttons/PrimaryButton";
import { SecondaryButtonOutline } from "../../buttons/SecondaryButtonOutline";
import { FileUploader } from "../../fileUploader";
import { FeedPostingProgressBar } from "../../loaders/FeedPostingProgressBar";
import { SpacerColumn } from "../../spacer";
import { EmojiSelector } from "../EmojiSelector";
import { GIFSelector } from "../GIFSelector";

import { useFeedbacks } from "@/context/FeedbacksProvider";
import { useWalletControl } from "@/context/WalletControlProvider";
import { useFeedPosting } from "@/hooks/feed/useFeedPosting";
import { useAppMode } from "@/hooks/useAppMode";
import { useIpfs } from "@/hooks/useIpfs";
import { useIsMobile } from "@/hooks/useIsMobile";
import { useMaxResolution } from "@/hooks/useMaxResolution";
import { useSelectedNetworkInfo } from "@/hooks/useSelectedNetwork";
import useSelectedWallet from "@/hooks/useSelectedWallet";
import { getUserId, NetworkFeature } from "@/networks";
import { selectNFTStorageAPI } from "@/store/slices/settings";
import { feedPostingStep, FeedPostingStepId } from "@/utils/feed/posting";
import { generatePostMetadata, getPostCategory } from "@/utils/feed/queries";
import { generateIpfsKey } from "@/utils/ipfs";
import {
AUDIO_MIME_TYPES,
IMAGE_MIME_TYPES,
VIDEO_MIME_TYPES,
} from "../../../utils/mime";
} from "@/utils/mime";
import {
SOCIAL_FEED_ARTICLE_MIN_CHARS_LIMIT,
hashtagMatch,
mentionMatch,
removeFileFromArray,
replaceFileInArray,
} from "../../../utils/social-feed";
} from "@/utils/social-feed";
import {
errorColor,
neutral00,
Expand All @@ -53,36 +66,20 @@ import {
primaryTextColor,
secondaryColor,
yellowDefault,
} from "../../../utils/style/colors";
} from "@/utils/style/colors";
import {
fontSemibold12,
fontSemibold13,
fontSemibold16,
} from "../../../utils/style/fonts";
} from "@/utils/style/fonts";
import {
RESPONSIVE_BREAKPOINT_S,
SOCIAL_FEED_BREAKPOINT_M,
layout,
} from "../../../utils/style/layout";
import { replaceBetweenString } from "../../../utils/text";
import { NewPostFormValues, ReplyToType } from "../../../utils/types/feed";
import { LocalFileData, RemoteFileData } from "../../../utils/types/files";
import { BrandText } from "../../BrandText";
import { FilesPreviewsContainer } from "../../FilePreview/FilesPreviewsContainer";
import FlexRow from "../../FlexRow";
import { IconBox } from "../../IconBox";
import { OmniLink } from "../../OmniLink";
import { SVG } from "../../SVG";
import { PrimaryBox } from "../../boxes/PrimaryBox";
import { PrimaryButton } from "../../buttons/PrimaryButton";
import { SecondaryButtonOutline } from "../../buttons/SecondaryButtonOutline";
import { FileUploader } from "../../fileUploader";
import { FeedPostingProgressBar } from "../../loaders/FeedPostingProgressBar";
import { SpacerColumn } from "../../spacer";
import { EmojiSelector } from "../EmojiSelector";
import { GIFSelector } from "../GIFSelector";

import { feedPostingStep, FeedPostingStepId } from "@/utils/feed/posting";
} from "@/utils/style/layout";
import { replaceBetweenString } from "@/utils/text";
import { NewPostFormValues, ReplyToType } from "@/utils/types/feed";
import { LocalFileData, RemoteFileData } from "@/utils/types/files";

interface NewsFeedInputProps {
type: "comment" | "post";
Expand Down
18 changes: 0 additions & 18 deletions packages/utils/style/buttons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,6 @@ export const borderRadiusButton = (format: ButtonsSize) => {
}
};

export const heightDropdownButton = (format: ButtonsSize) => {
switch (format) {
case "SM":
return 40;
case "XS":
return 24;
}
};

export const cornerWidthDropdownButton = (format: ButtonsSize) => {
switch (format) {
case "XS":
return 5;
default:
return 8;
}
};

export const horizontalPaddingButton = (format: ButtonsSize) => {
switch (format) {
case "XXS":
Expand Down

0 comments on commit 076b73d

Please sign in to comment.