Skip to content

Commit

Permalink
Merge pull request #492 from us3r-network/F-botSave-bufan
Browse files Browse the repository at this point in the history
fix title length issue
  • Loading branch information
sin-bufan authored Jan 25, 2024
2 parents 6f98ef0 + 9803b3b commit f4d3f0f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions apps/u3/src/components/save/SaveExploreListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function SaveExploreListItem({
<Wrapper {...props}>
<ListItemInner>
<IconLink text={data.url} logo={data?.logo} className="iconLink" />
<TitleText>{data.title || data.url}</TitleText>
<TitleText row={4}>{data.title || data.url}</TitleText>
{!!data?.createAt && (
<TimeText className="timeText">
{defaultFormatFromNow(data.createAt)}
Expand Down Expand Up @@ -57,14 +57,14 @@ const TitleText = styled(EllipsisText)`
flex: 1;
font-weight: 500;
font-size: 16px;
line-height: 19px;
line-height: 20px;
color: #ffffff;
`;

const TimeText = styled.span`
font-weight: 400;
font-size: 14px;
line-height: 17px;
line-height: 18px;
color: #718096;
`;
Expand Down
4 changes: 3 additions & 1 deletion apps/u3/src/components/save/SyncingBotSaves.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export default function SyncingBotSaves({
url: `https://u3.xyz/social/post-detail/fcast/${Buffer.from(
castHash.data
).toString('hex')}`,
title: text || 'Saved Farcaster Cast using U3 Bot',
title: text
? text.slice(0, 200)
: 'Saved Farcaster Cast using U3 Bot',
type: 'link',
data: JSON.stringify(item),
};
Expand Down
14 changes: 7 additions & 7 deletions apps/u3/src/container/Save.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,14 @@ const EmptyDesc = styled.span`

export default function Save() {
const { isFetching, personalFavors } = usePersonalFavors();
const [savedLink, setSavedLink] = useState([]);
const [savedLinks, setSavedLinks] = useState([]);
// console.log('personalFavors', personalFavors);
const list = useMemo(
() => [
...savedLinks.map((item) => {
const createAt = item.createAt || new Date().getTime();
return { ...item, createAt };
}),
...uniqBy(
personalFavors
.filter((item) => !!item?.link && item.link.type !== 'test')
Expand Down Expand Up @@ -93,12 +97,8 @@ export default function Save() {
}),
'id'
),
...savedLink.map((item) => {
const createAt = item.createAt || new Date().getTime();
return { ...item, createAt };
}),
],
[personalFavors, savedLink]
[personalFavors, savedLinks]
);
const isEmpty = useMemo(() => list.length === 0, [list]);
return (
Expand All @@ -107,7 +107,7 @@ export default function Save() {
<SyncingBotSaves
onComplete={(saves) => {
console.log('onComplete SyncingBotSaves');
setSavedLink(saves);
setSavedLinks(saves);
}}
/>
<ContentWrapper>
Expand Down

0 comments on commit f4d3f0f

Please sign in to comment.