Skip to content

Conversation

@germanurrus
Copy link
Contributor

@germanurrus germanurrus commented Oct 31, 2022

Creates /profile page. When loading page from another user url will be /profile?addr=someAddr
Desktop:
Screen Shot 2022-11-02 at 13 06 32

Mobile:
Screen Shot 2022-11-02 at 13 06 41

Copy does:
Screen Shot 2022-11-02 at 13 09 41

Copy Link does:
Screen Shot 2022-11-02 at 13 07 08

@germanurrus germanurrus changed the base branch from main to release-v2.0.0 October 31, 2022 16:16
@linear
Copy link

linear bot commented Oct 31, 2022

CAS-664

@germanurrus germanurrus marked this pull request as ready for review November 2, 2022 16:10
@germanurrus germanurrus requested a review from a team as a code owner November 2, 2022 16:10
</>
);
};
export default ShareDropdown;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component is reused in the proposal copy and in the user profile

}
};

export default Tooltip;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turning into TS

defaultProps: {},
};

export default Button;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adds sizes for buttons based on designs

@germanurrus germanurrus changed the title CAS-664: WIP User Profile Page Layout CAS-664: User Profile Page Layout Nov 2, 2022
} from '@chakra-ui/react';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const CustomTab = forwardRef<HTMLElement, any>((props, ref) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add an interface above to define the props for the component instead of using any?

Comment on lines +26 to +28
{isSelected ? (
<Svg name="Star" width="13" height="13" fill="black" />
) : null}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of ternary here you could use isSelected && <Svg />

Comment on lines +21 to +25
const twitterPost = `https://twitter.com/intent/tweet?text=${encodeURIComponent(
userVoted
? `I just voted on ${proposalName} on CAST! ${proposalUrl}`
: `Check out ${proposalName} on CAST! ${proposalUrl}`
)} `;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should just be

const twitterPost = userVoted
      ? `I just voted on ${proposalName} on CAST! ${proposalUrl}`
      : `Check out ${proposalName} on CAST! ${proposalUrl}`

because below in the component you using the twitter intent url again

</MenuButton>
<MenuList borderRadius="2xl" maxW="192px" minW="192px">
<MenuItem display="flex" alignItems="center" minHeight="48px" pl={3}>
<CopyToClipboard text={copyString} onCopy={() => {}}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should utilize useClipboard from Chakra instead this will allow us to remove react-copy-to-clipboard

const profileUrl = `${FRONTEND_URL}/#/profile?addr=${userAddr}`;

const twitterPost = `https://twitter.com/intent/tweet?text=${encodeURIComponent(
`Check at my profile in ${profileUrl} on CAST! `
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`Check at my profile in ${profileUrl} on CAST! `
`Check at my profile on CAST! ${profileUrl}`

Check with product they may have better copy that we can use for the tweet

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here as well I don't think you need the url in the string because ShareDropdown uses the twitter url and encodes the string passed to the component

alwaysVisible={true}
enabled={addressCopied}
>
<CopyToClipboard text={addr} onCopy={markAddressCopied}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here maybe we can utilize useClipboard from Chakra

const UserProfile: React.FC = () => {
const {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you use // @ts-expect-error: Enter reason here then you don't need the eslint disable and we will have a documented reason why for why we need to ignore the line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants