Skip to content

Commit

Permalink
Merge pull request #290 from Crossbell-Box/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
dohooo authored Jan 15, 2024
2 parents 9473ab2 + 528253e commit 391f0bf
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 38 deletions.
5 changes: 5 additions & 0 deletions .changeset/sixty-sloths-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"xlog": patch
---

Make some content that displays abnormally display normally.
5 changes: 5 additions & 0 deletions .changeset/twenty-plants-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"xlog": patch
---

Push a new screen on current navigation tree.
2 changes: 1 addition & 1 deletion src/components/CommentList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export const CommentList = forwardRef<CommentListInstance, Props>((
}}
ListFooterComponent={comments.isFetchingNextPage && <Spinner paddingVertical="$5"/>}
ListEmptyComponent={<EmptyComponent isLoading={comments.isFetching}/>}
keyExtractor={item => item.blockNumber?.toString()}
keyExtractor={item => item.transactionHash?.toString()}
renderItem={(options) => {
const comment = options.item;
const depth = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/components/FeedList/FeedListItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const FeedListItem: FC<Props> = (props) => {
}, [coverImageSize.height]);

const onPress = React.useCallback(() => {
navigation.navigate(
navigation.push(
"PostDetails",
{
characterId: note.characterId,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/CharacterList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const CharacterListPage: FC<NativeStackScreenProps<RootStackParamList, "C
}}
contentContainerStyle={{ paddingBottom: bottom }}
data={list}
keyExtractor={(item: CharacterEntity) => item?.blockNumber?.toString?.()}
keyExtractor={item => item?.transactionHash?.toString?.()}
estimatedItemSize={100}
estimatedListSize={{
height: height - top - bottom,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/PostDetails/BottomSheetLikeList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const BottomSheetLikeList: FC<{
}}
contentContainerStyle={{ padding: 20, paddingBottom: bottom }}
data={data}
keyExtractor={item => item?.characterId?.toString()}
keyExtractor={item => item?.transactionHash?.toString()}
ListEmptyComponent={(
<Stack height={300}>
{
Expand Down
30 changes: 0 additions & 30 deletions src/pages/PostDetails/javascript-content.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,7 @@
const lazyLoadImages = `
var imagesToBlock = [];
window.addEventListener("load", function() {
var restoreImages = function() {
for (var i = 0; i < imagesToBlock.length; i++) {
imagesToBlock[i].src = imagesToBlock[i].getAttribute("data-src");
}
imagesToBlock = [];
};
var blockImages = function() {
var images = document.getElementsByTagName("img");
for (var i = 0; i < images.length; i++) {
imagesToBlock.push(images[i]);
images[i].setAttribute("data-src", images[i].src);
images[i].src = "";
}
};
document.addEventListener("DOMContentLoaded", function() {
restoreImages();
});
blockImages();
});
`;

export const javaScriptContentLoaded = (
bottomBarHeight: number,
height: number,
) => `
${lazyLoadImages}
const meta = document.createElement('meta');
meta.setAttribute('content', 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0');
meta.setAttribute('name', 'viewport');
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Profile/Comments/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const CommentsPage: FC<NativeStackScreenProps<RootStackParamList, "Commen
comments?.fetchNextPage?.();
}}
ListFooterComponent={(comments.isFetchingNextPage || (comments.isFetching && flattedComments.length === 0)) && <Spinner paddingBottom="$5"/>}
keyExtractor={item => item.transactionHash}
keyExtractor={item => item.transactionHash?.toString()}
renderItem={({ item }) => {
const type = item.toNote?.metadata?.content?.tags?.[0];
let toTitle: string;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Profile/Notifications/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const NotificationsPage: FC<NativeStackScreenProps<RootStackParamList, "Notifica
}}>
<FlashList
data={data}
keyExtractor={item => item.transactionHash}
keyExtractor={item => item.transactionHash?.toString?.()}
ListEmptyComponent={(
<Stack minHeight={containerHeight - 50}>
{
Expand Down
3 changes: 1 addition & 2 deletions src/pages/Replies/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,13 @@ export const RepliesPage: FC<NativeStackScreenProps<RootStackParamList, "Replies
}}
ListFooterComponent={(comments.isFetchingNextPage || (comments.isFetching && flattedComments.length === 0)) && <Spinner paddingBottom="$5"/>}
showsVerticalScrollIndicator={false}
keyExtractor={item => item?.data?.blockNumber?.toString()}
keyExtractor={item => item?.data?.transactionHash?.toString()}
renderItem={({ item }) => {
return (
<Stack paddingHorizontal={16}>
<CommentItem
editable
commentable
key={item?.data?.blockNumber?.toString()}
padding={0}
comment={item?.data}
depth={item?.depth}
Expand Down

0 comments on commit 391f0bf

Please sign in to comment.