Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat-feed-article-mar…
Browse files Browse the repository at this point in the history
…kdown
  • Loading branch information
WaDadidou committed Dec 20, 2024
2 parents af89a05 + 0088374 commit 74ad2d9
Show file tree
Hide file tree
Showing 26 changed files with 135 additions and 126 deletions.
22 changes: 18 additions & 4 deletions packages/components/inputs/TextInputCustom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import {
neutralA3,
secondaryColor,
} from "../../utils/style/colors";
import { fontMedium10, fontSemibold14 } from "../../utils/style/fonts";
import { fontRegular10, fontRegular14 } from "../../utils/style/fonts";
import { layout } from "../../utils/style/layout";
import { BrandText } from "../BrandText";
import { ErrorText } from "../ErrorText";
Expand Down Expand Up @@ -100,7 +100,7 @@ export const Label: React.FC<{
<BrandText
style={[
styles.labelText,
fontSemibold14,
fontRegular14,
style,
hovered && { color: secondaryColor },
]}
Expand All @@ -111,7 +111,7 @@ export const Label: React.FC<{
<BrandText
style={[
styles.labelText,
fontSemibold14,
fontRegular14,
{ color: additionalRed, marginLeft: layout.spacing_x0_5 },
]}
>
Expand Down Expand Up @@ -284,9 +284,23 @@ export const TextInputCustom = <T extends FieldValues>({
(variant !== "labelOutside" && !hideLabel && (
<>
<BrandText
style={[styles.labelText, fontMedium10, labelStyle]}
style={[styles.labelText, fontRegular10, labelStyle]}
>
{label}
{rules?.required && (
<BrandText
style={[
styles.labelText,
fontRegular10,
{
color: additionalRed,
marginLeft: layout.spacing_x0_5,
},
]}
>
*
</BrandText>
)}
</BrandText>
<SpacerColumn size={0.5} />
</>
Expand Down
4 changes: 2 additions & 2 deletions packages/components/mini/SelectPicture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { SVG } from "@/components/SVG";
import { CustomPressable } from "@/components/buttons/CustomPressable";
import { IMAGE_MIME_TYPES } from "@/utils/mime";
import { neutral33 } from "@/utils/style/colors";
import { fontSemibold14 } from "@/utils/style/fonts";
import { fontRegular14 } from "@/utils/style/fonts";
import { layout } from "@/utils/style/layout";
import { LocalFileData } from "@/utils/types/files";

Expand Down Expand Up @@ -107,7 +107,7 @@ export const SelectPicture = ({
>
<SVG source={Img} width={16} height={16} />
{squareSelectorOptions.placeholder && (
<BrandText style={fontSemibold14}>
<BrandText style={fontRegular14}>
{squareSelectorOptions.placeholder}
</BrandText>
)}
Expand Down
10 changes: 8 additions & 2 deletions packages/components/modals/ModalBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { useSafeAreaInsets } from "react-native-safe-area-context";
import chevronLeft from "../../../assets/icons/chevron-left.svg";
import closeSVG from "../../../assets/icons/hamburger-button-cross.svg";
import { neutral77, neutral22 } from "../../utils/style/colors";
import { fontSemibold14 } from "../../utils/style/fonts";
import { fontRegular20, fontSemibold14 } from "../../utils/style/fonts";
import { layout, RESPONSIVE_BREAKPOINT_S } from "../../utils/style/layout";
import { modalMarginPadding } from "../../utils/style/modals";
import { BrandText } from "../BrandText";
Expand Down Expand Up @@ -200,7 +200,13 @@ const ModalBase: React.FC<ModalBaseProps> = ({

<View style={{ flex: 1, width: "100%" }}>
{!!label && (
<BrandText style={{ color: "white", lineHeight: 24 }}>
<BrandText
style={{
...fontRegular20,
color: "white",
lineHeight: 24,
}}
>
{label}
</BrandText>
)}
Expand Down
4 changes: 2 additions & 2 deletions packages/components/music/FeedMusicList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { useAppMode } from "../../hooks/useAppMode";
import useSelectedWallet from "../../hooks/useSelectedWallet";
import { NetworkFeature } from "../../networks";
import { zodTryParseJSON } from "../../utils/sanitize";
import { fontSemibold20 } from "../../utils/style/fonts";
import { fontRegular20 } from "../../utils/style/fonts";
import { layout } from "../../utils/style/layout";
import {
PostCategory,
Expand Down Expand Up @@ -108,7 +108,7 @@ export const FeedMusicList: React.FC<{
return (
<View style={[containerCStyle, style]}>
<View style={oneLineCStyle}>
<BrandText style={fontSemibold20}>{title}</BrandText>
<BrandText style={fontRegular20}>{title}</BrandText>
<View style={buttonGroupCStyle}>
{allowUpload && <UploadMusicButton onPress={onPressUploadMusic} />}
</View>
Expand Down
8 changes: 4 additions & 4 deletions packages/components/music/TrackCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
neutralFF,
primaryColor,
} from "@/utils/style/colors";
import { fontMedium13, fontSemibold14 } from "@/utils/style/fonts";
import { fontRegular13, fontRegular14 } from "@/utils/style/fonts";
import { layout } from "@/utils/style/layout";
import { ZodSocialFeedTrackMetadata } from "@/utils/types/feed";
import { Media } from "@/utils/types/mediaPlayer";
Expand Down Expand Up @@ -124,7 +124,7 @@ export const TrackCard: React.FC<{
</View>
)}
</CustomPressable>
<BrandText style={[fontSemibold14, { height: 40 }]} numberOfLines={2}>
<BrandText style={[fontRegular14, { height: 40 }]} numberOfLines={2}>
{track?.title || ""}
</BrandText>
<SpacerColumn size={0.5} />
Expand Down Expand Up @@ -176,11 +176,11 @@ const positionButtonBoxStyle: ViewStyle = {
};

const contentDescriptionStyle: TextStyle = {
...fontMedium13,
...fontRegular13,
color: neutral77,
};

const contentNameStyle: TextStyle = {
...fontSemibold14,
...fontRegular14,
color: primaryColor,
};
14 changes: 11 additions & 3 deletions packages/components/music/TrackOptionsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { SpacerColumn } from "../spacer";
import { Post } from "@/api/feed/v1/feed";
import ThreeDotsCircleWhite from "@/assets/icons/music/three-dot-circle-white.svg";
import { useAppMode } from "@/hooks/useAppMode";
import { fontRegular16, fontRegular20 } from "@/utils/style/fonts";
import { layout } from "@/utils/style/layout";

const BUTTONS_HEIGHT = 28;
Expand All @@ -29,7 +30,14 @@ export const TrackOptionsButton: FC<{
};

const TrackOptionModalHeader = () => {
return <BrandText numberOfLines={2}>{trackName}</BrandText>;
return (
<BrandText
numberOfLines={2}
style={{ ...fontRegular20, alignSelf: "center" }}
>
{trackName}
</BrandText>
);
};

return (
Expand Down Expand Up @@ -70,7 +78,7 @@ export const TrackOptionsButton: FC<{
alignItems: "center",
}}
>
<BrandText>Share</BrandText>
<BrandText style={fontRegular16}>Share</BrandText>
<ShareButton postId={post.id} useAltStyle />
</View>
<View
Expand All @@ -79,7 +87,7 @@ export const TrackOptionsButton: FC<{
alignItems: "center",
}}
>
<BrandText>Tip</BrandText>
<BrandText style={fontRegular16}>Tip</BrandText>
<TipButton
postId={post.id}
authorId={post.authorId}
Expand Down
5 changes: 2 additions & 3 deletions packages/components/music/UploadMusicButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { TextStyle, TouchableOpacity, ViewStyle } from "react-native";

import Upload from "../../../assets/icons/upload_alt.svg";
import { neutral30, primaryColor } from "../../utils/style/colors";
import { fontSemibold14 } from "../../utils/style/fonts";
import { fontRegular14 } from "../../utils/style/fonts";
import { layout } from "../../utils/style/layout";
import { BrandText } from "../BrandText";
import { SVG } from "../SVG";
Expand Down Expand Up @@ -42,7 +42,6 @@ const buttonContainerStyle: ViewStyle = {
borderRadius: 999,
};
const buttonTextStyle: TextStyle = {
...fontSemibold14,

...fontRegular14,
color: primaryColor,
};
16 changes: 4 additions & 12 deletions packages/components/music/UploadMusicModal/UploadTrack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
neutral77,
primaryColor,
} from "../../../utils/style/colors";
import { fontSemibold14 } from "../../../utils/style/fonts";
import { fontRegular14, fontSemibold14 } from "../../../utils/style/fonts";
import { layout } from "../../../utils/style/layout";
import {
CustomLatLngExpression,
Expand Down Expand Up @@ -282,14 +282,7 @@ export const UploadTrack: React.FC<Props> = ({ onUploadDone }) => {
</TouchableOpacity>

<SpacerColumn size={3} />
<BrandText
style={[
fontSemibold14,
{
color: neutral77,
},
]}
>
<BrandText style={[fontRegular14, { color: neutral77 }]}>
Provide FLAC, WAV or AIFF for highest audio quality.
</BrandText>
<SpacerColumn size={2.5} />
Expand Down Expand Up @@ -357,7 +350,7 @@ const buttonContainerStyle: ViewStyle = {
// marginBottom: layout.spacing_x2,
};
const buttonTextStyle: TextStyle = {
...fontSemibold14,
...fontRegular14,
color: primaryColor,
};
const divideLineStyle: ViewStyle = {
Expand All @@ -374,8 +367,7 @@ const footerBottomCStyle: ViewStyle = {
marginBottom: layout.spacing_x2,
};
const footerTextStyle: TextStyle = {
...fontSemibold14,

...fontRegular14,
color: neutral77,
};
const inputBoxStyle: ViewStyle = {
Expand Down
4 changes: 2 additions & 2 deletions packages/components/socialFeed/FeedFeeText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { StyleProp, TextStyle, View, ViewStyle } from "react-native";
import { useFeedPosting } from "../../hooks/feed/useFeedPosting";
import { useTheme } from "../../hooks/useTheme";
import { errorColor, neutral77 } from "../../utils/style/colors";
import { fontSemibold14 } from "../../utils/style/fonts";
import { fontRegular14 } from "../../utils/style/fonts";
import { PostCategory } from "../../utils/types/feed";
import { BrandText } from "../BrandText";

Expand Down Expand Up @@ -45,6 +45,6 @@ export const FeedFeeText: React.FC<{
};

const testCStyle: TextStyle = {
...fontSemibold14,
...fontRegular14,
color: neutral77,
};
40 changes: 20 additions & 20 deletions packages/components/socialFeed/NewsFeed/NewsFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,16 @@ import {
useFetchFeed,
} from "../../../hooks/feed/useFetchFeed";
import { useIsMobile } from "../../../hooks/useIsMobile";
import { useMaxResolution } from "../../../hooks/useMaxResolution";
import useSelectedWallet from "../../../hooks/useSelectedWallet";
import {
layout,
RESPONSIVE_BREAKPOINT_S,
screenContentMaxWidth,
} from "../../../utils/style/layout";
import { layout, RESPONSIVE_BREAKPOINT_S } from "../../../utils/style/layout";
import { PostCategory } from "../../../utils/types/feed";
import { SpacerColumn, SpacerRow } from "../../spacer";
import { SocialArticleCard } from "../SocialCard/cards/SocialArticleCard";
import { SocialThreadCard } from "../SocialCard/cards/SocialThreadCard";
import { SocialVideoCard } from "../SocialCard/cards/SocialVideoCard";

import { SocialArticleMarkdownCard } from "@/components/socialFeed/SocialCard/cards/SocialArticleMarkdownCard";
import { useMaxResolution } from "@/hooks/useMaxResolution";
import { DeepPartial } from "@/utils/typescript";

const OFFSET_Y_LIMIT_FLOATING = 224;
Expand Down Expand Up @@ -64,7 +60,7 @@ export const NewsFeed: React.FC<NewsFeedProps> = ({
}) => {
const isMobile = useIsMobile();
const { width: windowWidth } = useWindowDimensions();
const { width } = useMaxResolution();
const { width } = useMaxResolution({ isLarge: true });
const selectedWallet = useSelectedWallet();
const reqWithQueryUser = { ...req, queryUserId: selectedWallet?.userId };
const { data, isFetching, refetch, hasNextPage, fetchNextPage, isLoading } =
Expand Down Expand Up @@ -180,7 +176,6 @@ export const NewsFeed: React.FC<NewsFeedProps> = ({
<View
style={{
width: windowWidth < RESPONSIVE_BREAKPOINT_S ? windowWidth : width,
maxWidth: screenContentMaxWidth,
}}
>
{post.category === PostCategory.Article ? (
Expand Down Expand Up @@ -217,21 +212,21 @@ export const NewsFeed: React.FC<NewsFeedProps> = ({
[windowWidth, width, isFlagged, refetch, cardStyle],
);

// We have to keep the first fragment here to don't have a loop of re-renders
return (
<>
<Animated.FlatList
data={posts}
renderItem={({ item: post }) => RenderItem(post)}
ListHeaderComponentStyle={{
zIndex: 1,
width: windowWidth,
maxWidth: screenContentMaxWidth,
}}
ListHeaderComponentStyle={{ zIndex: 1 }}
ListHeaderComponent={
<>
<View
onLayout={onHeaderLayout}
style={{ width, alignSelf: "center", alignItems: "center" }}
style={{
alignSelf: "center",
alignItems: "center",
}}
>
<Header />
</View>
Expand All @@ -240,7 +235,17 @@ export const NewsFeed: React.FC<NewsFeedProps> = ({
}
keyExtractor={(post) => post.id}
onScroll={scrollHandler}
contentContainerStyle={contentCStyle}
contentContainerStyle={
isMobile
? {
alignItems: "center",
width: "100%",
}
: {
alignSelf: "center",
width,
}
}
onEndReachedThreshold={4}
onEndReached={onEndReached}
/>
Expand Down Expand Up @@ -269,11 +274,6 @@ export const NewsFeed: React.FC<NewsFeedProps> = ({
);
};

const contentCStyle: ViewStyle = {
alignItems: "center",
alignSelf: "center",
width: "100%",
};
const floatingActionsCStyle: ViewStyle = {
position: "absolute",
justifyContent: "center",
Expand Down
4 changes: 1 addition & 3 deletions packages/components/socialFeed/NewsFeed/NewsFeedInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import { useWalletControl } from "@/context/WalletControlProvider";
import { useFeedPosting } from "@/hooks/feed/useFeedPosting";
import { useAppMode } from "@/hooks/useAppMode";
import { useIpfs } from "@/hooks/useIpfs";
import { useMaxResolution } from "@/hooks/useMaxResolution";
import { useSelectedNetworkInfo } from "@/hooks/useSelectedNetwork";
import useSelectedWallet from "@/hooks/useSelectedWallet";
import { NetworkFeature, getNetworkFeature } from "@/networks";
Expand Down Expand Up @@ -133,7 +132,6 @@ export const NewsFeedInput = React.forwardRef<
) => {
const [appMode] = useAppMode();
const { width: windowWidth } = useWindowDimensions();
const { width } = useMaxResolution();
const [viewWidth, setViewWidth] = useState(0);
const { uploadFilesToPinata, ipfsUploadProgress } = useIpfs();
const inputMaxHeight = 400;
Expand Down Expand Up @@ -355,7 +353,7 @@ export const NewsFeedInput = React.forwardRef<

return (
<View
style={[{ width }, style]}
style={[{ width: "100%" }, style]}
onLayout={(e) => setViewWidth(e.nativeEvent.layout.width)}
>
{isMapShown && (
Expand Down
Loading

0 comments on commit 74ad2d9

Please sign in to comment.