Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beta.12 #450

Merged
merged 2 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/u3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@tiptap/react": "^2.1.13",
"@types/validator": "^13.11.7",
"@us3r-network/auth-with-rainbowkit": "^0.2.1",
"@us3r-network/link": "0.7.0",
"@us3r-network/link": "0.7.1-alpha.0",
"@us3r-network/profile": "0.7.0",
"@wagmi/core": "^1.4.12",
"@xmtp/content-type-remote-attachment": "^1.1.2",
Expand Down
25 changes: 9 additions & 16 deletions apps/u3/src/components/shared/button/SaveButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@
*/
import { FavorButton, FavorButtonProps } from '@us3r-network/link';
import { StarIcon, StarFilledIcon } from '@radix-ui/react-icons';
import styled from 'styled-components';
import { ButtonPrimaryLineCss } from '@/components/common/button/ButtonBase';

export function SaveButton({ ...props }: FavorButtonProps) {
if (props.link?.url) {
props.link.url = props.link.url.replace('?', '%3F');
// todo: 临时解决方案,后续需要在link model里面去掉这个长度限制
if (props.link.url.length > 100) {
props.link.url = props.link.url.slice(0, 100);
}
}
return (
<FavorButtonStyled {...props}>
<FavorButton className="text-[white] border-none" {...props}>
{({ isFavoring, isFavored, favorsCount }) => {
return (
<div title={`This is saved ${favorsCount} times`}>
Expand All @@ -29,18 +34,6 @@ export function SaveButton({ ...props }: FavorButtonProps) {
</div>
);
}}
</FavorButtonStyled>
</FavorButton>
);
}

export const FavorButtonStyled = styled(FavorButton)`
${ButtonPrimaryLineCss}
/* color: #fff; */
border: none;
background: none;
padding: 6px;
height: 32px;
&:hover {
border: none;
}
`;